src/claude/skills/phase-complete/SKILL.md
Run the full deep quality gate after completing an implementation phase — review, fix, test, report, squash-commit. Principal approval REQUIRED before commit (phase boundary is NOT auto-approved). Auto-emits phase-complete dispatch to captain for PR landing.
npx skillsauth add the-agency-ai/the-agency phase-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 implementation phase (the collection of iterations that delivered a logical unit of work). Runs the full deep quality gate, presents results for principal approval (Sprint Review), commits the squash-rollup of iterations on approval, and emits a dispatch to captain for PR landing.
Phases are larger boundary events than iterations — a full sub-deliverable (parser + lexer + AST; or data model + migration + seed; etc.). The QG at this boundary is deeper than iteration-complete's (full phase scope, not just since-last-iteration). Principal approval is REQUIRED — phases are the Sprint-Review moment where the principal decides whether the body of work is good enough to carry forward. Without a dedicated skill, phases drift into ad-hoc "I think we're done" claims; /phase-complete enforces the gate + approval + squash + dispatch in sequence.
Squash discipline matters at phase boundaries: iterations are individually meaningful during development but collapse to a single phase-commit in the durable record so master history stays readable. Iterations remain in reflog / tags if anyone needs to replay them.
Read the files listed in required_reading: frontmatter. REFERENCE-QUALITY-GATE.md is the deep QG protocol. REFERENCE-RECEIPT-INFRASTRUCTURE.md covers the five-hash receipt chain signed at Step 4.
/phase-complete <phase>: <description>
Example: /phase-complete 1: types and parser
<phase>: numeric phase identifier (e.g., 1)<description>: one-line summary of what the phase deliveredIf invoked with empty args, ask what was completed before proceeding.
git status + git diff --stat HEAD. Combined with prior-phase iteration commits, there should be something to gate. Empty = stop.If this phase had multiple iterations committed separately:
git reset --soft <commit-before-first-iteration-in-this-phase>
Then re-stage all changes. They're now uncommitted, ready for a single phase commit in Step 6.
If only one commit or no prior iteration commits, skip this step.
The deep QG diff is computed against the phase-start tag/commit. Resolution order:
tag: v<phase>.0 or similar in phase header (e.g., Phase 1 starts at v40.1).git tag --list 'v*' --sort=-v:refname | head — use the tag marking this phase's start.git merge-base main HEAD. Note in handoff if fallback was used.Capture as $BASE_REF.
/quality-gate phase-complete <phase>: <description> --base <BASE_REF>
Full QG protocol — parallel review → consolidate → bug-exposing tests → fix → coverage tests → confirm clean → present QGR → sign receipt (five-hash chain at agency/workstreams/{W}/qgr/).
Scope: full phase's work (all changes since $BASE_REF). Deeper than iteration-level.
Phase-complete requires principal 1B1 — pass the 1B1 transcript path to /quality-gate so Step 10 records Hash D as the transcript hash (NOT auto-approved like iteration-complete).
Wait for QGR presented + receipt signed before proceeding.
Present the QGR + proposed commit message to the principal. This IS the Sprint Review.
Do not commit without explicit principal approval.
If principal requests changes:
Loop until approval.
Once approved, git status to capture any QG-phase-added files (bug-exposing tests, coverage tests). Use /git-safe-commit via Skill tool, staging all relevant files. Pass the full structured commit message from the QGR's "Proposed Commit" section. Message leads with Phase <N>: <description> per framework convention.
Under "Quality Gate Reports":
Update worktree handoff:
/plan-complete if last phase)Structured dispatch for captain's auto-ship daemon.
Capture:
PHASE_SLUGBRANCHCOMMIT_HASH (Step 6 commit)SUMMARYRECEIPT_PATHEmit:
bash $CLAUDE_PROJECT_DIR/agency/tools/dispatch create \
--to {repo}/{principal}/captain \
--type phase-complete \
--subject "Phase {PHASE_SLUG} complete on {BRANCH}" \
--body "<yaml body>"
Body:
event: phase-complete
phase: {PHASE_SLUG}
branch: {BRANCH}
commit_hash: {COMMIT_HASH}
summary: {SUMMARY}
qgr_receipt: {RECEIPT_PATH}
emitted_at: {ISO-8601 timestamp}
Cascade isolation: AGENCY_SKILL_BYPASS_CASCADE=1 in environment.
/pr-captain-land after consuming the Step 9 dispatch (or direct via /pr-submit).active (v2, body retrofit from Arguments/Steps pattern to 9-section structure 2026-04-19).
/quality-gate — deep QG protocol invoked in Step 4/iteration-complete — sibling skill for iteration boundaries (auto-approved, lighter QG)/plan-complete — sibling skill for plan delivery (final deep QG + A&D)/pr-submit — agent's hand-off to captain; runs after phase-complete when ready to land/pr-captain-land — captain's counterpart; consumes Step 9's dispatchagency/tools/receipt-sign — signs the five-hash receipt at phase boundaryagency/workstreams/captain/small-batch-cadence-*.md — auto-ship daemon designOFFENDERS 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