Agent skill
test
Run unit and UI tests for GridRacer
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/test-pjpj42-gridracer
SKILL.md
Run GridRacer Tests
Execute unit tests and optionally UI tests.
Steps
-
Auto-detect simulator:
bashSIMULATOR=$(xcrun simctl list devices available | grep -E "iPhone (16|15|14)" | grep -v unavailable | head -1 | sed -E 's/.*iPhone ([0-9]+).*/iPhone \1/') -
Run unit tests:
bashxcodebuild test -scheme GridRacer -destination "platform=iOS Simulator,name=$SIMULATOR" -only-testing:GridRacerTests 2>&1 > /tmp/test_output.log -
Parse and report results:
Count results:
bashPASSED=$(grep -c "passed on" /tmp/test_output.log || echo "0") FAILED=$(grep -c "failed on" /tmp/test_output.log || echo "0") TOTAL=$((PASSED + FAILED))If all passed:
Test Results: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✅ Passed: <PASSED> tests ❌ Failed: 0 tests Test Suites: ✅ GridPointTests (4/4) ✅ GridVectorTests (5/5) ✅ MovementCalculatorTests (5/5) ✅ BresenhamPathTests (7/7) ✅ TrackTests (6/6) ✅ PlayerTests (6/6) ✅ GameStateTests (6/6) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Status: READY TO COMMIT ✓If failures:
Test Results: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✅ Passed: <PASSED> tests ❌ Failed: <FAILED> tests Failed Tests:Then show failed test names:
bashgrep "failed on" /tmp/test_output.log | sed -E "s/.*Test case '([^']+)'.*/ - \1/" | head -10━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Status: FIX TESTS BEFORE COMMITTING ❌ -
Optionally run UI tests if requested:
bashxcodebuild test -scheme GridRacer -destination "platform=iOS Simulator,name=$SIMULATOR" -only-testing:GridRacerUITests 2>&1 | grep -E "(Test Case|passed|failed|error:|SUCCEEDED|FAILED)" | tail -30
Output Format
The skill should always produce formatted, easy-to-read output with:
- Clear pass/fail counts
- Test suite breakdown (when possible)
- Specific failed test names
- Clear status indicator for commit readiness
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?