.claude/skills/phase-complete/SKILL.md
Run the full quality gate after completing an implementation phase — review, fix, test, report, commit
npx skillsauth add the-agency-ai/the-agency .claude/skills/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. Invokes /quality-gate for the review+fix cycle, then presents results for principal approval before committing. Do not proceed to the next phase until the gate passes and the user approves.
$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.If this phase had multiple iterations committed separately, squash them into a single phase commit before running the gate. Use git reset --soft to the commit before the first iteration, then re-stage all changes.
If only one commit or no prior iteration commits, skip this step.
The QG's Hash A/Hash E diff is computed against the phase-start tag (or commit). Determine as follows, in order:
docs/plans/ (or claude/workstreams/*/) for a phase-start tag — most plans record tag: v<phase>.0 or similar on the phase header (e.g., Phase 1 starts at v40.1).git tag --list 'v*' --sort=-v:refname | head — use the tag that marks the start of this phase.git merge-base main HEAD — the divergence point from master. Note in the handoff if fallback was used.Capture the tag/SHA as $BASE_REF.
Invoke /quality-gate via the Skill tool, passing arguments that include both the boundary description AND the base ref:
phase-complete 1: types and parser --base <BASE_REF>
For example: phase-complete 1: types and parser --base v40.1.
The leading phase-complete <phase> 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/).
The QG is scoped to the full phase's work (all changes since divergence from master, or since the last phase commit). This is a deep review — broader scope than the iteration-level gate.
Phase-complete requires principal 1B1 — capture the 1B1 transcript path so /quality-gate Step 10 can record Hash D as the transcript hash (not auto-approved).
Wait for the QGR to be presented and the receipt signed before proceeding.
Present the QGR and proposed commit message to the user. This is a Sprint Review — the principal reviews the body of work.
Do not commit without explicit principal approval.
If the principal requests changes, make them and re-run the relevant QG steps.
Once approved, re-run git status to capture any new files written during the QG fix cycle (bug-exposing tests, coverage tests). Use /git-safe-commit via the Skill tool, staging all relevant files. Pass it the full structured commit message from the QGR's "Proposed Commit" section.
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:
If this phase had multiple iterations that were each committed separately, the phase-complete commit should squash the iteration commits into a single phase commit. Step 2 handles this — use git reset --soft to combine them before running the gate.
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