| name | wf-phase5-verify |
| description | Run Phase 5 verification after implementation - verify spec was implemented correctly, check tests pass, document any deviations. Produces PHASE5_VERIFICATION.md. |
| argument-hint | ["spec-file-path"] |
| allowed-tools | Read, Glob, Grep, Write, Bash, AskUserQuestion |
| model | sonnet |
Phase 5: Implementation Verification
Verify the implementation matches the specification, all tests pass, and document any deviations.
Spec to Verify
$ARGUMENTS
Instructions
Step 0: Read Project Config
- Try to read
.claude/workflow/project-config.json
- Extract values (defaults if absent):
specDir = docs/specs
archiveDir = docs/specs/archive
Step 1: Handle Missing Arguments / Auto-Detect Spec
If no spec path was provided:
- Use Glob to find active specs:
{specDir}/*/*.md
- Filter for
*_SPEC.md files with Status: "READY FOR IMPLEMENTATION" or similar
- Check which specs have PHASE3_CONSOLIDATION.md but no PHASE5_VERIFICATION.md
- If multiple found, use AskUserQuestion to ask which to verify
- If a spec has no Phase 3 consolidation, warn and suggest running
/wf-phase3-consolidate first
Step 2: Read Required Documents
Read:
- The main spec file
- The Phase 3 consolidation document
- CLAUDE.md for implementation context
Step 3: Build and Run Tests
Run the project's build and test suite (check CLAUDE.md for the specific commands):
Capture:
- Total tests run
- Tests passed/failed
- Any new test classes added
Step 4: Verify Implementation Checklist
Check each item from the spec:
- Files Added: Verify all specified files exist
- Files Modified: Verify changes were made to specified files
- Configuration/Constants Added: Check relevant config files
- HTTP Endpoints: Verify endpoints work (if applicable)
- Integration Points: Check pipeline/factory integration
- Test Coverage: Verify test files exist and pass
Step 5: Document Deviations
If the implementation differs from the spec:
- Document what changed
- Explain why the deviation was necessary
- Determine if the spec should be updated
Step 6: Create Verification Document
Create {archiveDir}/{feature-dir}/{FEATURE-ID}_PHASE5_VERIFICATION.md:
# {FEATURE-ID} Phase 5: Verification
**Date**: {today's date}
**Feature**: {Feature Name}
**Phase**: 5 of 6 (Verification)
---
## Executive Summary
{Brief summary of implementation status}
**Status**: {✅ VERIFIED - Ready for Retrospective / ⚠️ ISSUES FOUND / ❌ FAILED}
---
## Verification Checklist
### 1. Files Added
**Status**: {PASS ✅ / FAIL ❌}
| Expected File | Status | Notes |
|---------------|--------|-------|
| {File} | ✅ | {location} |
### 2. Files Modified
**Status**: {PASS ✅ / FAIL ❌}
| File | Expected Change | Status |
|------|-----------------|--------|
| {File} | {change} | ✅ |
### 3. HTTP Endpoints (if applicable)
**Status**: {PASS ✅ / FAIL ❌ / N/A}
{Endpoint verification details}
---
## Test Coverage Analysis
### Test Count Summary
**Target**: {from spec}
**Delivered**: {actual count}
### Test Classes
| Test | Focus | Tests | Status |
|------|-------|-------|--------|
| {TestClass} | {focus} | {count} | ✅ |
### Test Run Results
{paste test output summary}
---
## Deviations from Specification
### Deviation 1: {Title}
**Spec Said**: {what spec specified}
**Implementation**: {what was actually done}
**Reason**: {why the change}
**Spec Update Needed**: {Yes/No}
---
## Phase 5 Verdict
**Status**: ✅ **VERIFIED - Ready for Retrospective**
**Test Summary**: {X} tests, all passing
**Deviations**: {count} documented
---
**Verification Completed**: {date}
**Next Phase**: Phase 6 - Retrospective (`/wf-phase6-retrospective`)
Step 7: Update Main Spec Status
Edit the main spec to update Status to "IMPLEMENTED".
Step 8: Output Summary
- Confirm the verification document was created
- Report overall status
- Summarize test results
- List any deviations
Step 9: Prompt for Next Step
-
Read .claude/templates/context-reminder.md if it exists and display it; otherwise display: "Context Management: Consider starting a new conversation before the next phase to free up context window for better performance."
-
Use AskUserQuestion based on status:
If VERIFIED:
- header: "Next step"
- option1: label="/wf-phase6-retrospective (Recommended)", description="Document lessons learned"
- option2: label="Skip retrospective", description="Feature is complete, skip documentation"
If ISSUES FOUND:
- header: "Next step"
- option1: label="Fix issues and re-verify (Recommended)", description="Address issues, then run /wf-phase5-verify again"
- option2: label="/wf-phase6-retrospective anyway", description="Proceed despite issues (document them in retrospective)"