From kata
Audits milestone against definition of done: verifies requirements coverage, cross-phase integration, end-to-end flows. Aggregates tech debt/gaps from phase verifications, spawns integration checker.
npx claudepluginhub withmartian-sandbox-darkside/ghrc-y-73d04e3c2aae45e2ac89d7e8506d8eaaThis skill uses the workspace's default tool permissions.
<objective>
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
This command IS the orchestrator. Reads existing VERIFICATION.md files (phases already verified during phase-execute), aggregates tech debt and deferred gaps, then spawns integration checker for cross-phase wiring.
<execution_context>
</execution_context>
Version: $ARGUMENTS (optional — defaults to current milestone)Original Intent: @.planning/PROJECT.md @.planning/REQUIREMENTS.md
Planned Work: @.planning/ROADMAP.md @.planning/config.json (if exists)
Completed Work: Glob: .planning/phases/{active,pending,completed}//-SUMMARY.md Glob: .planning/phases/{active,pending,completed}//-VERIFICATION.md (Also check flat: .planning/phases/[0-9]/-SUMMARY.md for backward compatibility)
Read model profile for agent spawning:
MODEL_PROFILE=$(node scripts/kata-lib.cjs read-config "model_profile" "balanced")
Default to "balanced" if not set.
Model lookup table:
| Agent | quality | balanced | budget |
|---|---|---|---|
| kata-integration-checker | sonnet | sonnet | haiku |
Store resolved model for use in Task call below.
If ROADMAP.md exists, check format and auto-migrate if old:
if [ -f .planning/ROADMAP.md ]; then
node scripts/kata-lib.cjs check-roadmap 2>/dev/null
FORMAT_EXIT=$?
if [ $FORMAT_EXIT -eq 1 ]; then
echo "Old roadmap format detected. Running auto-migration..."
fi
fi
If exit code 1 (old format):
Invoke kata-doctor in auto mode:
Skill("kata-doctor", "--auto")
Continue after migration completes.
If exit code 0 or 2: Continue silently.
# Scan all phase directories across states
ALL_PHASE_DIRS=""
for state in active pending completed; do
[ -d ".planning/phases/${state}" ] && ALL_PHASE_DIRS="${ALL_PHASE_DIRS} $(find .planning/phases/${state} -maxdepth 1 -type d -not -name "${state}" 2>/dev/null)"
done
# Fallback: include flat directories (backward compatibility)
FLAT_DIRS=$(find .planning/phases -maxdepth 1 -type d -name "[0-9]*" 2>/dev/null)
[ -n "$FLAT_DIRS" ] && ALL_PHASE_DIRS="${ALL_PHASE_DIRS} ${FLAT_DIRS}"
echo "$ALL_PHASE_DIRS" | tr ' ' '\n' | sort -V
For each phase directory, read the VERIFICATION.md:
# Read VERIFICATION.md from each phase directory found in step 1
for phase_dir in $ALL_PHASE_DIRS; do
[ -d "$phase_dir" ] || continue
cat "${phase_dir}"*-VERIFICATION.md 2>/dev/null
done
From each VERIFICATION.md, extract:
If a phase is missing VERIFICATION.md, flag it as "unverified phase" — this is a blocker.
Read the integration checker instructions:
integration_checker_instructions_content = Read("skills/kata-audit-milestone/references/integration-checker-instructions.md")
With phase context collected:
Task(
prompt="<agent-instructions>
{integration_checker_instructions_content}
</agent-instructions>
Check cross-phase integration and E2E flows.
Phases: {phase_dirs}
Phase exports: {from SUMMARYs}
API routes: {routes created}
Verify cross-phase wiring and E2E user flows.",
subagent_type="general-purpose",
model="{integration_checker_model}"
)
Combine:
For each requirement in REQUIREMENTS.md mapped to this milestone:
Create .planning/v{version}-v{version}-MILESTONE-AUDIT.md with:
---
milestone: { version }
audited: { timestamp }
status: passed | gaps_found | tech_debt
scores:
requirements: N/M
phases: N/M
integration: N/M
flows: N/M
gaps: # Critical blockers
requirements: [...]
integration: [...]
flows: [...]
tech_debt: # Non-critical, deferred
- phase: 01-auth
items:
- "TODO: add rate limiting"
- "Warning: no password strength validation"
- phase: 03-dashboard
items:
- "Deferred: mobile responsive layout"
---
Plus full markdown report with tables for requirements, phases, integration, tech debt.
Status values:
passed — all requirements met, no critical gaps, minimal tech debtgaps_found — critical blockers existtech_debt — no blockers but accumulated deferred items need reviewRoute by status (see <offer_next>).
Use AskUserQuestion:
If Skip: Proceed to <offer_next>.
If walkthrough chosen:
Read all phase SUMMARY.md files in milestone scope
Extract user-observable deliverables (features, behaviors, UI changes)
Classify each deliverable as user-facing or internal:
Design demo scenarios organized by user journey, not by phase or technical component:
Create .planning/v{version}-UAT.md adapted from UAT template format:
milestone: {version} instead of phase:source: lists all phase SUMMARY.md filesSet up the environment, then hand off to the user
<uat_rules>
CRITICAL: The user performs UAT, not you.
UAT verifies the milestone's deliverables work from the end-user's perspective. The user interacts with what was built (their app, their CLI, their API). You prepare the environment and give instructions. You MUST NOT run the demo yourself and report results back.
What you do:
What the user does:
Anti-pattern (WRONG):
Claude runs curl against the API itself
Claude opens the page and reads the DOM
Claude says: "The login endpoint returns 200, it works!"
This is automated verification, not user acceptance testing.
Correct pattern:
Claude says: "I started the dev server on port 3000.
Try this:
1. Open http://localhost:3000/login in your browser
2. Enter test@example.com / password123
3. You should be redirected to the dashboard with your name displayed
What do you see?"
The user experiences the feature. Claude waits for their report.
</uat_rules>
Scenario design principles:
Internal changes get summarized verification. Run tests, check build output, and inspect artifacts yourself. Present a summary to the user ("all 47 tests pass, build succeeds"). The user confirms or flags concerns. Do not ask the user to grep files, read source, or run diagnostic commands.
Before each batch, brief the user on context from the end-user's perspective. Describe what the user will experience, not what was built internally. Wrong: "v1.10.0 adds a worktree.enabled config option read by three skills." Right: "When you create a new project, you'll now see a question about Git Worktrees." Then give setup instructions if needed (cd to a directory, open a session, etc.).
Then present the batch using AskUserQuestion with multiSelect:
Use AskUserQuestion:
- header: "UAT Batch {N}"
- question: "Try each scenario and select the ones that pass. Unselected = needs investigation."
- multiSelect: true
- options:
- "S{X}: {short name}" — {instruction for user to follow}
- "S{Y}: {short name}" — {instruction for user to follow}
- "S{Z}: {short name}" — {instruction for user to follow}
- "None pass" — all scenarios in this batch failed
For any scenario NOT selected (failed):
Continue batches until all scenarios are presented.
Update UAT.md after each batch with pass/fail status and user-provided evidence
On completion: commit UAT.md
If all scenarios pass: Proceed to <offer_next> (audit status unchanged).
If issues found — merge gaps into audit file:
MILESTONE-AUDIT.md under gaps.flows (for E2E breaks) or gaps.requirements (for unmet requirements), using the same YAML structure the audit already usesstatus: gaps_found (if it was passed or tech_debt)Then use AskUserQuestion:
/kata-plan-milestone-gaps (reads the updated audit file)<offer_next> Output this markdown directly (not as a code block). Route based on status:
If passed:
Score: {N}/{M} requirements satisfied Report: .planning/v{version}-MILESTONE-AUDIT.md {If walkthrough was run:} UAT: .planning/v{version}-UAT.md — all scenarios passed
All requirements covered. Cross-phase integration verified. E2E flows complete.
───────────────────────────────────────────────────────────────
Complete milestone — archive and tag
/kata-complete-milestone {version}
/clear first → fresh context window
───────────────────────────────────────────────────────────────
If gaps_found:
Score: {N}/{M} requirements satisfied Report: .planning/v{version}-MILESTONE-AUDIT.md {If walkthrough was run:} UAT: .planning/v{version}-UAT.md
{For each unsatisfied requirement:}
{For each integration gap:}
{For each flow gap:}
───────────────────────────────────────────────────────────────
Plan gap closure — create phases to complete milestone
/kata-plan-milestone-gaps
/clear first → fresh context window
───────────────────────────────────────────────────────────────
Also available:
───────────────────────────────────────────────────────────────
If tech_debt (no blockers but accumulated debt):
Score: {N}/{M} requirements satisfied Report: .planning/v{version}-MILESTONE-AUDIT.md {If walkthrough was run:} UAT: .planning/v{version}-UAT.md
All requirements met. No critical blockers. Accumulated tech debt needs review.
{For each phase with debt:} Phase {X}: {name}
───────────────────────────────────────────────────────────────
A. Complete milestone — accept debt, track in backlog
/kata-complete-milestone {version}
B. Plan cleanup phase — address debt before completing
/kata-plan-milestone-gaps
/clear first → fresh context window
─────────────────────────────────────────────────────────────── </offer_next>
<success_criteria>