Skip to content

Commit 2568422

Browse files
bavekuCopilot
andauthored
fix(integrations): migrate Antigravity (agy) layout to .agents/ and deprecate --skills (#2276)
* refactor(agy): update storage directory from .agent to .agents * feat: update Antigravity integration to use .agents/ directory layout and add version compatibility warnings * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * refactor: remove deprecated --skills flag from AgyIntegration and update related test assertions * Update src/specify_cli/integrations/agy/__init__.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * refactor: update Antigravity integration requirement to v1.20.5 and remove obsolete tests * test: update skills directory path from .agent to .agents in preset restoration test * Update tests/integrations/test_integration_agy.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tests/integrations/test_integration_agy.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent c118c1c commit 2568422

File tree

3 files changed

+50
-21
lines changed

3 files changed

+50
-21
lines changed
Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
"""Antigravity (agy) integration — skills-based agent.
22
3-
Antigravity uses ``.agent/skills/speckit-<name>/SKILL.md`` layout.
4-
Explicit command support was deprecated in version 1.20.5;
5-
``--skills`` defaults to ``True``.
3+
Antigravity uses ``.agents/skills/speckit-<name>/SKILL.md`` layout (enforced since v1.20.5).
64
"""
75

86
from __future__ import annotations
97

10-
from ..base import IntegrationOption, SkillsIntegration
8+
from pathlib import Path
9+
from typing import TYPE_CHECKING, Any
10+
11+
from ..base import SkillsIntegration
12+
13+
if TYPE_CHECKING:
14+
from ..manifest import IntegrationManifest
15+
1116

1217

1318
class AgyIntegration(SkillsIntegration):
@@ -16,26 +21,32 @@ class AgyIntegration(SkillsIntegration):
1621
key = "agy"
1722
config = {
1823
"name": "Antigravity",
19-
"folder": ".agent/",
24+
"folder": ".agents/",
2025
"commands_subdir": "skills",
2126
"install_url": None,
2227
"requires_cli": False,
2328
}
2429
registrar_config = {
25-
"dir": ".agent/skills",
30+
"dir": ".agents/skills",
2631
"format": "markdown",
2732
"args": "$ARGUMENTS",
2833
"extension": "/SKILL.md",
2934
}
3035
context_file = "AGENTS.md"
3136

32-
@classmethod
33-
def options(cls) -> list[IntegrationOption]:
34-
return [
35-
IntegrationOption(
36-
"--skills",
37-
is_flag=True,
38-
default=True,
39-
help="Install as agent skills (default for Antigravity since v1.20.5)",
40-
),
41-
]
37+
def setup(
38+
self,
39+
project_root: Path,
40+
manifest: IntegrationManifest,
41+
parsed_options: dict[str, Any] | None = None,
42+
**opts: Any,
43+
) -> list[Path]:
44+
import click
45+
46+
click.secho(
47+
"Warning: The .agents/ layout requires Antigravity v1.20.5 or newer. "
48+
"Please ensure your agy installation is up to date.",
49+
fg="yellow",
50+
err=True,
51+
)
52+
return super().setup(project_root, manifest, parsed_options=parsed_options, **opts)

tests/integrations/test_integration_agy.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@
55

66
class TestAgyIntegration(SkillsIntegrationTests):
77
KEY = "agy"
8-
FOLDER = ".agent/"
8+
FOLDER = ".agents/"
99
COMMANDS_SUBDIR = "skills"
10-
REGISTRAR_DIR = ".agent/skills"
10+
REGISTRAR_DIR = ".agents/skills"
1111
CONTEXT_FILE = "AGENTS.md"
1212

13-
13+
def test_options_include_skills_flag(self):
14+
"""Override inherited test: AgyIntegration should not expose a --skills flag because .agents/ is its only layout."""
15+
from specify_cli.integrations import get_integration
16+
i = get_integration(self.KEY)
17+
skills_opts = [o for o in i.options() if o.name == "--skills"]
18+
assert len(skills_opts) == 0
1419
class TestAgyAutoPromote:
1520
"""--ai agy auto-promotes to integration path."""
1621

@@ -24,4 +29,17 @@ def test_ai_agy_without_ai_skills_auto_promotes(self, tmp_path):
2429
result = runner.invoke(app, ["init", str(target), "--ai", "agy", "--no-git", "--script", "sh"])
2530

2631
assert result.exit_code == 0, f"init --ai agy failed: {result.output}"
27-
assert (target / ".agent" / "skills" / "speckit-plan" / "SKILL.md").exists()
32+
assert (target / ".agents" / "skills" / "speckit-plan" / "SKILL.md").exists()
33+
34+
def test_agy_setup_warning(self, tmp_path):
35+
"""Agy integration should print a warning about v1.20.5 requirement during setup."""
36+
from typer.testing import CliRunner
37+
from specify_cli import app
38+
39+
# Click >= 8.2 separates stdout and stderr natively, mix_stderr is removed
40+
runner = CliRunner()
41+
target = tmp_path / "test-proj2"
42+
result = runner.invoke(app, ["init", str(target), "--ai", "agy", "--no-git", "--script", "sh"])
43+
44+
assert result.exit_code == 0
45+
assert "Warning: The .agents/ layout requires Antigravity v1.20.5 or newer" in result.stderr

tests/test_presets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2447,7 +2447,7 @@ def test_kimi_preset_skill_override_resolves_script_placeholders(self, project_d
24472447
def test_agy_skill_restored_on_preset_remove(self, project_dir, temp_dir):
24482448
"""Agy preset removal should restore native skills instead of deleting them."""
24492449
self._write_init_options(project_dir, ai="agy", ai_skills=True)
2450-
skills_dir = project_dir / ".agent" / "skills"
2450+
skills_dir = project_dir / ".agents" / "skills"
24512451
self._create_skill(skills_dir, "speckit-specify", body="before override")
24522452

24532453
core_command = project_dir / ".specify" / "templates" / "commands" / "specify.md"

0 commit comments

Comments
 (0)