Validate Story
Pre-implementation story validation with comprehensive 10-step assessment to catch issues before development begins.
Purpose
Before handing a story to James (Developer Agent), validate that the story is complete, accurate, and implementable. Catch template gaps, hallucinated details, and missing context that would cause implementation failures.
Core Principles:
- Comprehensive - 10 validation steps cover all critical aspects
- Anti-hallucination - Verify all technical claims against source documents
- Actionable - Every issue has clear fix guidance
- GO/NO-GO clarity - Binary decision with confidence level
- Educational - Report teaches story creators what to improve
Integration:
- Input: Story markdown file from story creation process
- Processing: 10-step validation → Issue identification → Report generation
- Output: Validation report with GO/NO-GO decision + issues + recommendations
When to Use This Skill
This skill should be used when:
- Story just created, before implementation
- Story updated, needs re-validation
- Pre-sprint planning (validate backlog stories)
- Story handed from PO → Dev team
This skill should NOT be used when:
- Story already in implementation
- Quick review needed (use quick mode)
- Story is template/draft only
Prerequisites
- Story file exists in
.claude/stories/{epic-id}/{story-id}.md
- Story template available (for comparison)
- Parent epic file exists (if story references epic)
- Architecture/project docs available (for anti-hallucination checks)
10-Step Validation Workflow
Step 0: Load Configuration and Story
Purpose: Load project configuration, story file, template, and related documents.
Actions:
Load Story File:
Use Claude Code Read tool:
Read: .claude/stories/{epic-id}/{story-id}.md
Extract metadata:
- Story ID
- Epic ID (if referenced)
- Title
- Status
- All sections
Load Story Template:
Read: .claude/skills/planning/create-story/references/templates.md
Extract template structure:
- Required sections
- Optional sections
- Expected placeholders
Load Parent Epic (if applicable):
If story references epic:
Read: .claude/epics/{epic-id}.md
Verify story aligns with epic objectives.
Load Project Structure:
Read: docs/unified-project-structure.md
For validating file paths and directory structure.
Load Architecture Docs (for anti-hallucination):
Read: docs/architecture/*.md
For verifying technical claims.
Outputs:
story_content - Full story text
template_sections[] - Required sections from template
epic_context - Parent epic details
project_structure - Expected file/directory layout
architecture_docs[] - Technical reference docs
See: references/templates.md for story template structure
Step 1: Template Completeness Validation
Purpose: Ensure all required template sections present and no unfilled placeholders.
Actions:
Extract Story Sections:
Parse story markdown to extract sections:
- Objective
- Context
- Acceptance Criteria
- Tasks/Subtasks
- Dev Notes
- Testing & Validation
- File List
- Dependencies
- etc.
Compare with Template:
For each required section in template:
- ✅ Section exists in story
- ✅ Section has content (not empty)
- ✅ Section content is meaningful (not placeholder text)
Check for Unfilled Placeholders:
Search for placeholder patterns:
{{EpicNum}}, {{StoryNum}}, {{var}}
_TBD_, [TBD], TODO
..., [more details needed]
Report Missing/Incomplete Sections:
Critical Issues:
- Missing section: "Testing & Validation"
- Unfilled placeholder: {{EpicNum}} in Objective
- Empty section: "Dependencies"
Should-Fix:
- Section "Dev Notes" has only 2 lines (expected detailed technical context)
Validation Criteria:
- ✅ All required sections present
- ✅ No unfilled placeholders (
{{var}}, _TBD_)
- ✅ Sections have meaningful content (>3 lines for substantial sections)
Outputs:
missing_sections[] - Required sections not found
unfilled_placeholders[] - Placeholder patterns still in story
empty_sections[] - Sections with no/minimal content
See: references/validation-checklist.md for detailed template requirements
Step 2: File Structure and Source Tree Validation
Purpose: Verify file paths, directory structure, and source tree references are accurate and consistent.
Actions:
Extract File References:
From story sections (File List, Tasks, Dev Notes):
- New files to create
- Existing files to modify
- Directories mentioned
Validate File Paths:
For each file path:
- ✅ Matches project structure (src/, tests/, docs/)
- ✅ Uses consistent separators (forward slashes)
- ✅ No absolute paths (only relative to project root)
- ✅ File extensions correct (.ts, .js, .md, .yaml)
Check Directory Consistency:
- ✅ All files in same directory use consistent structure
- ✅ Test files in test directory
- ✅ Source files in source directory
- ✅ No mixing of unrelated files
Verify Source Tree References:
If story mentions project structure:
- ✅ References valid directories from
docs/unified-project-structure.md
- ✅ Directory names match exactly (case-sensitive)
- ✅ No invented directories not in project
Report File Structure Issues:
Critical Issues:
- File path uses Windows separators: "src\auth\login.ts" (should be "src/auth/login.ts")
- Referenced directory doesn't exist: "src/services/auth/" (project has "src/auth/")
Should-Fix:
- Test file in source directory: "src/api/user.test.ts" (should be "tests/api/user.test.ts")
Validation Criteria:
- ✅ File paths match project structure
- ✅ Consistent directory naming
- ✅ Appropriate file locations (tests in tests/, src in src/)
- ✅ No invented directories
Outputs:
invalid_paths[] - File paths that don't match project structure
inconsistent_dirs[] - Directory naming issues
file_location_issues[] - Files in wrong locations
See: references/validation-checklist.md for file structure rules
Step 3: UI/Frontend Completeness (if applicable)
Purpose: For frontend/UI stories, ensure design, components, and interactions are fully specified.
Actions:
Detect UI Story:
Check if story involves frontend:
- Keywords: "UI", "component", "page", "view", "styling", "responsive"
- File references:
.tsx, .vue, .jsx, .html, .css
- Tasks mention UI/UX work
If UI Story, Validate:
Component Specifications:
- ✅ Component names specified
- ✅ Component hierarchy clear (parent/child)
- ✅ Props/inputs documented
Styling/Design:
- ✅ Design guidance provided (colors, spacing, layout)
- ✅ Responsive behavior specified (mobile, tablet, desktop)
- ✅ Accessibility requirements mentioned (ARIA, keyboard nav)
User Interactions:
- ✅ User flows documented (click → modal → submit)
- ✅ Form validation specified
- ✅ Error states defined
Frontend-Backend Integration:
- ✅ API endpoints specified
- ✅ Data models documented
- ✅ Loading states defined
Report UI Completeness Issues:
Critical Issues:
- No responsive design guidance (mobile/tablet behavior undefined)
Should-Fix:
- Missing accessibility requirements (ARIA labels, keyboard navigation)
- Form validation rules not specified
Validation Criteria (for UI stories):
- ✅ Component specifications sufficient
- ✅ Styling/design guidance clear
- ✅ User interaction flows specified
- ✅ Responsive/accessibility addressed
- ✅ Frontend-backend integration clear
Outputs:
ui_component_issues[] - Component specification gaps
ui_design_issues[] - Design/styling gaps
ui_interaction_issues[] - User flow gaps
See: references/validation-checklist.md for UI validation details
Step 4: Acceptance Criteria Satisfaction
Purpose: Ensure tasks will actually satisfy all acceptance criteria when implemented.
Actions:
Extract Acceptance Criteria:
From story "Acceptance Criteria" section:
- List all ACs with IDs (AC1, AC2, AC3, ...)
Extract Tasks:
From story "Tasks/Subtasks" section:
- List all tasks with descriptions
Map Tasks to ACs:
For each AC:
- Find tasks that address this AC
- Verify tasks are sufficient to satisfy AC
Identify Gaps:
Coverage Analysis:
AC1 "User can log in" → Task 1.1, Task 1.2 ✅
AC2 "Password reset works" → Task 2.1 ✅
AC3 "Session timeout" → No tasks found ❌
Gaps:
- AC3 has no implementing tasks
- AC4 partially covered (only happy path, no error cases)
Verify AC Testability:
For each AC:
- ✅ Measurable (can verify success/failure)
- ✅ Specific (not vague like "should work well")
- ✅ Has success criteria
Report AC Issues:
Critical Issues:
- AC3 "Session timeout" has no implementing tasks
- AC5 too vague: "System should be secure" (not measurable)
Should-Fix:
- AC2 missing error case testing
- AC4 missing edge case handling
Validation Criteria:
- ✅ All ACs have implementing tasks
- ✅ Tasks sufficient to satisfy ACs
- ✅ ACs are testable and measurable
- ✅ Edge cases covered
Outputs:
uncovered_acs[] - ACs with no implementing tasks
partial_coverage_acs[] - ACs partially covered
vague_acs[] - ACs not measurable/testable
See: references/validation-checklist.md for AC validation rules
Step 5: Validation and Testing Instructions
Purpose: Ensure testing approach is clear and comprehensive.
Actions:
Extract Testing Section:
From "Testing & Validation" section:
- Test approach
- Test scenarios
- Validation steps
- Testing tools
Validate Test Approach:
- ✅ Testing strategy clear (unit, integration, e2e)
- ✅ Test scenarios identified
- ✅ Validation steps specific (not just "test it")
- ✅ Testing tools specified (Jest, Pytest, Mocha, etc.)
Check Test Coverage:
For each AC:
- ✅ Has corresponding test scenarios
- ✅ Happy path tested
- ✅ Error cases tested
- ✅ Edge cases tested
Verify Test Data Requirements:
- ✅ Test data needs identified (fixtures, mocks, seeds)
- ✅ Test environment specified (local, staging, CI)
Report Testing Issues:
Critical Issues:
- No test scenarios for AC3
- Testing section says "test manually" (not specific)
Should-Fix:
- Missing integration test scenarios
- No test data requirements specified
Validation Criteria:
- ✅ Test approach clarity
- ✅ Test scenarios identified
- ✅ Validation steps clear
- ✅ Testing tools specified
- ✅ Test data requirements identified
Outputs:
missing_test_scenarios[] - ACs without test scenarios
vague_testing[] - Non-specific testing instructions
test_data_gaps[] - Missing test data requirements
See: references/validation-checklist.md for testing validation
Step 6: Security Considerations (if applicable)
Purpose: For security-critical stories, ensure security requirements are identified and addressed.
Actions:
Detect Security-Critical Story:
Keywords: "auth", "password", "token", "encryption", "secure", "permission", "access control"
If Security-Critical, Validate:
Security Requirements:
- ✅ Authentication/authorization specified
- ✅ Data protection requirements clear (encryption, hashing)
- ✅ Input validation requirements specified
- ✅ Vulnerability prevention addressed (SQL injection, XSS, CSRF)
Compliance:
- ✅ Regulatory requirements mentioned (GDPR, PCI-DSS, HIPAA)
- ✅ Security best practices referenced
Report Security Issues:
Critical Issues:
- Story involves password storage but no hashing requirements specified
- No input validation mentioned for user registration
Should-Fix:
- Missing rate limiting requirements
- No mention of HTTPS enforcement
Validation Criteria (for security stories):
- ✅ Security requirements identified
- ✅ Authentication/authorization specified
- ✅ Data protection clear
- ✅ Vulnerability prevention addressed
- ✅ Compliance requirements addressed
Outputs:
security_gaps[] - Missing security requirements
compliance_issues[] - Compliance gaps
See: references/validation-checklist.md for security validation
Step 7: Tasks/Subtasks Sequence Validation
Purpose: Ensure tasks are in logical order with clear dependencies.
Actions:
Extract Task Sequence:
From "Tasks/Subtasks":
- List tasks in order
- Identify dependencies
Validate Logical Order:
- ✅ Prerequisites before dependent tasks (e.g., create model before controller)
- ✅ Setup tasks before implementation tasks
- ✅ Implementation before testing
- ✅ No circular dependencies
Check Task Granularity:
- ✅ Tasks are appropriately sized (not too broad, not too granular)
- ✅ Each task is actionable (clear what to do)
- ✅ Tasks are testable (can verify completion)
Verify Completeness:
- ✅ All necessary tasks present
- ✅ No missing steps between tasks
- ✅ All ACs covered by tasks (cross-check with Step 4)
Report Task Sequence Issues:
Critical Issues:
- Task 3 depends on Task 5 (circular dependency)
- Task 2 "Implement controller" before Task 1 "Create model" (wrong order)
Should-Fix:
- Task granularity too broad: "Implement entire auth system" (break down)
- Missing task: "Add integration tests" (not in task list)
Validation Criteria:
- ✅ Logical order (dependencies before dependents)
- ✅ Appropriate granularity
- ✅ Complete (all steps present)
- ✅ Actionable (clear instructions)
Outputs:
task_order_issues[] - Tasks in wrong order
task_dependency_issues[] - Circular or unclear dependencies
task_granularity_issues[] - Tasks too broad or too fine
See: references/validation-checklist.md for task validation
Step 8: Anti-Hallucination Verification
Purpose: Verify all technical claims are traceable to source documents, not invented.
Actions:
Extract Technical Claims:
From story (Dev Notes, Tasks, File List):
- File/directory names
- Library/framework names
- API endpoints
- Database tables/columns
- Architecture patterns
- Configuration settings
Verify Against Sources:
File/Directory Claims:
- ✅ Check against
docs/unified-project-structure.md
- ❌ Flag files/dirs not in project structure
Library/Framework Claims:
- ✅ Check against
package.json, requirements.txt, architecture docs
- ❌ Flag libraries not in dependencies
API Endpoint Claims:
- ✅ Check against
docs/architecture/api-spec.md
- ❌ Flag endpoints not documented
Database Claims:
- ✅ Check against
docs/architecture/database-schema.md
- ❌ Flag tables/columns not in schema
Architecture Pattern Claims:
- ✅ Check against
docs/architecture/ docs
- ❌ Flag patterns not documented
Identify Hallucinations:
Anti-Hallucination Findings:
Critical:
- Story claims "bcrypt library" but not in package.json dependencies
- References "auth-service.ts" but no such file in project structure
- Mentions "Redis cache" but architecture docs don't specify Redis
Should-Fix:
- Claims "JWT authentication" but architecture uses sessions
- References "/api/users" endpoint not in API spec
Flag Unverifiable Claims:
- Claims with no source reference
- Details too specific to be general knowledge
- Technical choices not documented in architecture
Validation Criteria:
- ✅ Source verification (all claims traceable)
- ✅ Architecture alignment (matches specs)
- ✅ No invented details (all backed by sources)
- ✅ Reference accuracy (sources correct and accessible)
Outputs:
hallucinated_files[] - Files/dirs not in project
hallucinated_libs[] - Libraries not in dependencies
hallucinated_apis[] - API endpoints not documented
hallucinated_patterns[] - Patterns not in architecture
See: references/validation-checklist.md for anti-hallucination checks
Step 9: Dev Agent Implementation Readiness
Purpose: Assess if story provides sufficient context for developer agent to implement without external docs.
Actions:
Check Self-Contained Context:
- ✅ All necessary technical details in story (not requiring external doc reading)
- ✅ Dev Notes section comprehensive
- ✅ File structure clear
- ✅ Implementation approach specified
Verify Clear Instructions:
- ✅ Tasks are unambiguous (developer knows exactly what to do)
- ✅ No vague instructions ("implement as needed", "use best practices")
- ✅ Technical choices specified (which library, which pattern)
Assess Complete Technical Context:
From Dev Notes:
- ✅ Technical approach explained
- ✅ Key implementation details provided
- ✅ Potential gotchas mentioned
- ✅ Integration points documented
Identify Missing Information:
Implementation Readiness Issues:
Critical:
- Dev Notes missing: No technical approach specified
- Vague task: "Implement authentication" (which method? OAuth? JWT? Sessions?)
Should-Fix:
- Missing integration details: How does this connect to existing auth system?
- No error handling guidance
Score Implementation Readiness:
Readiness Score (1-10):
- 9-10: Fully ready, developer can start immediately
- 7-8: Minor gaps, easily filled during implementation
- 5-6: Significant gaps, requires clarification before starting
- 3-4: Major gaps, story needs substantial rework
- 1-2: Not ready, critical information missing
Validation Criteria:
- ✅ Self-contained context (no external docs needed)
- ✅ Clear instructions (unambiguous steps)
- ✅ Complete technical context (all details in Dev Notes)
- ✅ All tasks actionable
Outputs:
readiness_score - Score 1-10
missing_context[] - Missing technical details
vague_instructions[] - Ambiguous tasks
external_refs_needed[] - References to external docs required
See: references/validation-checklist.md for readiness assessment
Step 10: Generate Validation Report
Purpose: Synthesize all validation findings into actionable report with GO/NO-GO decision.
Actions:
Categorize Issues:
Critical Issues (Must Fix - Story Blocked):
- Missing required sections
- Unfilled placeholders
- Uncovered acceptance criteria
- Hallucinated technical details
- Circular task dependencies
Should-Fix Issues (Important Quality):
- Vague testing instructions
- Missing security considerations
- Incomplete file structure
- Poor task granularity
Nice-to-Have (Optional Enhancements):
- Additional test scenarios
- More detailed Dev Notes
- Better task descriptions
Calculate Readiness Score:
Readiness Score Calculation:
Base: 10 points
Deductions:
- Critical issues: -2 points each
- Should-fix issues: -0.5 points each
- Anti-hallucination findings: -1 point each
Score = max(1, 10 - total_deductions)
Determine Confidence Level:
- High: Readiness ≥ 8, no critical issues, ≤2 should-fix
- Medium: Readiness 5-7, ≤3 critical issues, ≤5 should-fix
- Low: Readiness ≤4, >3 critical issues, or >5 should-fix
Make GO/NO-GO Decision:
GO Criteria:
- No critical issues, OR
- ≤2 critical issues AND readiness ≥ 7
NO-GO Criteria:
2 critical issues, OR
- Readiness < 7, OR
- Any critical anti-hallucination findings
Generate Report:
# Story Validation Report
**Story:** {epic-id}/{story-id} - {title}
**Validated:** {date}
**Validator:** validate-story skill
## Summary
**Decision:** GO / NO-GO
**Readiness Score:** {score}/10
**Confidence Level:** High / Medium / Low
## Validation Results
### Template Compliance: ✅ PASS / ❌ FAIL
- All required sections present
- No unfilled placeholders
### File Structure: ✅ PASS / ⚠️ CONCERNS / ❌ FAIL
- File paths match project structure
- Consistent directory naming
[... continue for all 10 validation steps ...]
## Critical Issues (Must Fix): {count}
1. [SECTION] Description
- Location: {section name or line number}
- Fix: {how to fix}
## Should-Fix Issues (Recommended): {count}
1. [SECTION] Description
- Recommendation: {how to improve}
## Anti-Hallucination Findings: {count}
1. Claim "{detail}" not verified in {source}
- Fix: Remove or source from architecture docs
## Recommendation
{GO/NO-GO} - {rationale}
{If NO-GO}: Fix {count} critical issues before handing to James.
{If GO}: Proceed to implementation. Address {count} should-fix issues during development.
## Next Steps
{If GO}:
- Hand to James: @james *implement {story-id}
- Monitor for should-fix issues during implementation
{If NO-GO}:
1. Fix critical issues listed above
2. Re-validate: @validate-story {story-file}
3. Proceed once validation passes
Outputs:
validation_report - Full markdown report
validation_passed - Boolean GO/NO-GO
readiness_score - Number 1-10
confidence_level - High/Medium/Low
critical_issues[], should_fix_issues[], nice_to_have[]
See: references/templates.md for full report template
Execution Complete
Skill complete when:
- ✅ All 10 validation steps executed
- ✅ Issues categorized (critical/should-fix/nice-to-have)
- ✅ Readiness score calculated
- ✅ GO/NO-GO decision made
- ✅ Validation report generated
- ✅ Telemetry emitted
Integration with Workflow
Story Creation → Validation → Implementation Flow:
# Step 1: Create story
@create-story epic-001 story-003 "User Authentication"
# Step 2: Validate story
@validate-story .claude/stories/epic-001/story-003.md
# If GO:
@james *implement story-003
# If NO-GO:
# Fix critical issues, re-validate
@validate-story .claude/stories/epic-001/story-003.md
Who Invokes:
- Product Owner (before accepting story)
- Scrum Master (during sprint planning)
- Story creator (self-validation)
- James (auto-validate before implementation - optional)
Best Practices
- Always validate before implementation - Catch issues early
- Fix critical issues first - Don't proceed with NO-GO stories
- Address should-fix during implementation - Don't block on minor issues
- Re-validate after fixes - Ensure issues resolved
- Track anti-hallucination patterns - Learn common mistakes
- Use quick mode for drafts - Full mode for final validation
When to Escalate
Escalate to user when:
- Multiple anti-hallucination findings (>5)
- Architecture mismatch (story conflicts with architecture)
- Unclear requirements (story too vague to validate)
- Missing epic context (epic file not found)
- Template version mismatch (story uses old template)
References
references/templates.md - Validation report format, story template schema
references/validation-checklist.md - Detailed checklist for all 10 steps
references/examples.md - GO and NO-GO validation examples
Part of BMAD Enhanced Planning Suite - Ensures quality stories before implementation
1---2name: validate-story3description: Pre-implementation story validation with 10-step comprehensive assessment including template compliance, anti-hallucination verification, and implementation readiness scoring. This skill should be used before handing story to development agent.4---5
6# Validate Story
7
8Pre-implementation story validation with comprehensive 10-step assessment to catch issues before development begins.
9
10## Purpose
11
12Before handing a story to James (Developer Agent), validate that the story is complete, accurate, and implementable. Catch template gaps, hallucinated details, and missing context that would cause implementation failures.
13
14**Core Principles:**
15- **Comprehensive** - 10 validation steps cover all critical aspects
16- **Anti-hallucination** - Verify all technical claims against source documents
17- **Actionable** - Every issue has clear fix guidance
18- **GO/NO-GO clarity** - Binary decision with confidence level
19- **Educational** - Report teaches story creators what to improve
20
21**Integration:**
22- **Input:** Story markdown file from story creation process
23- **Processing:** 10-step validation → Issue identification → Report generation
24- **Output:** Validation report with GO/NO-GO decision + issues + recommendations
25
26## When to Use This Skill
27
28**This skill should be used when:**
29- Story just created, before implementation
30- Story updated, needs re-validation
31- Pre-sprint planning (validate backlog stories)
32- Story handed from PO → Dev team
33
34**This skill should NOT be used when:**
35- Story already in implementation
36- Quick review needed (use quick mode)
37- Story is template/draft only
38
39## Prerequisites
40
41- Story file exists in `.claude/stories/{epic-id}/{story-id}.md`
42- Story template available (for comparison)
43- Parent epic file exists (if story references epic)
44- Architecture/project docs available (for anti-hallucination checks)
45
46---
47
48## 10-Step Validation Workflow
49
50### Step 0: Load Configuration and Story
51
52**Purpose:** Load project configuration, story file, template, and related documents.
53
54**Actions:**
55
561. **Load Story File:**
57
58 Use Claude Code Read tool:
59 ```
60 Read: .claude/stories/{epic-id}/{story-id}.md
61 ```
62
63 Extract metadata:
64 - Story ID
65 - Epic ID (if referenced)
66 - Title
67 - Status
68 - All sections
69
702. **Load Story Template:**
71
72 ```
73 Read: .claude/skills/planning/create-story/references/templates.md
74 ```
75
76 Extract template structure:
77 - Required sections
78 - Optional sections
79 - Expected placeholders
80
813. **Load Parent Epic (if applicable):**
82
83 If story references epic:
84 ```
85 Read: .claude/epics/{epic-id}.md
86 ```
87
88 Verify story aligns with epic objectives.
89
904. **Load Project Structure:**
91
92 ```
93 Read: docs/unified-project-structure.md
94 ```
95
96 For validating file paths and directory structure.
97
985. **Load Architecture Docs (for anti-hallucination):**
99
100 ```
101 Read: docs/architecture/*.md
102 ```
103
104 For verifying technical claims.
105
106**Outputs:**
107- `story_content` - Full story text
108- `template_sections[]` - Required sections from template
109- `epic_context` - Parent epic details
110- `project_structure` - Expected file/directory layout
111- `architecture_docs[]` - Technical reference docs
112
113**See:** `references/templates.md` for story template structure
114
115---
116
117### Step 1: Template Completeness Validation
118
119**Purpose:** Ensure all required template sections present and no unfilled placeholders.
120
121**Actions:**
122
1231. **Extract Story Sections:**
124
125 Parse story markdown to extract sections:
126 - Objective
127 - Context
128 - Acceptance Criteria
129 - Tasks/Subtasks
130 - Dev Notes
131 - Testing & Validation
132 - File List
133 - Dependencies
134 - etc.
135
1362. **Compare with Template:**
137
138 For each required section in template:
139 - ✅ Section exists in story
140 - ✅ Section has content (not empty)
141 - ✅ Section content is meaningful (not placeholder text)
142
1433. **Check for Unfilled Placeholders:**
144
145 Search for placeholder patterns:
146 - `{{EpicNum}}`, `{{StoryNum}}`, `{{var}}`
147 - `_TBD_`, `[TBD]`, `TODO`
148 - `...`, `[more details needed]`
149
1504. **Report Missing/Incomplete Sections:**
151
152 ```
153 Critical Issues:
154 - Missing section: "Testing & Validation"
155 - Unfilled placeholder: {{EpicNum}} in Objective
156 - Empty section: "Dependencies"
157
158 Should-Fix:
159 - Section "Dev Notes" has only 2 lines (expected detailed technical context)
160 ```
161
162**Validation Criteria:**
163- ✅ All required sections present
164- ✅ No unfilled placeholders (`{{var}}`, `_TBD_`)
165- ✅ Sections have meaningful content (>3 lines for substantial sections)
166
167**Outputs:**
168- `missing_sections[]` - Required sections not found
169- `unfilled_placeholders[]` - Placeholder patterns still in story
170- `empty_sections[]` - Sections with no/minimal content
171
172**See:** `references/validation-checklist.md` for detailed template requirements
173
174---
175
176### Step 2: File Structure and Source Tree Validation
177
178**Purpose:** Verify file paths, directory structure, and source tree references are accurate and consistent.
179
180**Actions:**
181
1821. **Extract File References:**
183
184 From story sections (File List, Tasks, Dev Notes):
185 - New files to create
186 - Existing files to modify
187 - Directories mentioned
188
1892. **Validate File Paths:**
190
191 For each file path:
192 - ✅ Matches project structure (src/, tests/, docs/)
193 - ✅ Uses consistent separators (forward slashes)
194 - ✅ No absolute paths (only relative to project root)
195 - ✅ File extensions correct (.ts, .js, .md, .yaml)
196
1973. **Check Directory Consistency:**
198
199 - ✅ All files in same directory use consistent structure
200 - ✅ Test files in test directory
201 - ✅ Source files in source directory
202 - ✅ No mixing of unrelated files
203
2044. **Verify Source Tree References:**
205
206 If story mentions project structure:
207 - ✅ References valid directories from `docs/unified-project-structure.md`
208 - ✅ Directory names match exactly (case-sensitive)
209 - ✅ No invented directories not in project
210
2115. **Report File Structure Issues:**
212
213 ```
214 Critical Issues:
215 - File path uses Windows separators: "src\auth\login.ts" (should be "src/auth/login.ts")
216 - Referenced directory doesn't exist: "src/services/auth/" (project has "src/auth/")
217
218 Should-Fix:
219 - Test file in source directory: "src/api/user.test.ts" (should be "tests/api/user.test.ts")
220 ```
221
222**Validation Criteria:**
223- ✅ File paths match project structure
224- ✅ Consistent directory naming
225- ✅ Appropriate file locations (tests in tests/, src in src/)
226- ✅ No invented directories
227
228**Outputs:**
229- `invalid_paths[]` - File paths that don't match project structure
230- `inconsistent_dirs[]` - Directory naming issues
231- `file_location_issues[]` - Files in wrong locations
232
233**See:** `references/validation-checklist.md` for file structure rules
234
235---
236
237### Step 3: UI/Frontend Completeness (if applicable)
238
239**Purpose:** For frontend/UI stories, ensure design, components, and interactions are fully specified.
240
241**Actions:**
242
2431. **Detect UI Story:**
244
245 Check if story involves frontend:
246 - Keywords: "UI", "component", "page", "view", "styling", "responsive"
247 - File references: `.tsx`, `.vue`, `.jsx`, `.html`, `.css`
248 - Tasks mention UI/UX work
249
2502. **If UI Story, Validate:**
251
252 **Component Specifications:**
253 - ✅ Component names specified
254 - ✅ Component hierarchy clear (parent/child)
255 - ✅ Props/inputs documented
256
257 **Styling/Design:**
258 - ✅ Design guidance provided (colors, spacing, layout)
259 - ✅ Responsive behavior specified (mobile, tablet, desktop)
260 - ✅ Accessibility requirements mentioned (ARIA, keyboard nav)
261
262 **User Interactions:**
263 - ✅ User flows documented (click → modal → submit)
264 - ✅ Form validation specified
265 - ✅ Error states defined
266
267 **Frontend-Backend Integration:**
268 - ✅ API endpoints specified
269 - ✅ Data models documented
270 - ✅ Loading states defined
271
2723. **Report UI Completeness Issues:**
273
274 ```
275 Critical Issues:
276 - No responsive design guidance (mobile/tablet behavior undefined)
277
278 Should-Fix:
279 - Missing accessibility requirements (ARIA labels, keyboard navigation)
280 - Form validation rules not specified
281 ```
282
283**Validation Criteria (for UI stories):**
284- ✅ Component specifications sufficient
285- ✅ Styling/design guidance clear
286- ✅ User interaction flows specified
287- ✅ Responsive/accessibility addressed
288- ✅ Frontend-backend integration clear
289
290**Outputs:**
291- `ui_component_issues[]` - Component specification gaps
292- `ui_design_issues[]` - Design/styling gaps
293- `ui_interaction_issues[]` - User flow gaps
294
295**See:** `references/validation-checklist.md` for UI validation details
296
297---
298
299### Step 4: Acceptance Criteria Satisfaction
300
301**Purpose:** Ensure tasks will actually satisfy all acceptance criteria when implemented.
302
303**Actions:**
304
3051. **Extract Acceptance Criteria:**
306
307 From story "Acceptance Criteria" section:
308 - List all ACs with IDs (AC1, AC2, AC3, ...)
309
3102. **Extract Tasks:**
311
312 From story "Tasks/Subtasks" section:
313 - List all tasks with descriptions
314
3153. **Map Tasks to ACs:**
316
317 For each AC:
318 - Find tasks that address this AC
319 - Verify tasks are sufficient to satisfy AC
320
3214. **Identify Gaps:**
322
323 ```
324 Coverage Analysis:
325 AC1 "User can log in" → Task 1.1, Task 1.2 ✅
326 AC2 "Password reset works" → Task 2.1 ✅
327 AC3 "Session timeout" → No tasks found ❌
328
329 Gaps:
330 - AC3 has no implementing tasks
331 - AC4 partially covered (only happy path, no error cases)
332 ```
333
3345. **Verify AC Testability:**
335
336 For each AC:
337 - ✅ Measurable (can verify success/failure)
338 - ✅ Specific (not vague like "should work well")
339 - ✅ Has success criteria
340
3416. **Report AC Issues:**
342
343 ```
344 Critical Issues:
345 - AC3 "Session timeout" has no implementing tasks
346 - AC5 too vague: "System should be secure" (not measurable)
347
348 Should-Fix:
349 - AC2 missing error case testing
350 - AC4 missing edge case handling
351 ```
352
353**Validation Criteria:**
354- ✅ All ACs have implementing tasks
355- ✅ Tasks sufficient to satisfy ACs
356- ✅ ACs are testable and measurable
357- ✅ Edge cases covered
358
359**Outputs:**
360- `uncovered_acs[]` - ACs with no implementing tasks
361- `partial_coverage_acs[]` - ACs partially covered
362- `vague_acs[]` - ACs not measurable/testable
363
364**See:** `references/validation-checklist.md` for AC validation rules
365
366---
367
368### Step 5: Validation and Testing Instructions
369
370**Purpose:** Ensure testing approach is clear and comprehensive.
371
372**Actions:**
373
3741. **Extract Testing Section:**
375
376 From "Testing & Validation" section:
377 - Test approach
378 - Test scenarios
379 - Validation steps
380 - Testing tools
381
3822. **Validate Test Approach:**
383
384 - ✅ Testing strategy clear (unit, integration, e2e)
385 - ✅ Test scenarios identified
386 - ✅ Validation steps specific (not just "test it")
387 - ✅ Testing tools specified (Jest, Pytest, Mocha, etc.)
388
3893. **Check Test Coverage:**
390
391 For each AC:
392 - ✅ Has corresponding test scenarios
393 - ✅ Happy path tested
394 - ✅ Error cases tested
395 - ✅ Edge cases tested
396
3974. **Verify Test Data Requirements:**
398
399 - ✅ Test data needs identified (fixtures, mocks, seeds)
400 - ✅ Test environment specified (local, staging, CI)
401
4025. **Report Testing Issues:**
403
404 ```
405 Critical Issues:
406 - No test scenarios for AC3
407 - Testing section says "test manually" (not specific)
408
409 Should-Fix:
410 - Missing integration test scenarios
411 - No test data requirements specified
412 ```
413
414**Validation Criteria:**
415- ✅ Test approach clarity
416- ✅ Test scenarios identified
417- ✅ Validation steps clear
418- ✅ Testing tools specified
419- ✅ Test data requirements identified
420
421**Outputs:**
422- `missing_test_scenarios[]` - ACs without test scenarios
423- `vague_testing[]` - Non-specific testing instructions
424- `test_data_gaps[]` - Missing test data requirements
425
426**See:** `references/validation-checklist.md` for testing validation
427
428---
429
430### Step 6: Security Considerations (if applicable)
431
432**Purpose:** For security-critical stories, ensure security requirements are identified and addressed.
433
434**Actions:**
435
4361. **Detect Security-Critical Story:**
437
438 Keywords: "auth", "password", "token", "encryption", "secure", "permission", "access control"
439
4402. **If Security-Critical, Validate:**
441
442 **Security Requirements:**
443 - ✅ Authentication/authorization specified
444 - ✅ Data protection requirements clear (encryption, hashing)
445 - ✅ Input validation requirements specified
446 - ✅ Vulnerability prevention addressed (SQL injection, XSS, CSRF)
447
448 **Compliance:**
449 - ✅ Regulatory requirements mentioned (GDPR, PCI-DSS, HIPAA)
450 - ✅ Security best practices referenced
451
4523. **Report Security Issues:**
453
454 ```
455 Critical Issues:
456 - Story involves password storage but no hashing requirements specified
457 - No input validation mentioned for user registration
458
459 Should-Fix:
460 - Missing rate limiting requirements
461 - No mention of HTTPS enforcement
462 ```
463
464**Validation Criteria (for security stories):**
465- ✅ Security requirements identified
466- ✅ Authentication/authorization specified
467- ✅ Data protection clear
468- ✅ Vulnerability prevention addressed
469- ✅ Compliance requirements addressed
470
471**Outputs:**
472- `security_gaps[]` - Missing security requirements
473- `compliance_issues[]` - Compliance gaps
474
475**See:** `references/validation-checklist.md` for security validation
476
477---
478
479### Step 7: Tasks/Subtasks Sequence Validation
480
481**Purpose:** Ensure tasks are in logical order with clear dependencies.
482
483**Actions:**
484
4851. **Extract Task Sequence:**
486
487 From "Tasks/Subtasks":
488 - List tasks in order
489 - Identify dependencies
490
4912. **Validate Logical Order:**
492
493 - ✅ Prerequisites before dependent tasks (e.g., create model before controller)
494 - ✅ Setup tasks before implementation tasks
495 - ✅ Implementation before testing
496 - ✅ No circular dependencies
497
4983. **Check Task Granularity:**
499
500 - ✅ Tasks are appropriately sized (not too broad, not too granular)
501 - ✅ Each task is actionable (clear what to do)
502 - ✅ Tasks are testable (can verify completion)
503
5044. **Verify Completeness:**
505
506 - ✅ All necessary tasks present
507 - ✅ No missing steps between tasks
508 - ✅ All ACs covered by tasks (cross-check with Step 4)
509
5105. **Report Task Sequence Issues:**
511
512 ```
513 Critical Issues:
514 - Task 3 depends on Task 5 (circular dependency)
515 - Task 2 "Implement controller" before Task 1 "Create model" (wrong order)
516
517 Should-Fix:
518 - Task granularity too broad: "Implement entire auth system" (break down)
519 - Missing task: "Add integration tests" (not in task list)
520 ```
521
522**Validation Criteria:**
523- ✅ Logical order (dependencies before dependents)
524- ✅ Appropriate granularity
525- ✅ Complete (all steps present)
526- ✅ Actionable (clear instructions)
527
528**Outputs:**
529- `task_order_issues[]` - Tasks in wrong order
530- `task_dependency_issues[]` - Circular or unclear dependencies
531- `task_granularity_issues[]` - Tasks too broad or too fine
532
533**See:** `references/validation-checklist.md` for task validation
534
535---
536
537### Step 8: Anti-Hallucination Verification
538
539**Purpose:** Verify all technical claims are traceable to source documents, not invented.
540
541**Actions:**
542
5431. **Extract Technical Claims:**
544
545 From story (Dev Notes, Tasks, File List):
546 - File/directory names
547 - Library/framework names
548 - API endpoints
549 - Database tables/columns
550 - Architecture patterns
551 - Configuration settings
552
5532. **Verify Against Sources:**
554
555 **File/Directory Claims:**
556 - ✅ Check against `docs/unified-project-structure.md`
557 - ❌ Flag files/dirs not in project structure
558
559 **Library/Framework Claims:**
560 - ✅ Check against `package.json`, `requirements.txt`, architecture docs
561 - ❌ Flag libraries not in dependencies
562
563 **API Endpoint Claims:**
564 - ✅ Check against `docs/architecture/api-spec.md`
565 - ❌ Flag endpoints not documented
566
567 **Database Claims:**
568 - ✅ Check against `docs/architecture/database-schema.md`
569 - ❌ Flag tables/columns not in schema
570
571 **Architecture Pattern Claims:**
572 - ✅ Check against `docs/architecture/` docs
573 - ❌ Flag patterns not documented
574
5753. **Identify Hallucinations:**
576
577 ```
578 Anti-Hallucination Findings:
579
580 Critical:
581 - Story claims "bcrypt library" but not in package.json dependencies
582 - References "auth-service.ts" but no such file in project structure
583 - Mentions "Redis cache" but architecture docs don't specify Redis
584
585 Should-Fix:
586 - Claims "JWT authentication" but architecture uses sessions
587 - References "/api/users" endpoint not in API spec
588 ```
589
5904. **Flag Unverifiable Claims:**
591
592 - Claims with no source reference
593 - Details too specific to be general knowledge
594 - Technical choices not documented in architecture
595
596**Validation Criteria:**
597- ✅ Source verification (all claims traceable)
598- ✅ Architecture alignment (matches specs)
599- ✅ No invented details (all backed by sources)
600- ✅ Reference accuracy (sources correct and accessible)
601
602**Outputs:**
603- `hallucinated_files[]` - Files/dirs not in project
604- `hallucinated_libs[]` - Libraries not in dependencies
605- `hallucinated_apis[]` - API endpoints not documented
606- `hallucinated_patterns[]` - Patterns not in architecture
607
608**See:** `references/validation-checklist.md` for anti-hallucination checks
609
610---
611
612### Step 9: Dev Agent Implementation Readiness
613
614**Purpose:** Assess if story provides sufficient context for developer agent to implement without external docs.
615
616**Actions:**
617
6181. **Check Self-Contained Context:**
619
620 - ✅ All necessary technical details in story (not requiring external doc reading)
621 - ✅ Dev Notes section comprehensive
622 - ✅ File structure clear
623 - ✅ Implementation approach specified
624
6252. **Verify Clear Instructions:**
626
627 - ✅ Tasks are unambiguous (developer knows exactly what to do)
628 - ✅ No vague instructions ("implement as needed", "use best practices")
629 - ✅ Technical choices specified (which library, which pattern)
630
6313. **Assess Complete Technical Context:**
632
633 From Dev Notes:
634 - ✅ Technical approach explained
635 - ✅ Key implementation details provided
636 - ✅ Potential gotchas mentioned
637 - ✅ Integration points documented
638
6394. **Identify Missing Information:**
640
641 ```
642 Implementation Readiness Issues:
643
644 Critical:
645 - Dev Notes missing: No technical approach specified
646 - Vague task: "Implement authentication" (which method? OAuth? JWT? Sessions?)
647
648 Should-Fix:
649 - Missing integration details: How does this connect to existing auth system?
650 - No error handling guidance
651 ```
652
6535. **Score Implementation Readiness:**
654
655 **Readiness Score (1-10):**
656 - 9-10: Fully ready, developer can start immediately
657 - 7-8: Minor gaps, easily filled during implementation
658 - 5-6: Significant gaps, requires clarification before starting
659 - 3-4: Major gaps, story needs substantial rework
660 - 1-2: Not ready, critical information missing
661
662**Validation Criteria:**
663- ✅ Self-contained context (no external docs needed)
664- ✅ Clear instructions (unambiguous steps)
665- ✅ Complete technical context (all details in Dev Notes)
666- ✅ All tasks actionable
667
668**Outputs:**
669- `readiness_score` - Score 1-10
670- `missing_context[]` - Missing technical details
671- `vague_instructions[]` - Ambiguous tasks
672- `external_refs_needed[]` - References to external docs required
673
674**See:** `references/validation-checklist.md` for readiness assessment
675
676---
677
678### Step 10: Generate Validation Report
679
680**Purpose:** Synthesize all validation findings into actionable report with GO/NO-GO decision.
681
682**Actions:**
683
6841. **Categorize Issues:**
685
686 **Critical Issues (Must Fix - Story Blocked):**
687 - Missing required sections
688 - Unfilled placeholders
689 - Uncovered acceptance criteria
690 - Hallucinated technical details
691 - Circular task dependencies
692
693 **Should-Fix Issues (Important Quality):**
694 - Vague testing instructions
695 - Missing security considerations
696 - Incomplete file structure
697 - Poor task granularity
698
699 **Nice-to-Have (Optional Enhancements):**
700 - Additional test scenarios
701 - More detailed Dev Notes
702 - Better task descriptions
703
7042. **Calculate Readiness Score:**
705
706 ```
707 Readiness Score Calculation:
708 Base: 10 points
709
710 Deductions:
711 - Critical issues: -2 points each
712 - Should-fix issues: -0.5 points each
713 - Anti-hallucination findings: -1 point each
714
715 Score = max(1, 10 - total_deductions)
716 ```
717
7183. **Determine Confidence Level:**
719
720 - **High:** Readiness ≥ 8, no critical issues, ≤2 should-fix
721 - **Medium:** Readiness 5-7, ≤3 critical issues, ≤5 should-fix
722 - **Low:** Readiness ≤4, >3 critical issues, or >5 should-fix
723
7244. **Make GO/NO-GO Decision:**
725
726 **GO Criteria:**
727 - No critical issues, OR
728 - ≤2 critical issues AND readiness ≥ 7
729
730 **NO-GO Criteria:**
731 - >2 critical issues, OR
732 - Readiness < 7, OR
733 - Any critical anti-hallucination findings
734
7355. **Generate Report:**
736
737 ```markdown
738 # Story Validation Report
739
740 **Story:** {epic-id}/{story-id} - {title}
741 **Validated:** {date}
742 **Validator:** validate-story skill
743
744 ## Summary
745
746 **Decision:** GO / NO-GO
747 **Readiness Score:** {score}/10
748 **Confidence Level:** High / Medium / Low
749
750 ## Validation Results
751
752 ### Template Compliance: ✅ PASS / ❌ FAIL
753 - All required sections present
754 - No unfilled placeholders
755
756 ### File Structure: ✅ PASS / ⚠️ CONCERNS / ❌ FAIL
757 - File paths match project structure
758 - Consistent directory naming
759
760 [... continue for all 10 validation steps ...]
761
762 ## Critical Issues (Must Fix): {count}
763
764 1. [SECTION] Description
765 - Location: {section name or line number}
766 - Fix: {how to fix}
767
768 ## Should-Fix Issues (Recommended): {count}
769
770 1. [SECTION] Description
771 - Recommendation: {how to improve}
772
773 ## Anti-Hallucination Findings: {count}
774
775 1. Claim "{detail}" not verified in {source}
776 - Fix: Remove or source from architecture docs
777
778 ## Recommendation
779
780 {GO/NO-GO} - {rationale}
781
782 {If NO-GO}: Fix {count} critical issues before handing to James.
783 {If GO}: Proceed to implementation. Address {count} should-fix issues during development.
784
785 ## Next Steps
786
787 {If GO}:
788 - Hand to James: @james *implement {story-id}
789 - Monitor for should-fix issues during implementation
790
791 {If NO-GO}:
792 1. Fix critical issues listed above
793 2. Re-validate: @validate-story {story-file}
794 3. Proceed once validation passes
795 ```
796
797**Outputs:**
798- `validation_report` - Full markdown report
799- `validation_passed` - Boolean GO/NO-GO
800- `readiness_score` - Number 1-10
801- `confidence_level` - High/Medium/Low
802- `critical_issues[]`, `should_fix_issues[]`, `nice_to_have[]`
803
804**See:** `references/templates.md` for full report template
805
806---
807
808## Execution Complete
809
810Skill complete when:
811
812- ✅ All 10 validation steps executed
813- ✅ Issues categorized (critical/should-fix/nice-to-have)
814- ✅ Readiness score calculated
815- ✅ GO/NO-GO decision made
816- ✅ Validation report generated
817- ✅ Telemetry emitted
818
819## Integration with Workflow
820
821**Story Creation → Validation → Implementation Flow:**
822
823```bash
824# Step 1: Create story
825@create-story epic-001 story-003 "User Authentication"
826
827# Step 2: Validate story
828@validate-story .claude/stories/epic-001/story-003.md
829
830# If GO:
831@james *implement story-003
832
833# If NO-GO:
834# Fix critical issues, re-validate
835@validate-story .claude/stories/epic-001/story-003.md
836```
837
838**Who Invokes:**
839- Product Owner (before accepting story)
840- Scrum Master (during sprint planning)
841- Story creator (self-validation)
842- James (auto-validate before implementation - optional)
843
844## Best Practices
845
8461. **Always validate before implementation** - Catch issues early
8472. **Fix critical issues first** - Don't proceed with NO-GO stories
8483. **Address should-fix during implementation** - Don't block on minor issues
8494. **Re-validate after fixes** - Ensure issues resolved
8505. **Track anti-hallucination patterns** - Learn common mistakes
8516. **Use quick mode for drafts** - Full mode for final validation
852
853## When to Escalate
854
855**Escalate to user when:**
856- Multiple anti-hallucination findings (>5)
857- Architecture mismatch (story conflicts with architecture)
858- Unclear requirements (story too vague to validate)
859- Missing epic context (epic file not found)
860- Template version mismatch (story uses old template)
861
862## References
863
864- `references/templates.md` - Validation report format, story template schema
865- `references/validation-checklist.md` - Detailed checklist for all 10 steps
866- `references/examples.md` - GO and NO-GO validation examples
867
868---
869
870*Part of BMAD Enhanced Planning Suite - Ensures quality stories before implementation*