test-antigravity-tools.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 — subagent dispatch via
  6. # invoke_subagent (self/research types) and task tracking via a task artifact —
  7. # and SKILL.md pointing at it.
  8. #
  9. # Mirrors tests/pi/test-pi-extension.mjs's "tools reference documents
  10. # harness-specific mappings" check. CI-safe: does not require `agy` installed.
  11. set -euo pipefail
  12. SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  13. REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
  14. MAPPING="$REPO_ROOT/skills/using-superpowers/references/antigravity-tools.md"
  15. SKILL="$REPO_ROOT/skills/using-superpowers/SKILL.md"
  16. fail() { echo "FAIL: $*" >&2; exit 1; }
  17. echo "test-antigravity-tools: checking Antigravity tool mapping"
  18. # --- Mapping exists ---------------------------------------------------------
  19. [ -f "$MAPPING" ] || fail "tool mapping missing at $MAPPING"
  20. # --- Core action→tool mappings are documented -------------------------------
  21. for tool in write_to_file replace_file_content invoke_subagent; do
  22. grep -q "$tool" "$MAPPING" \
  23. || fail "mapping does not document the '$tool' tool"
  24. done
  25. # --- Subagents use the built-in self/research types -------------------------
  26. grep -q '`self`' "$MAPPING" \
  27. || fail "mapping does not document the built-in 'self' subagent type"
  28. grep -q '`research`' "$MAPPING" \
  29. || fail "mapping does not document the built-in 'research' subagent type"
  30. # --- Task tracking documents the 'task' artifact mechanism ------------------
  31. grep -qE 'ArtifactType.*task|task. artifact' "$MAPPING" \
  32. || fail "mapping does not document task tracking as a 'task' artifact"
  33. # --- SKILL.md Platform Adaptation links the mapping -------------------------
  34. grep -q "antigravity-tools.md" "$SKILL" \
  35. || fail "SKILL.md Platform Adaptation does not reference antigravity-tools.md"
  36. echo "PASS: Antigravity tool mapping valid (subagent dispatch, task artifact, SKILL.md link)"