.claude/skills/iteration-complete/SKILL.md
Run the quality gate after completing an iteration — review, fix, test, report, auto-commit
npx skillsauth add the-agency-ai/the-agency .claude/skills/iteration-completeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run this after completing each iteration. Invokes /quality-gate for the review+fix cycle, then auto-commits — no principal approval needed.
$ARGUMENTS is empty, ask the user what was completed before proceeding.git diff --stat HEAD and git status. If no changed files, tell the user "Nothing to gate — no changes since last commit" and stop.docs/plans/ that this work belongs to. If none exists, note "no plan file" — the commit message will omit the Plan: line.The QG's Hash A/Hash E diff is computed against the prior iteration commit (or the phase-start commit if this is the first iteration in the phase). Determine it as follows, in order:
docs/plans/ (or claude/workstreams/*/) for an iteration history / status table. The most recent prior iteration's commit SHA is the base. Many plans record this under "Quality Gate Reports" or a status table.git log --oneline --grep="Phase <P>\\." | head — e.g., for iteration 1.3, the base is the SHA of the commit titled "Phase 1.2: ...". If this is iteration X.1 (first iteration in the phase), use the phase-start tag / commit (e.g., v{phase}.0 or the commit titled "Phase <P-1>: ..." if no tag).HEAD~1 — use only if steps 1 and 2 yield nothing, and note this in the handoff update as a fallback used.Capture the SHA/ref as $BASE_REF.
Invoke /quality-gate via the Skill tool, passing arguments that include both the boundary description AND the base ref:
iteration-complete 1.2: parser edge cases --base <BASE_REF>
For example: iteration-complete 1.2: parser edge cases --base abc1234.
The leading iteration-complete <phase-iter> tells /quality-gate the boundary type (used in the receipt filename). The --base <ref> tells /quality-gate what baseline to use for Hash A / Hash E via diff-hash --base.
This runs the full QG protocol: parallel agent review → consolidate → bug-exposing tests → fix → coverage tests → confirm clean → present QGR → sign receipt via receipt-sign (five-hash chain, written to claude/workstreams/{W}/qgr/). Iteration-complete is auto-approved — Hash D = Hash C.
Wait for the QGR to be presented and the receipt signed before proceeding.
At iteration boundaries, no approval is needed. Commit automatically after a clean QGR.
Use /git-safe-commit via the Skill tool. Pass it the full structured commit message from the QGR's "Proposed Commit" section. The message must follow the format from the injected quality-gate.md reference.
After committing, update the plan file in docs/plans/ to reflect:
Locate the handoff file for this project (glob usr/*/*/handoff.md or usr/*/captain/handoff.md). Update with:
This command handles iteration boundaries only. At phase boundaries, use /phase-complete instead — it runs a deep QG, requires principal approval, and lands on master.
After completing this iteration, move to the next iteration. When all iterations in a phase are done, run /phase-complete.
business
Sync worktree with master — merge, copy settings, run sandbox-sync, report changes
tools
List all git worktrees with status info (branch, clean/dirty, deps)
tools
Remove a git worktree and optionally delete its branch
development
Create a new git worktree with dedicated branch and bootstrapped dev environment