src/claude/skills/iteration-complete/SKILL.md
Run the quality gate after completing an iteration — review, fix, test, report, auto-commit. No principal approval needed (iteration boundary is auto-approved). Auto-emits a structured dispatch to captain so the small-batch-cadence daemon can pick up for PR landing.
npx skillsauth add the-agency-ai/the-agency 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 of work. Invokes /quality-gate for the review+fix cycle, auto-commits on green (no principal approval at iteration boundaries), and emits a structured dispatch to captain so the small-batch-cadence daemon can pick up for PR landing.
Iteration boundaries are the smallest formal commit-and-review unit in the-agency's valueflow work stream. Without a dedicated skill, agents skip the quality gate, forget the receipt-sign step, or let the commit drift from the plan file. iteration-complete bundles all five responsibilities (QG run → QGR receipt → auto-commit → plan update → handoff update + dispatch to captain) so iteration-end is single-invocation and auditable.
Auto-commit (no principal approval) is specifically for iteration boundaries — they're small, bounded units where the QG + receipt is sufficient attestation. Phase and plan boundaries use sister skills with principal approval gates.
Before proceeding, Read the files listed in required_reading: frontmatter. REFERENCE-QUALITY-GATE.md is the protocol the invoked /quality-gate skill runs. REFERENCE-RECEIPT-INFRASTRUCTURE.md explains the five-hash chain that signs the iteration's QGR receipt.
/iteration-complete <phase.iter>: <description> [--base <ref>]
Examples:
/iteration-complete 1.2: parser edge cases
/iteration-complete 1.3: error handling --base abc1234
<phase.iter>: numeric identifier (phase.iteration), e.g., 1.2
<description>: one-line summary
--base <ref> (optional): override baseline for QG diff-hash; resolved automatically if omitted
If invoked with empty arguments, ask what was completed before proceeding.
git status non-empty).--base passed). First iteration in a phase uses the phase-start commit.docs/plans/ or agency/workstreams/*/. If absent, skill proceeds with a "no plan file" note in the commit; handoff captures the omission.git status + git diff --stat HEAD. If empty, report "Nothing to gate" and stop.QG's Hash A / Hash E diff is computed against the prior iteration commit (or phase-start commit for first iteration). Resolution order:
git log --oneline --grep="Phase <P>\\.". If this is X.1, use phase-start tag/commit.HEAD~1. Note fallback usage in handoff.Capture as $BASE_REF.
/quality-gate iteration-complete <phase.iter>: <description> --base <BASE_REF>
Leading iteration-complete <phase.iter> tells QG the boundary type (used in receipt filename). --base tells QG the baseline for Hash A/E via diff-hash --base.
Full QG protocol runs: parallel review → consolidate → bug-exposing tests → fix → coverage tests → confirm clean → present QGR → sign receipt (five-hash chain at agency/workstreams/{W}/qgr/). Iteration-complete is auto-approved — Hash D = Hash C.
Wait for receipt signed before proceeding.
No approval. Commit automatically after clean QGR.
Use /git-safe-commit with the full structured commit message from the QGR's "Proposed Commit" section.
Append to the plan under "Quality Gate Reports":
Append the full QGR (all tables + summary). The plan is the living record.
Update the worktree handoff file (usr/*/*/handoff.md or usr/*/captain/handoff.md):
Structured dispatch for captain's auto-ship daemon. Must run AFTER the commit (Step 4) so commit_hash is current.
Capture:
ITERATION_SLUG (e.g., "1.2")PHASE_NUMBRANCH = git branch --show-currentCOMMIT_HASH = the Step 4 commitSUMMARY = first line of commit messageRECEIPT_PATH = QGR receipt path from Step 3Emit:
bash $CLAUDE_PROJECT_DIR/agency/tools/dispatch create \
--to {repo}/{principal}/captain \
--type iteration-complete \
--subject "Iteration {ITERATION_SLUG} complete on {BRANCH}" \
--body "<yaml body — see below>"
Body:
event: iteration-complete
iteration: {ITERATION_SLUG}
phase: {PHASE_NUM}
branch: {BRANCH}
commit_hash: {COMMIT_HASH}
summary: {SUMMARY}
qgr_receipt: {RECEIPT_PATH}
emitted_at: {ISO-8601 timestamp}
Cascade isolation: export AGENCY_SKILL_BYPASS_CASCADE=1 at skill start and unset at end if running multiple commits within the skill.
active (v2, body retrofit from Arguments/Steps pattern to 9-section structure 2026-04-19).
/quality-gate — the core QG protocol this skill invokes in Step 3/phase-complete — sibling skill for phase boundaries (deep QG + principal approval)/plan-complete — sibling skill for plan delivery (final deep QG + A&D)/pr-prep — pre-PR gating for accumulated work/pr-submit — agent's hand-off to captain for PR landing (runs AFTER iteration-complete when ready to ship)agency/tools/receipt-sign — signs the five-hash receiptagency/tools/dispatch — emits the Step 7 notificationagency/workstreams/captain/small-batch-cadence-*.md — design for the auto-ship daemon that consumes Step 7's dispatchOFFENDERS WILL BE FED TO THE — CUTE — ATTACK KITTENS!
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