test-antigravity-tools.sh 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/usr/bin/env bash
  2. # Validate the Antigravity (agy) integration. agy installs the existing plugin
  3. # directly (`agy plugin install <repo-url>`): it loads the bundled skills and
  4. # runs the SessionStart hook for bootstrap, so there is no agy-specific scaffold
  5. # to test. What IS agy-specific is the tool mapping — agy has no `Skill` tool and
  6. # loads skills by reading SKILL.md with view_file — and SKILL.md pointing at it.
  7. #
  8. # Mirrors tests/pi/test-pi-extension.mjs's "tools reference documents
  9. # harness-specific mappings" check. CI-safe: does not require `agy` installed.
  10. set -euo pipefail
  11. SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  12. REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
  13. MAPPING="$REPO_ROOT/skills/using-superpowers/references/antigravity-tools.md"
  14. SKILL="$REPO_ROOT/skills/using-superpowers/SKILL.md"
  15. fail() { echo "FAIL: $*" >&2; exit 1; }
  16. echo "test-antigravity-tools: checking Antigravity tool mapping"
  17. # --- Mapping exists ---------------------------------------------------------
  18. [ -f "$MAPPING" ] || fail "tool mapping missing at $MAPPING"
  19. # --- Skill-load mechanism: view_file on SKILL.md (IsSkillFile), no Skill tool -
  20. grep -qiE "view_file" "$MAPPING" \
  21. || fail "mapping does not document view_file as the file/skill-read tool"
  22. grep -qiE "SKILL\.md" "$MAPPING" \
  23. || fail "mapping does not document reading SKILL.md as the skill-load path"
  24. grep -q "IsSkillFile" "$MAPPING" \
  25. || fail "mapping does not document setting IsSkillFile when loading a skill"
  26. # --- Core action→tool mappings are documented -------------------------------
  27. for tool in write_to_file replace_file_content run_command grep_search invoke_subagent; do
  28. grep -q "$tool" "$MAPPING" \
  29. || fail "mapping does not document the '$tool' tool"
  30. done
  31. # --- Subagents use the built-in self/research types -------------------------
  32. grep -q '`self`' "$MAPPING" \
  33. || fail "mapping does not document the built-in 'self' subagent type"
  34. grep -q '`research`' "$MAPPING" \
  35. || fail "mapping does not document the built-in 'research' subagent type"
  36. # --- Task tracking documents the 'task' artifact mechanism ------------------
  37. grep -qE 'ArtifactType.*task|task. artifact' "$MAPPING" \
  38. || fail "mapping does not document task tracking as a 'task' artifact"
  39. # --- SKILL.md Platform Adaptation links the mapping -------------------------
  40. grep -q "antigravity-tools.md" "$SKILL" \
  41. || fail "SKILL.md Platform Adaptation does not reference antigravity-tools.md"
  42. echo "PASS: Antigravity tool mapping valid (view_file skill-load, agy tools, SKILL.md link)"