name: asw-loop description: Antigravity Swarm Loop executes RED to GREEN to real-surface QA with cleanup receipts.
Antigravity Swarm Loop
Use this skill when a plan exists or the work is clear enough to execute.
Loop
- Pick one criterion.
- Write the failing test and capture RED output.
- Implement the smallest production change.
- Capture GREEN output.
- Run the real Antigravity or application surface.
- Record cleanup.
- Re-run the full relevant suite.
Never claim completion from tests alone.
Subagent Use
- Explorer lane: locate owners, tests, configs, and prior art.
- Librarian lane: check current official docs for libraries or external CLIs.
- Reviewer lane: inspect the diff after implementation.
- Keep all write operations in the execution lane unless the caller explicitly delegates file edits.
Evidence Ledger
For each criterion, keep a terse ledger:
Criterion:
RED:
Change:
GREEN:
Real surface:
Cleanup:
If any row is empty, the loop is still running.
Criterion Loop
Run one criterion at a time:
Criterion:
Automated test:
Manual QA channel:
Expected observable:
Cleanup target:
If the criterion is too broad, split it before editing. A criterion should be small enough that one failing test and one real-surface scenario can prove it.
RED to GREEN
For behavior changes:
- Write the automated test first.
- Run it and capture the failing assertion.
- Make the smallest production change.
- Run the same test and capture the passing output.
- Run adjacent regression tests.
For refactors:
- Identify characterization coverage.
- Run it green before the refactor.
- Change structure only.
- Run it green again.
Do not write production code first and backfill a test later.
Surface Scenario
After GREEN, run the real surface:
- CLI and installer: tmux transcript.
- Hook: installed or script-level payload smoke with exact input.
- HUD/status line: status payload through the real script.
- Package: dry-run file list and bad-pattern scan.
- Browser: action log and screenshot.
- Desktop/IDE: visible action log and screenshot.
Record:
Scenario:
Tool/channel:
Input:
Expected:
Artifact:
PASS/FAIL:
Cleanup Pairing
Pair every scenario with cleanup:
- close tmux session,
- remove temp config,
- remove temp package output,
- stop servers,
- close browser context,
- remove generated scratch files.
Record cleanup beside the scenario. Do not leave cleanup for the end when multiple scenarios run.
Reviewer Gate
Run review when:
- 3 or more files changed,
- package contents changed,
- hooks changed,
- public docs changed,
- refactor/migration work occurred,
- the user requested deep or final review.
Reviewer input:
- criteria ledger,
- RED/GREEN evidence,
- surface artifacts,
- diff,
- package/private scan,
- cleanup receipts.
Approval requires no blockers and no missing evidence.
Stop Rules
Stop and report instead of guessing when:
- a green baseline cannot be established,
- a criterion cannot be tied to a real surface,
- cleanup cannot be verified,
- the same failure repeats after two targeted fixes,
- the user-visible contract is ambiguous.
Final Output
Criterion ledger:
Tests:
Surface QA:
Cleanup:
Reviewer:
Final status: