feat(milestone): add milestone audit system

- Add /gsd:audit-milestone command (spawns auditor)
- Add gsd-milestone-auditor agent (orchestrates verification)
- Add gsd-integration-checker agent (cross-phase wiring + E2E flows)
- Add /gsd:plan-milestone-gaps command (creates phases from audit gaps)
- Update complete-milestone to recommend audit first

Flow: audit-milestone → plan-milestone-gaps → execute phases → re-audit → complete-milestone

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson
2026-01-15 10:50:58 -06:00
parent b920d47cb1
commit 6630c3217d
5 changed files with 1291 additions and 0 deletions

View File

@@ -0,0 +1,141 @@
---
name: gsd:audit-milestone
description: Audit milestone completion against original intent before archiving
argument-hint: "[version]"
allowed-tools:
- Read
- Glob
- Grep
- Bash
- Task
---
<objective>
Verify milestone achieved its definition of done. Check requirements coverage, cross-phase integration, and end-to-end flows.
Spawns gsd-milestone-auditor to orchestrate parallel verification, then presents actionable results.
</objective>
<execution_context>
@~/.claude/get-shit-done/references/principles.md
</execution_context>
<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/*/*-SUMMARY.md
Glob: .planning/phases/*/*-VERIFICATION.md
</context>
<process>
1. **Determine milestone scope**
- Parse version from arguments or detect current milestone from ROADMAP.md
- Identify phases in this milestone
- Extract milestone definition of done
2. **Spawn milestone auditor**
```
Task(
prompt="Audit milestone {version} completion.
Milestone scope: Phases {X}-{Y}
Definition of done: {from ROADMAP.md}
Check:
1. Requirements coverage (all milestone REQs satisfied)
2. Phase goal achievement (re-verify each phase)
3. Cross-phase integration (wiring between phases)
4. E2E flows (user can complete promised workflows)
Create MILESTONE-AUDIT.md with structured gaps.",
subagent_type="gsd-milestone-auditor"
)
```
3. **Present results**
Route by status from MILESTONE-AUDIT.md:
- `passed` → Ready for `/gsd:complete-milestone`
- `gaps_found` → Present gaps, offer `/gsd:plan-milestone-gaps`
</process>
<offer_next>
**If passed:**
```markdown
## ✓ Milestone {version} — Audit Passed
**Score:** {N}/{M} requirements satisfied
**Report:** .planning/MILESTONE-AUDIT.md
All requirements covered. Cross-phase integration verified. E2E flows complete.
---
## ▶ Next Up
**Complete milestone** — archive and tag
`/gsd:complete-milestone {version}`
<sub>`/clear` first → fresh context window</sub>
```
---
**If gaps_found:**
```markdown
## ⚠ Milestone {version} — Gaps Found
**Score:** {N}/{M} requirements satisfied
**Report:** .planning/MILESTONE-AUDIT.md
### Unsatisfied Requirements
{For each unsatisfied requirement:}
- **{REQ-ID}: {description}** (Phase {X})
- {reason}
### Cross-Phase Issues
{For each integration gap:}
- **{from} → {to}:** {issue}
### Broken Flows
{For each flow gap:}
- **{flow name}:** breaks at {step}
---
## ▶ Next Up
**Plan gap closure** — create phases to complete milestone
`/gsd:plan-milestone-gaps`
<sub>`/clear` first → fresh context window</sub>
---
**Also available:**
- `cat .planning/MILESTONE-AUDIT.md` — see full report
- `/gsd:complete-milestone {version}` — proceed anyway (accept tech debt)
```
</offer_next>
<success_criteria>
- [ ] Milestone scope identified
- [ ] gsd-milestone-auditor spawned with full context
- [ ] MILESTONE-AUDIT.md created
- [ ] Results presented with actionable next steps
</success_criteria>

View File

@@ -38,6 +38,28 @@ Output: Milestone archived, roadmap reorganized, git tagged.
**Follow complete-milestone.md workflow:**
0. **Check for audit:**
- Look for `.planning/MILESTONE-AUDIT.md`
- If missing or stale: recommend `/gsd:audit-milestone` first
- If audit status is `gaps_found`: recommend `/gsd:plan-milestone-gaps` first
- If audit status is `passed`: proceed to step 1
```markdown
## Pre-flight Check
{If no MILESTONE-AUDIT.md:}
⚠ No milestone audit found. Run `/gsd:audit-milestone` first to verify
requirements coverage, cross-phase integration, and E2E flows.
{If audit has gaps:}
⚠ Milestone audit found gaps. Run `/gsd:plan-milestone-gaps` to create
phases that close the gaps, or proceed anyway to accept as tech debt.
{If audit passed:}
✓ Milestone audit passed. Proceeding with completion.
```
1. **Verify readiness:**
- Check all phases in milestone have completed plans (SUMMARY.md exists)

View File

@@ -0,0 +1,284 @@
---
name: gsd:plan-milestone-gaps
description: Create phases to close all gaps identified by milestone audit
allowed-tools:
- Read
- Write
- Bash
- Glob
- Grep
- AskUserQuestion
---
<objective>
Create all phases necessary to close gaps identified by `/gsd:audit-milestone`.
Reads MILESTONE-AUDIT.md, groups gaps into logical phases, creates phase entries in ROADMAP.md, and offers to plan each phase.
One command creates all fix phases — no manual `/gsd:add-phase` per gap.
</objective>
<execution_context>
@~/.claude/get-shit-done/references/principles.md
@~/.claude/get-shit-done/workflows/plan-phase.md
</execution_context>
<context>
**Audit results:**
@.planning/MILESTONE-AUDIT.md
**Original intent (for prioritization):**
@.planning/PROJECT.md
@.planning/REQUIREMENTS.md
**Current state:**
@.planning/ROADMAP.md
@.planning/STATE.md
</context>
<process>
## 1. Load Audit Results
```bash
cat .planning/MILESTONE-AUDIT.md
```
Parse YAML frontmatter to extract structured gaps:
- `gaps.requirements` — unsatisfied requirements
- `gaps.integration` — missing cross-phase connections
- `gaps.flows` — broken E2E flows
If MILESTONE-AUDIT.md doesn't exist or has no gaps, error:
```
No audit gaps found. Run `/gsd:audit-milestone` first.
```
## 2. Prioritize Gaps
Group gaps by priority from REQUIREMENTS.md:
| Priority | Action |
|----------|--------|
| `must` | Create phase, blocks milestone |
| `should` | Create phase, recommended |
| `nice` | Ask user: include or defer? |
For integration/flow gaps, infer priority from affected requirements.
## 3. Group Gaps into Phases
Cluster related gaps into logical phases:
**Grouping rules:**
- Same affected phase → combine into one fix phase
- Same subsystem (auth, API, UI) → combine
- Dependency order (fix stubs before wiring)
- Keep phases focused: 2-4 tasks each
**Example grouping:**
```
Gap: DASH-01 unsatisfied (Dashboard doesn't fetch)
Gap: Integration Phase 1→3 (Auth not passed to API calls)
Gap: Flow "View dashboard" broken at data fetch
→ Phase 6: "Wire Dashboard to API"
- Add fetch to Dashboard.tsx
- Include auth header in fetch
- Handle response, update state
- Render user data
```
## 4. Determine Phase Numbers
Find highest existing phase:
```bash
ls -d .planning/phases/*/ | sort -V | tail -1
```
New phases continue from there:
- If Phase 5 is highest, gaps become Phase 6, 7, 8...
## 5. Present Gap Closure Plan
```markdown
## Gap Closure Plan
**Milestone:** {version}
**Gaps to close:** {N} requirements, {M} integration, {K} flows
### Proposed Phases
**Phase {N}: {Name}**
Closes:
- {REQ-ID}: {description}
- Integration: {from} → {to}
Tasks: {count}
**Phase {N+1}: {Name}**
Closes:
- {REQ-ID}: {description}
- Flow: {flow name}
Tasks: {count}
{If nice-to-have gaps exist:}
### Deferred (nice-to-have)
These gaps are optional. Include them?
- {gap description}
- {gap description}
---
Create these {X} phases? (yes / adjust / defer all optional)
```
Wait for user confirmation.
## 6. Update ROADMAP.md
Add new phases to current milestone:
```markdown
### Phase {N}: {Name}
**Goal:** {derived from gaps being closed}
**Requirements:** {REQ-IDs being satisfied}
**Gap Closure:** Closes gaps from audit
### Phase {N+1}: {Name}
...
```
## 7. Create Phase Directories
```bash
mkdir -p ".planning/phases/{NN}-{name}"
```
## 8. Commit Roadmap Update
```bash
git add .planning/ROADMAP.md
git commit -m "docs(roadmap): add gap closure phases {N}-{M}"
```
## 9. Offer Next Steps
```markdown
## ✓ Gap Closure Phases Created
**Phases added:** {N} - {M}
**Gaps addressed:** {count} requirements, {count} integration, {count} flows
---
## ▶ Next Up
**Plan first gap closure phase**
`/gsd:plan-phase {N}`
<sub>`/clear` first → fresh context window</sub>
---
**Also available:**
- `/gsd:execute-phase {N}` — if plans already exist
- `cat .planning/ROADMAP.md` — see updated roadmap
---
**After all gap phases complete:**
`/gsd:audit-milestone` — re-audit to verify gaps closed
`/gsd:complete-milestone {version}` — archive when audit passes
```
</process>
<gap_to_phase_mapping>
## How Gaps Become Tasks
**Requirement gap → Tasks:**
```yaml
gap:
id: DASH-01
description: "User sees their data"
reason: "Dashboard exists but doesn't fetch from API"
missing:
- "useEffect with fetch to /api/user/data"
- "State for user data"
- "Render user data in JSX"
becomes:
phase: "Wire Dashboard Data"
tasks:
- name: "Add data fetching"
files: [src/components/Dashboard.tsx]
action: "Add useEffect that fetches /api/user/data on mount"
- name: "Add state management"
files: [src/components/Dashboard.tsx]
action: "Add useState for userData, loading, error states"
- name: "Render user data"
files: [src/components/Dashboard.tsx]
action: "Replace placeholder with userData.map rendering"
```
**Integration gap → Tasks:**
```yaml
gap:
from_phase: 1
to_phase: 3
connection: "Auth token → API calls"
reason: "Dashboard API calls don't include auth header"
missing:
- "Auth header in fetch calls"
- "Token refresh on 401"
becomes:
phase: "Add Auth to Dashboard API Calls"
tasks:
- name: "Add auth header to fetches"
files: [src/components/Dashboard.tsx, src/lib/api.ts]
action: "Include Authorization header with token in all API calls"
- name: "Handle 401 responses"
files: [src/lib/api.ts]
action: "Add interceptor to refresh token or redirect to login on 401"
```
**Flow gap → Tasks:**
```yaml
gap:
name: "User views dashboard after login"
broken_at: "Dashboard data load"
reason: "No fetch call"
missing:
- "Fetch user data on mount"
- "Display loading state"
- "Render user data"
becomes:
# Usually same phase as requirement/integration gap
# Flow gaps often overlap with other gap types
```
</gap_to_phase_mapping>
<success_criteria>
- [ ] MILESTONE-AUDIT.md loaded and gaps parsed
- [ ] Gaps prioritized (must/should/nice)
- [ ] Gaps grouped into logical phases
- [ ] User confirmed phase plan
- [ ] ROADMAP.md updated with new phases
- [ ] Phase directories created
- [ ] Changes committed
- [ ] User knows to run `/gsd:plan-phase` next
</success_criteria>