Files
graphify/tests/test_antigravity_install.py
Safi 9a298c5a32 write antigravity rules and workflows on project-scoped install
graphify install --project --platform antigravity went through the skill-only
branch (grouped with copilot/pi/kimi), so it copied SKILL.md but never wrote
.agents/rules/graphify.md or .agents/workflows/graphify.md - antigravity's
always-on layer - even though the project uninstall path removes them. Extract
the frontmatter + rules + workflows writes into _antigravity_finalize and call
it from both the global antigravity install and the project-scoped path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 23:48:54 +01:00

29 lines
1.5 KiB
Python

"""Antigravity install lays down its full always-on layer, not just the skill.
Regression: project-scoped `install --project --platform antigravity` previously
went through the skill-only branch (grouped with copilot/pi/kimi), so it copied
the SKILL.md but never wrote `.agents/rules/graphify.md` or
`.agents/workflows/graphify.md` - even though the uninstall path removes them.
"""
import graphify.__main__ as m
def test_antigravity_project_install_writes_rules_and_workflows(tmp_path):
m._project_install("antigravity", tmp_path)
skill = tmp_path / ".agents" / "skills" / "graphify" / "SKILL.md"
rules = tmp_path / ".agents" / "rules" / "graphify.md"
workflow = tmp_path / ".agents" / "workflows" / "graphify.md"
assert skill.exists(), "skill should be installed under .agents/skills/"
assert rules.exists(), "antigravity rules (always-on) must be written"
assert workflow.exists(), "antigravity workflow must be written"
# native tool-discovery frontmatter is injected into the skill
assert skill.read_text(encoding="utf-8").startswith("---\n")
def test_antigravity_project_uninstall_clears_rules_and_workflows(tmp_path):
m._project_install("antigravity", tmp_path)
m._project_uninstall("antigravity", tmp_path)
assert not (tmp_path / ".agents" / "rules" / "graphify.md").exists()
assert not (tmp_path / ".agents" / "workflows" / "graphify.md").exists()
assert not (tmp_path / ".agents" / "skills" / "graphify" / "SKILL.md").exists()