/audit
Verify story completion through the GSD (Get Stuff Done) audit cycle. Runs tests, checks acceptance criteria, captures learnings, and provides clear PASS/FAIL verdict.
Quick Start
/agileflow:audit STORY=US-0129This will:
- Run project tests
- Verify acceptance criteria with you
- Capture learnings
- Generate clear PASS/FAIL report
- Suggest marking story complete (if passing)
Parameters
| Parameter | Required | Description |
|---|---|---|
STORY | Yes | Story ID to audit (e.g., US-0129) |
Usage Examples
Audit a story
/agileflow:audit STORY=US-0129Runs the full audit cycle for story US-0129.
Quick check without learnings
/agileflow:audit STORY=US-0130The command will prompt for learnings if you want to capture them.
How It Works
The audit runs a 4-step verification cycle:
Step 1: Parse Story
The command loads the story from status.json and verifies it exists:
- Gets story title, epic, and acceptance criteria
- Checks current status
- Validates all required fields
Step 2: Run Tests
Executes your project tests using the configured test command:
- Runs with timeout to prevent hanging
- Captures test output (pass/fail counts)
- Reports test duration
Step 3: Verify Acceptance Criteria
Displays each acceptance criterion from the story and asks you to confirm:
- Checkbox interface for each criterion
- You manually verify each requirement is met
- Counts total verified vs. total AC
Step 4: Capture Learnings
Prompts you for insights and discoveries:
- What patterns did you find?
- What technical debt did you encounter?
- What worked well?
- Learnings are logged to the agent bus
Audit Results
PASS Verdict
Story passes audit when:
- ✅ Tests are all passing (exit code 0)
- ✅ All acceptance criteria verified (100%)
When a story passes, the command:
- Shows clear PASS report
- Lists verified learnings
- Suggests marking story complete
- Offers next steps (complete story, view epic progress)
FAIL Verdict
Story fails audit when:
- ❌ Tests are failing (any failed tests)
- ❌ OR any acceptance criteria unverified
When a story fails, the command:
- Shows clear FAIL report
- Lists blocking issues
- Offers help fixing tests or completing AC
- Suggests re-auditing after fixes
Output Format
Success - Story Passes Audit
========================================
STORY AUDIT: US-0129
========================================
TESTS
Command: npm test
Result: PASSED (2,201 passed, 0 failed)
Duration: 45.2s
ACCEPTANCE CRITERIA
[x] Create packages/cli/src/core/commands/audit.md
[x] Accept story ID as argument
[x] Run tests and report pass/fail
[x] Check acceptance criteria met
[x] Prompt for learnings to capture
[x] Output: PASS/FAIL with recommended next action
[x] On PASS, suggest marking story complete
AC Verification: 7/7 (100%)
========================================
AUDIT RESULT: PASS
========================================
Tests: PASSING
AC: ALL VERIFIED (7/7)
Learnings captured:
- GSD audit pattern successfully integrated
NEXT STEPS:
1. Mark story complete: /agileflow:status US-0129 STATUS=done
2. Review epic progress: /agileflow:epic EP-0022
Error - Story Fails Audit
========================================
STORY AUDIT: US-0129
========================================
TESTS
Command: npm test
Result: FAILED (40 passed, 3 failed)
Duration: 12.8s
ACCEPTANCE CRITERIA
[x] Create packages/cli/src/core/commands/audit.md
[x] Accept story ID as argument
[x] Run tests and report pass/fail
[ ] Check acceptance criteria met
[ ] Prompt for learnings to capture
[x] Output: PASS/FAIL with recommended next action
[x] On PASS, suggest marking story complete
AC Verification: 5/7 (71%)
========================================
AUDIT RESULT: FAIL
========================================
Tests: FAILING (3 failed)
AC: PARTIAL (5/7)
BLOCKING ISSUES:
- Test: audit.test.ts:42 - Expected PASS verdict
- AC: "Check acceptance criteria met" - Not implemented
- AC: "Prompt for learnings" - Missing
NEXT STEPS:
1. Fix failing tests
2. Complete missing AC items
3. Re-run: /agileflow:audit US-0129
Best Practices
- Audit before marking complete - Always run audit before changing status to done
- Verify acceptance criteria manually - Don't rush through AC verification
- Capture learnings - Helps future stories in similar areas
- Re-run after fixes - Test fixes by re-auditing
- Check epic progress - See how close you are to completing epics
When to Use
Best For
- Verifying story completion - Before marking story as done
- Catching test failures - Before code review
- Documenting learnings - Capture knowledge for the team
- Final verification - Last step before PR or release
Not For
- Just running tests - Use
/agileflow:verifyinstead - Validating story structure - Use
/agileflow:story:validateinstead - Updating status - Use
/agileflow:statusfor status changes only
Related Commands
On This Page
/auditQuick StartParametersUsage ExamplesAudit a storyQuick check without learningsHow It WorksStep 1: Parse StoryStep 2: Run TestsStep 3: Verify Acceptance CriteriaStep 4: Capture LearningsAudit ResultsPASS VerdictFAIL VerdictOutput FormatSuccess - Story Passes AuditError - Story Fails AuditBest PracticesWhen to UseBest ForNot ForRelated Commands