test-skill-registration.sh 899 B

12345678910111213141516171819202122
  1. #!/usr/bin/env bash
  2. # Test: V2 Skill Registration Contract (#2106 review)
  3. # Verifies setup() registers skills matching OpenCode 2.0.4's Skill.Info
  4. # schema (path field, no stale location/slash) and contains per-skill
  5. # draft.add() failures instead of aborting registration.
  6. set -euo pipefail
  7. SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
  8. echo "=== Test: V2 Skill Registration Contract ==="
  9. source "$SCRIPT_DIR/setup.sh"
  10. trap cleanup_test_env EXIT
  11. node "$SCRIPT_DIR/test-skill-registration.mjs" "$SUPERPOWERS_PLUGIN_FILE"
  12. node "$SCRIPT_DIR/test-skill-registration.mjs" "$OPENCODE_CONFIG_DIR/plugins/superpowers.js"
  13. echo " [PASS] Skill payloads match the 2.0.4 Skill.Info contract"
  14. echo " [PASS] A rejected draft.add() skips one skill without aborting the rest"
  15. echo " [PASS] Quoted and multi-line frontmatter values register unquoted"
  16. echo ""
  17. echo "=== All skill registration tests passed ==="