specweave 1.0.256 â 1.0.259
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +56 -221
- package/README.md +31 -0
- package/bin/specweave.js +17 -0
- package/dist/src/adapters/README.md +4 -4
- package/dist/src/adapters/agents-md-generator.d.ts.map +1 -1
- package/dist/src/adapters/agents-md-generator.js +0 -2
- package/dist/src/adapters/agents-md-generator.js.map +1 -1
- package/dist/src/adapters/claude/README.md +3 -3
- package/dist/src/adapters/claude/adapter.js +3 -3
- package/dist/src/adapters/claude-md-generator.js +1 -1
- package/dist/src/adapters/claude-md-generator.js.map +1 -1
- package/dist/src/adapters/registry.yaml +1 -1
- package/dist/src/cli/commands/create-increment.d.ts +24 -0
- package/dist/src/cli/commands/create-increment.d.ts.map +1 -0
- package/dist/src/cli/commands/create-increment.js +53 -0
- package/dist/src/cli/commands/create-increment.js.map +1 -0
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +48 -31
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/update.d.ts.map +1 -1
- package/dist/src/cli/commands/update.js +36 -0
- package/dist/src/cli/commands/update.js.map +1 -1
- package/dist/src/cli/helpers/init/directory-structure.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/directory-structure.js +13 -1
- package/dist/src/cli/helpers/init/directory-structure.js.map +1 -1
- package/dist/src/cli/helpers/init/summary-banner.d.ts +11 -0
- package/dist/src/cli/helpers/init/summary-banner.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/summary-banner.js +49 -3
- package/dist/src/cli/helpers/init/summary-banner.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.js +0 -1
- package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js +6 -2
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js.map +1 -1
- package/dist/src/core/ac-progress-sync.d.ts +13 -0
- package/dist/src/core/ac-progress-sync.d.ts.map +1 -1
- package/dist/src/core/ac-progress-sync.js +28 -0
- package/dist/src/core/ac-progress-sync.js.map +1 -1
- package/dist/src/core/config/types.d.ts +24 -1
- package/dist/src/core/config/types.d.ts.map +1 -1
- package/dist/src/core/config/types.js +6 -1
- package/dist/src/core/config/types.js.map +1 -1
- package/dist/src/core/doctor/checkers/project-structure-checker.d.ts +1 -0
- package/dist/src/core/doctor/checkers/project-structure-checker.d.ts.map +1 -1
- package/dist/src/core/doctor/checkers/project-structure-checker.js +53 -3
- package/dist/src/core/doctor/checkers/project-structure-checker.js.map +1 -1
- package/dist/src/core/fabric/security-scanner.d.ts.map +1 -1
- package/dist/src/core/fabric/security-scanner.js +70 -9
- package/dist/src/core/fabric/security-scanner.js.map +1 -1
- package/dist/src/core/increment/increment-utils.d.ts +6 -0
- package/dist/src/core/increment/increment-utils.d.ts.map +1 -1
- package/dist/src/core/increment/increment-utils.js +5 -0
- package/dist/src/core/increment/increment-utils.js.map +1 -1
- package/dist/src/core/living-docs/discovery.d.ts +2 -0
- package/dist/src/core/living-docs/discovery.d.ts.map +1 -1
- package/dist/src/core/living-docs/discovery.js +91 -17
- package/dist/src/core/living-docs/discovery.js.map +1 -1
- package/dist/src/core/living-docs/intelligent-analyzer/index.d.ts +5 -0
- package/dist/src/core/living-docs/intelligent-analyzer/index.d.ts.map +1 -1
- package/dist/src/core/living-docs/intelligent-analyzer/index.js +3 -3
- package/dist/src/core/living-docs/intelligent-analyzer/index.js.map +1 -1
- package/dist/src/core/living-docs/lsp-bootstrapper.d.ts +64 -0
- package/dist/src/core/living-docs/lsp-bootstrapper.d.ts.map +1 -0
- package/dist/src/core/living-docs/lsp-bootstrapper.js +118 -0
- package/dist/src/core/living-docs/lsp-bootstrapper.js.map +1 -0
- package/dist/src/core/project/project-service.d.ts +10 -1
- package/dist/src/core/project/project-service.d.ts.map +1 -1
- package/dist/src/core/project/project-service.js +37 -2
- package/dist/src/core/project/project-service.js.map +1 -1
- package/dist/src/core/universal-auto-create.d.ts +64 -0
- package/dist/src/core/universal-auto-create.d.ts.map +1 -0
- package/dist/src/core/universal-auto-create.js +228 -0
- package/dist/src/core/universal-auto-create.js.map +1 -0
- package/package.json +1 -1
- package/plugins/specweave/PLUGIN.md +0 -3
- package/plugins/specweave/commands/living-docs.md +0 -2
- package/plugins/specweave/hooks/stop-sync.sh +34 -5
- package/plugins/specweave/hooks/user-prompt-submit.sh +115 -326
- package/plugins/specweave/hooks/v2/dispatchers/post-tool-use.sh +19 -5
- package/plugins/specweave/hooks/v2/handlers/ac-sync-dispatcher.sh +14 -4
- package/plugins/specweave/hooks/v2/handlers/universal-auto-create-dispatcher.sh +181 -0
- package/plugins/specweave/lib/hooks/sync-living-docs.js +4 -2
- package/plugins/specweave/scripts/skill-context.sh +160 -0
- package/plugins/specweave/skills/architect/SKILL.md +1 -1
- package/plugins/specweave/skills/archive-increments/SKILL.md +13 -3
- package/plugins/specweave/skills/auto/SKILL.md +92 -1038
- package/plugins/specweave/skills/do/SKILL.md +66 -1106
- package/plugins/specweave/skills/docs/SKILL.md +124 -56
- package/plugins/specweave/skills/done/SKILL.md +76 -1406
- package/plugins/specweave/skills/framework/SKILL.md +1 -1
- package/plugins/specweave/skills/increment/SKILL.md +1 -1
- package/plugins/specweave/skills/increment-planner/SKILL.md +29 -19
- package/plugins/specweave/skills/jobs/SKILL.md +52 -0
- package/plugins/specweave/skills/multi-project-spec-mapper/SKILL.md +1 -1
- package/plugins/specweave/skills/save/SKILL.md +51 -1372
- package/plugins/specweave/skills/smart-reopen-detector/SKILL.md +1 -1
- package/plugins/specweave/skills/tdd-orchestrator/SKILL.md +1 -1
- package/plugins/specweave/skills/validate/SKILL.md +65 -848
- package/plugins/specweave-backend/skills/database-optimizer/SKILL.md +1 -1
- package/plugins/specweave-backend/skills/graphql/SKILL.md +1 -1
- package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +1 -1
- package/plugins/specweave-frontend/skills/frontend/SKILL.md +1 -1
- package/plugins/specweave-frontend/skills/frontend-architect/SKILL.md +1 -1
- package/plugins/specweave-frontend/skills/frontend-design/SKILL.md +1 -1
- package/plugins/specweave-frontend/skills/i18n-expert/SKILL.md +1 -1
- package/plugins/specweave-payments/skills/billing-automation/SKILL.md +1 -1
- package/plugins/specweave-testing/skills/accessibility-testing/SKILL.md +1 -1
- package/src/templates/CLAUDE.md.template +50 -356
- package/src/templates/config.json.template +5 -1
- package/plugins/specweave/commands/brownfield-analyzer.md +0 -408
- package/plugins/specweave/commands/brownfield-onboarder.md +0 -837
- package/plugins/specweave/commands/export-skills.md +0 -179
|
@@ -14,905 +14,122 @@ hooks:
|
|
|
14
14
|
|
|
15
15
|
!`s="validate"; for d in .specweave/skill-memories .claude/skill-memories "$HOME/.claude/skill-memories"; do p="$d/$s.md"; [ -f "$p" ] && awk '/^## Learnings$/{ok=1;next}/^## /{ok=0}ok' "$p" && break; done 2>/dev/null; true`
|
|
16
16
|
|
|
17
|
+
## Project Context
|
|
18
|
+
|
|
19
|
+
!`.specweave/scripts/skill-context.sh validate 2>/dev/null; true`
|
|
20
|
+
|
|
17
21
|
You are helping the user validate a SpecWeave increment with optional AI-powered quality assessment.
|
|
18
22
|
|
|
19
23
|
## Usage
|
|
20
24
|
|
|
21
|
-
```
|
|
25
|
+
```
|
|
22
26
|
/sw:validate <increment-id> [--quality] [--export] [--fix] [--always]
|
|
23
27
|
```
|
|
24
28
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- `<increment-id>`: Required. Increment ID (e.g., "001", "0001", "1", "0042")
|
|
29
|
+
**Flags**: `--quality` (AI assessment) | `--export` (suggestions to tasks.md) | `--fix` (auto-fix HIGH issues) | `--always` (save quality preference)
|
|
28
30
|
|
|
29
|
-
##
|
|
31
|
+
## Two-Gate Validation System
|
|
30
32
|
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
- `--fix`: Auto-fix HIGH priority issues (experimental, requires confirmation)
|
|
33
|
+
- **Gate 1 (Rule-Based)**: Always runs, free, 130+ automated checks
|
|
34
|
+
- **Gate 2 (LLM-as-Judge)**: Optional (`--quality`), AI-powered, ~2K tokens
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
This command implements a **two-gate validation system**:
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
41
|
-
â GATE 1: Rule-Based Validation â
|
|
42
|
-
â (Always runs, FREE) â
|
|
43
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¤
|
|
44
|
-
â 130+ automated checks: â
|
|
45
|
-
â âĸ Structure (file existence, format) â
|
|
46
|
-
â âĸ Three-file canonical (ADR-0047 compliance) â
|
|
47
|
-
â âĸ Consistency (cross-document alignment) â
|
|
48
|
-
â âĸ Completeness (required sections) â
|
|
49
|
-
â âĸ Traceability (AC-ID linkage) â
|
|
50
|
-
â â
|
|
51
|
-
â Result: PASS (all checks) or FAIL (with specific errors) â
|
|
52
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
53
|
-
â
|
|
54
|
-
âŧ
|
|
55
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
56
|
-
â GATE 2: LLM-as-Judge â
|
|
57
|
-
â (Optional, --quality flag) â
|
|
58
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¤
|
|
59
|
-
â AI-powered evaluation using chain-of-thought reasoning: â
|
|
60
|
-
â âĸ 6 quality dimensions (clarity, testability, etc.) â
|
|
61
|
-
â âĸ Evidence-based scoring (0-100 per dimension) â
|
|
62
|
-
â âĸ Structured suggestions with code examples â
|
|
63
|
-
â âĸ Formal verdict (score + recommendations) â
|
|
64
|
-
â â
|
|
65
|
-
â Pattern: "LLM-as-Judge" (established AI/ML technique) â
|
|
66
|
-
â Cost: ~$0.02-0.05 per assessment â
|
|
67
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
**Why two gates?**
|
|
71
|
-
- **Gate 1** catches structural issues (FREE, instant)
|
|
72
|
-
- **Gate 2** catches semantic issues (paid, ~30 seconds)
|
|
73
|
-
- Run Gate 1 first to avoid wasting tokens on invalid specs
|
|
36
|
+
Gate 1 catches structural issues first; Gate 2 catches semantic issues.
|
|
74
37
|
|
|
75
38
|
## Workflow
|
|
76
39
|
|
|
77
|
-
### Step 1: Parse
|
|
78
|
-
|
|
79
|
-
1. **Extract increment ID**:
|
|
80
|
-
- Parse from command: `/sw:validate 001` â "001"
|
|
81
|
-
- **Normalize increment ID**:
|
|
82
|
-
- If ID contains dash (e.g., "0153-feature-name"), extract numeric portion before first dash â "0153"
|
|
83
|
-
- Convert to 4-digit format: "1" â "0001", "153" â "0153"
|
|
84
|
-
- Both formats work: `/sw:validate 0153` or `/sw:validate 0153-feature-name`
|
|
85
|
-
|
|
86
|
-
2. **Extract flags**:
|
|
87
|
-
- Check for `--quality` flag
|
|
88
|
-
- Check for `--export` flag
|
|
89
|
-
- Check for `--fix` flag
|
|
90
|
-
- Check for `--always` flag
|
|
91
|
-
|
|
92
|
-
3. **Validate increment exists**:
|
|
93
|
-
- List directories in `.specweave/increments/`
|
|
94
|
-
- Find matching increment (e.g., `0001-authentication`, `0001-auth`, etc.)
|
|
95
|
-
- If not found: Show error with available increments
|
|
96
|
-
|
|
97
|
-
**Example output if not found**:
|
|
98
|
-
```
|
|
99
|
-
â Error: Increment 0001 not found
|
|
100
|
-
|
|
101
|
-
Available increments:
|
|
102
|
-
âĸ 0002-core-enhancements
|
|
103
|
-
âĸ 0003-payment-processing
|
|
104
|
-
âĸ 0004-reporting-dashboard
|
|
40
|
+
### Step 1: Parse Arguments
|
|
105
41
|
|
|
106
|
-
|
|
107
|
-
|
|
42
|
+
1. Extract increment ID: normalize to 4-digit format ("1" -> "0001", "0153-feature-name" -> "0153")
|
|
43
|
+
2. Extract flags: `--quality`, `--export`, `--fix`, `--always`
|
|
44
|
+
3. Validate increment exists in `.specweave/increments/`. Show error with available increments if not found.
|
|
108
45
|
|
|
109
46
|
### Step 1.5: Sync AC Status
|
|
110
47
|
|
|
111
|
-
|
|
48
|
+
Before validation, sync spec.md ACs with tasks.md completion status to prevent false positives:
|
|
112
49
|
|
|
113
50
|
```typescript
|
|
114
|
-
import { ACStatusManager } from '../../../src/core/increment/ac-status-manager.js';
|
|
115
|
-
|
|
116
|
-
// Sync ACs BEFORE validation to prevent false positives
|
|
117
|
-
// This ensures spec.md ACs reflect actual task completion from tasks.md
|
|
118
|
-
console.log('đ Syncing AC status before validation...');
|
|
119
51
|
const acManager = new ACStatusManager(projectRoot);
|
|
120
52
|
const acSyncResult = await acManager.syncACStatus(incrementId);
|
|
121
|
-
|
|
122
|
-
if (acSyncResult.synced && acSyncResult.updated.length > 0) {
|
|
123
|
-
console.log(`â
Pre-validation sync: Updated ${acSyncResult.updated.length} ACs`);
|
|
124
|
-
acSyncResult.updated.forEach(acId => console.log(` ${acId} â [x]`));
|
|
125
|
-
} else {
|
|
126
|
-
console.log('â
AC status already in sync');
|
|
127
|
-
}
|
|
128
53
|
```
|
|
129
54
|
|
|
130
|
-
|
|
131
|
-
- Background hooks (`post-task-completion.sh`) run async and may not complete before validation
|
|
132
|
-
- This explicit sync prevents "0 ACs checked" false positives
|
|
133
|
-
- Idempotent: safe to call multiple times (no-op if already synced)
|
|
134
|
-
|
|
135
|
-
### Step 2: Run Rule-Based Validation (Always)
|
|
136
|
-
|
|
137
|
-
Run 130+ validation rules across 7 categories:
|
|
138
|
-
|
|
139
|
-
**CRITICAL: Always run structure validation FIRST to prevent duplicate task files**
|
|
140
|
-
|
|
141
|
-
1. **Structure Rules (5 checks)**:
|
|
142
|
-
- Only ONE tasks.md file exists (no tasks-detailed.md, tasks-final.md)
|
|
143
|
-
- Only allowed root files present (spec.md, plan.md, tasks.md, metadata.json, README.md)
|
|
144
|
-
- Unknown files moved to subdirectories (reports/, scripts/, logs/)
|
|
145
|
-
- No root-level pollution (analysis.md, summary.md moved to reports/)
|
|
146
|
-
- Metadata.json structure valid
|
|
147
|
-
|
|
148
|
-
2. **Three-File Canonical Structure (10 checks)** - ADR-0047:
|
|
149
|
-
- **tasks.md validations (CRITICAL)**:
|
|
150
|
-
- â Does NOT contain "**Acceptance Criteria**:" sections
|
|
151
|
-
- â
MUST have "**Implementation**:" sections for each task
|
|
152
|
-
- â
MUST have "**Test Plan (BDD)**" sections
|
|
153
|
-
- â
MUST have **AC-IDs** references linking to spec.md
|
|
154
|
-
- â Does NOT contain "As a user..." user story language
|
|
155
|
-
- **spec.md validations**:
|
|
156
|
-
- â Does NOT contain task IDs (T-001, T-002, etc.)
|
|
157
|
-
- â Does NOT contain technical class/file names
|
|
158
|
-
- â
MUST have "## Acceptance Criteria" section
|
|
159
|
-
- **plan.md validations**:
|
|
160
|
-
- â Does NOT contain "Acceptance Criteria" sections
|
|
161
|
-
- â Does NOT contain task checkboxes
|
|
162
|
-
|
|
163
|
-
3. **Consistency Rules (47 checks)**:
|
|
164
|
-
- User stories in spec.md â sections in plan.md
|
|
165
|
-
- Components in plan.md â tasks in tasks.md
|
|
166
|
-
- Test cases (TC-0001) in spec.md â tests.md coverage
|
|
167
|
-
- Cross-document consistency (IDs, priorities, dependencies)
|
|
168
|
-
|
|
169
|
-
4. **Completeness Rules (23 checks)**:
|
|
170
|
-
- spec.md: Frontmatter, problem statement, user stories, acceptance criteria
|
|
171
|
-
- plan.md: Architecture, components, data model, API contracts, security
|
|
172
|
-
- tasks.md: Task IDs, descriptions, priorities, estimates
|
|
173
|
-
|
|
174
|
-
5. **Quality Rules (31 checks)**:
|
|
175
|
-
- spec.md: Technology-agnostic, testable acceptance criteria
|
|
176
|
-
- plan.md: Technical details, ADRs exist, security addressed
|
|
177
|
-
- tasks.md: Actionable, reasonable estimates (<1 day)
|
|
178
|
-
|
|
179
|
-
6. **Traceability Rules (19 checks)**:
|
|
180
|
-
- TC-0001 format, sequential numbering
|
|
181
|
-
- ADR references exist
|
|
182
|
-
- Diagram references valid
|
|
183
|
-
|
|
184
|
-
7. **AC Coverage & Traceability**:
|
|
185
|
-
- All Acceptance Criteria have implementing tasks (0% uncovered)
|
|
186
|
-
- All tasks link to valid User Stories (**User Story**: US-XXX)
|
|
187
|
-
- All tasks link to valid Acceptance Criteria (**Satisfies ACs**: AC-USXX-YY)
|
|
188
|
-
- No orphan tasks (tasks without AC linkage)
|
|
189
|
-
- AC-Task traceability matrix builds successfully
|
|
190
|
-
- Per-User Story coverage calculated
|
|
191
|
-
|
|
192
|
-
**Display results**:
|
|
193
|
-
```
|
|
194
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
195
|
-
VALIDATION RESULTS: Increment 0001-authentication
|
|
196
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
197
|
-
|
|
198
|
-
â
Rule-Based Validation: PASSED (141/141 checks)
|
|
199
|
-
â Structure (5/5)
|
|
200
|
-
â Three-File Canonical (10/10) [ADR-0047]
|
|
201
|
-
â Consistency (47/47)
|
|
202
|
-
â Completeness (23/23)
|
|
203
|
-
â Quality (31/31)
|
|
204
|
-
â Traceability (19/19)
|
|
205
|
-
â AC Coverage & Traceability (6/6)
|
|
206
|
-
âĸ 100% AC coverage (15/15 ACs covered)
|
|
207
|
-
âĸ 0 orphan tasks
|
|
208
|
-
âĸ All tasks linked to valid User Stories
|
|
209
|
-
|
|
210
|
-
Files validated:
|
|
211
|
-
âĸ spec.md (250 lines, 6 user stories)
|
|
212
|
-
âĸ plan.md (480 lines, 8 components)
|
|
213
|
-
âĸ tasks.md (42 tasks, P0-P2)
|
|
214
|
-
âĸ tests.md (12 test cases, 85% coverage)
|
|
215
|
-
|
|
216
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
217
|
-
```
|
|
55
|
+
This is idempotent and prevents "0 ACs checked" false positives from async hooks.
|
|
218
56
|
|
|
219
|
-
|
|
220
|
-
```
|
|
221
|
-
â Rule-Based Validation: FAILED (128/141 checks)
|
|
222
|
-
â Structure (3/5) - 2 CRITICAL ERRORS
|
|
223
|
-
â Three-File Canonical (7/10) - 3 CRITICAL ERRORS [ADR-0047]
|
|
224
|
-
â Consistency (45/47) - 2 errors
|
|
225
|
-
â Completeness (23/23)
|
|
226
|
-
â ī¸ Quality (28/31) - 3 warnings
|
|
227
|
-
â Traceability (19/19)
|
|
228
|
-
â AC Coverage & Traceability (3/6) - 3 ERRORS
|
|
229
|
-
âĸ 73% AC coverage (11/15 ACs covered) - 4 uncovered
|
|
230
|
-
âĸ 2 orphan tasks detected
|
|
231
|
-
âĸ All US linkage valid
|
|
232
|
-
|
|
233
|
-
CRITICAL STRUCTURE ERRORS (MUST FIX FIRST):
|
|
234
|
-
â Duplicate task files detected: tasks.md, tasks-detailed.md
|
|
235
|
-
â Only ONE tasks.md allowed per increment
|
|
236
|
-
â Move tasks-detailed.md to reports/tasks-detailed.md
|
|
237
|
-
â Unknown root-level file: analysis.md
|
|
238
|
-
â Move to reports/ directory
|
|
239
|
-
|
|
240
|
-
CRITICAL THREE-FILE VIOLATIONS (ADR-0047):
|
|
241
|
-
đ¨ tasks.md:45 - Contains "**Acceptance Criteria**:" section
|
|
242
|
-
â ACs belong in spec.md ONLY
|
|
243
|
-
â Replace with "**Implementation**:" and add AC-ID references
|
|
244
|
-
đ¨ tasks.md:78 - Task T-003 missing "**Implementation**:" section
|
|
245
|
-
â Add checkable implementation steps
|
|
246
|
-
đ¨ spec.md:102 - Contains task ID reference "T-001"
|
|
247
|
-
â Tasks belong in tasks.md, use AC-IDs to link instead
|
|
248
|
-
|
|
249
|
-
AC COVERAGE ERRORS (3):
|
|
250
|
-
đ´ 4 Acceptance Criteria uncovered by tasks:
|
|
251
|
-
â AC-US2-03: Real-time notification delivery (no implementing tasks)
|
|
252
|
-
â AC-US3-01: API rate limiting (no implementing tasks)
|
|
253
|
-
â AC-US3-05: Error handling for network failures (no implementing tasks)
|
|
254
|
-
â AC-US4-02: Audit logging for security events (no implementing tasks)
|
|
255
|
-
đ´ 2 Orphan tasks (no AC linkage):
|
|
256
|
-
â T-008: Refactor authentication module (no **Satisfies ACs** field)
|
|
257
|
-
â T-015: Update documentation (no **Satisfies ACs** field)
|
|
258
|
-
|
|
259
|
-
ERRORS (2):
|
|
260
|
-
đ´ spec.md:45 - Missing acceptance criteria for US-003
|
|
261
|
-
đ´ Inconsistency: spec.md mentions "real-time updates" but plan.md doesn't address it
|
|
262
|
-
|
|
263
|
-
WARNINGS (3):
|
|
264
|
-
đĄ Task T012 exceeds size guideline (5 days, should be <1 day)
|
|
265
|
-
đĄ No security considerations in plan.md
|
|
266
|
-
đĄ ADR-0005 referenced but doesn't exist (plan.md:89)
|
|
267
|
-
|
|
268
|
-
Action required:
|
|
269
|
-
1. â FIX STRUCTURE ERRORS FIRST (single source of truth violation)
|
|
270
|
-
2. đ¨ FIX THREE-FILE VIOLATIONS (ADR-0047 compliance):
|
|
271
|
-
- Run refactoring script: .specweave/increments/XXXX/scripts/refactor-tasks-ac-to-implementation.sh
|
|
272
|
-
- Or manually replace "**Acceptance Criteria**:" with "**Implementation**:"
|
|
273
|
-
- Add "**AC-IDs**: AC-US-XX-YY" references to link tasks to spec.md
|
|
274
|
-
3. đ´ FIX AC COVERAGE ERRORS (US-Task Linkage):
|
|
275
|
-
- Create tasks for 4 uncovered ACs (AC-US2-03, AC-US3-01, AC-US3-05, AC-US4-02)
|
|
276
|
-
- Add **Satisfies ACs** field to 2 orphan tasks (T-008, T-015)
|
|
277
|
-
- Run: /sw:validate 0001 to verify 100% coverage
|
|
278
|
-
4. Fix missing acceptance criteria for US-003
|
|
279
|
-
5. Address "real-time updates" in plan.md or remove from spec.md
|
|
280
|
-
6. Consider breaking down T012 into smaller tasks
|
|
281
|
-
|
|
282
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
### Step 3: Determine If Quality Assessment Should Run
|
|
57
|
+
### Step 2: Run Rule-Based Validation
|
|
286
58
|
|
|
287
|
-
**
|
|
59
|
+
Run 130+ checks across 7 categories. **Run structure validation FIRST.**
|
|
288
60
|
|
|
289
|
-
|
|
290
|
-
|
|
61
|
+
| Category | Checks | Purpose |
|
|
62
|
+
|----------|--------|---------|
|
|
63
|
+
| Structure | 5 | Single tasks.md, allowed root files, metadata.json valid |
|
|
64
|
+
| Three-File Canonical (ADR-0047) | 10 | tasks.md has Implementation (not ACs), spec.md has no task IDs, plan.md has no AC sections |
|
|
65
|
+
| Consistency | 47 | Cross-document alignment (stories -> plan -> tasks -> tests) |
|
|
66
|
+
| Completeness | 23 | Required sections in spec.md, plan.md, tasks.md |
|
|
67
|
+
| Quality | 31 | Tech-agnostic spec, testable ACs, actionable tasks (<1 day) |
|
|
68
|
+
| Traceability | 19 | TC format, ADR refs, diagram refs |
|
|
69
|
+
| AC Coverage | 6 | All ACs have tasks, no orphan tasks, valid US linkage |
|
|
291
70
|
|
|
292
|
-
**
|
|
293
|
-
|
|
294
|
-
|
|
71
|
+
**Key three-file rules (ADR-0047)**:
|
|
72
|
+
- tasks.md: MUST have `**Implementation**:` and `**AC-IDs**:` references. Must NOT have `**Acceptance Criteria**:` or user story language.
|
|
73
|
+
- spec.md: MUST have `## Acceptance Criteria`. Must NOT have task IDs (T-001).
|
|
74
|
+
- plan.md: Must NOT have AC sections or task checkboxes.
|
|
295
75
|
|
|
296
|
-
|
|
297
|
-
âĸ Evaluate spec clarity, testability, edge cases
|
|
298
|
-
âĸ Provide detailed improvement suggestions
|
|
299
|
-
âĸ Use ~2,000 tokens (1-2 minutes)
|
|
300
|
-
âĸ Cost: ~$0.05 (Claude Opus 4.5)
|
|
76
|
+
Display category pass/fail counts and AC coverage percentage.
|
|
301
77
|
|
|
302
|
-
|
|
303
|
-
[Y] Yes, assess quality
|
|
304
|
-
[N] No, skip (default)
|
|
305
|
-
[A] Always run (save to config)
|
|
78
|
+
### Step 3: Determine Quality Assessment
|
|
306
79
|
|
|
307
|
-
|
|
308
|
-
|
|
80
|
+
1. If `--quality` flag: run quality assessment (skip prompt)
|
|
81
|
+
2. Else: prompt user with Y/N/A (Always) choice
|
|
309
82
|
|
|
310
83
|
### Step 4: Run AI Quality Assessment (If Approved)
|
|
311
84
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
```bash
|
|
315
|
-
# Preferred: Use CLI command directly
|
|
316
|
-
specweave qa 0001 --pre
|
|
317
|
-
|
|
318
|
-
# The skill auto-activates when assessing quality
|
|
319
|
-
# DO NOT spawn agents - use CLI instead
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
Assessment parameters:
|
|
323
|
-
- increment_id: "0001"
|
|
324
|
-
- files: ["spec.md", "plan.md", "tests.md"]
|
|
325
|
-
- dimensions: ["clarity", "testability", "completeness", "feasibility", "maintainability", "edge_cases"]
|
|
326
|
-
|
|
327
|
-
**Quality judge evaluates 6 dimensions**:
|
|
328
|
-
|
|
329
|
-
1. **Clarity** (weight: 0.20)
|
|
330
|
-
- Is problem statement clear?
|
|
331
|
-
- Are objectives well-defined?
|
|
332
|
-
- Is terminology consistent?
|
|
333
|
-
|
|
334
|
-
2. **Testability** (weight: 0.25)
|
|
335
|
-
- Are acceptance criteria testable?
|
|
336
|
-
- Can success be measured objectively?
|
|
337
|
-
- Are edge cases identifiable?
|
|
338
|
-
|
|
339
|
-
3. **Completeness** (weight: 0.20)
|
|
340
|
-
- All requirements addressed?
|
|
341
|
-
- Error handling specified?
|
|
342
|
-
- Non-functional requirements included?
|
|
343
|
-
|
|
344
|
-
4. **Feasibility** (weight: 0.15)
|
|
345
|
-
- Architecture scalable?
|
|
346
|
-
- Technical constraints realistic?
|
|
347
|
-
- Timeline achievable?
|
|
348
|
-
|
|
349
|
-
5. **Maintainability** (weight: 0.10)
|
|
350
|
-
- Design modular?
|
|
351
|
-
- Extension points identified?
|
|
352
|
-
- Technical debt addressed?
|
|
353
|
-
|
|
354
|
-
6. **Edge Cases** (weight: 0.10)
|
|
355
|
-
- Failure scenarios covered?
|
|
356
|
-
- Performance limits specified?
|
|
357
|
-
- Security considerations included?
|
|
358
|
-
|
|
359
|
-
**Display quality results**:
|
|
360
|
-
```
|
|
361
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
362
|
-
AI QUALITY ASSESSMENT
|
|
363
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
364
|
-
|
|
365
|
-
Overall Score: 87/100 (GOOD) â
|
|
366
|
-
|
|
367
|
-
Dimension Scores:
|
|
368
|
-
Clarity: 92/100 ââ
|
|
369
|
-
Testability: 78/100 â (Needs improvement)
|
|
370
|
-
Completeness: 90/100 ââ
|
|
371
|
-
Feasibility: 88/100 ââ
|
|
372
|
-
Maintainability: 85/100 â
|
|
373
|
-
Edge Cases: 72/100 â ī¸ (Action needed)
|
|
374
|
-
|
|
375
|
-
Confidence: 92%
|
|
376
|
-
|
|
377
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
378
|
-
ISSUES FOUND (3)
|
|
379
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
380
|
-
|
|
381
|
-
đ´ MAJOR: Acceptance criteria not fully testable
|
|
382
|
-
Dimension: Testability
|
|
383
|
-
Location: spec.md, section "Success Criteria" (line 78)
|
|
384
|
-
Issue: "User can log in successfully" is vague
|
|
385
|
-
Impact: QA won't know when feature is complete
|
|
386
|
-
|
|
387
|
-
đ´ MAJOR: Rate limiting edge case not addressed
|
|
388
|
-
Dimension: Edge Cases
|
|
389
|
-
Location: plan.md, section "Security" (line 145)
|
|
390
|
-
Issue: No mention of brute-force protection
|
|
391
|
-
Impact: Security vulnerability risk (OWASP A07:2021)
|
|
392
|
-
|
|
393
|
-
đ¸ MINOR: Performance requirements missing
|
|
394
|
-
Dimension: Completeness
|
|
395
|
-
Location: spec.md, section "Non-Functional Requirements"
|
|
396
|
-
Issue: No latency or throughput targets specified
|
|
397
|
-
Impact: Hard to measure success objectively
|
|
398
|
-
|
|
399
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
400
|
-
SUGGESTIONS (3)
|
|
401
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
402
|
-
|
|
403
|
-
đ¯ HIGH PRIORITY: Make acceptance criteria measurable
|
|
404
|
-
|
|
405
|
-
Current:
|
|
406
|
-
"User can log in successfully"
|
|
407
|
-
|
|
408
|
-
Improved:
|
|
409
|
-
"User can log in with valid credentials within 2 seconds,
|
|
410
|
-
receiving a JWT token with 24h expiry. Success rate >99.9%."
|
|
411
|
-
|
|
412
|
-
Why: Testable criteria = clear success definition
|
|
413
|
-
|
|
414
|
-
đ¯ HIGH PRIORITY: Specify edge case handling
|
|
415
|
-
|
|
416
|
-
Add section: "Error Scenarios"
|
|
417
|
-
- Rate limiting: 5 failed attempts â 15 min lockout
|
|
418
|
-
- Invalid token: Return 401 with error code AUTH_INVALID
|
|
419
|
-
- Expired session: Redirect to login with message
|
|
420
|
-
- Network timeout: Retry 3 times with exponential backoff
|
|
85
|
+
Use CLI: `specweave qa <id> --pre` (or `increment-quality-judge-v2` skill auto-activates).
|
|
421
86
|
|
|
422
|
-
|
|
87
|
+
**6 quality dimensions**:
|
|
423
88
|
|
|
424
|
-
|
|
89
|
+
| Dimension | Weight |
|
|
90
|
+
|-----------|--------|
|
|
91
|
+
| Clarity | 0.20 |
|
|
92
|
+
| Testability | 0.25 |
|
|
93
|
+
| Completeness | 0.20 |
|
|
94
|
+
| Feasibility | 0.15 |
|
|
95
|
+
| Maintainability | 0.10 |
|
|
96
|
+
| Edge Cases | 0.10 |
|
|
425
97
|
|
|
426
|
-
|
|
427
|
-
- Login latency: p95 < 500ms, p99 < 1s
|
|
428
|
-
- Concurrent logins: Support 100 requests/sec
|
|
429
|
-
- Token validation: < 10ms per request
|
|
430
|
-
- Uptime SLA: 99.9% (43 min downtime/month)
|
|
431
|
-
|
|
432
|
-
Why: Performance is a feature, not an afterthought
|
|
433
|
-
|
|
434
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
435
|
-
SUMMARY
|
|
436
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
437
|
-
|
|
438
|
-
â
This specification is GOOD (87/100)
|
|
439
|
-
|
|
440
|
-
Strengths:
|
|
441
|
-
âĸ Clear problem statement and objectives
|
|
442
|
-
âĸ Architecture is sound and scalable
|
|
443
|
-
âĸ Good coverage of functional requirements
|
|
444
|
-
âĸ Strong maintainability score
|
|
445
|
-
|
|
446
|
-
Areas for improvement:
|
|
447
|
-
âĸ Make acceptance criteria more testable (2 items)
|
|
448
|
-
âĸ Address edge cases (rate limiting, errors)
|
|
449
|
-
âĸ Add performance requirements
|
|
450
|
-
|
|
451
|
-
Recommendation: Address HIGH priority suggestions before
|
|
452
|
-
implementation. MEDIUM priority can be added incrementally.
|
|
453
|
-
|
|
454
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
455
|
-
```
|
|
98
|
+
Display: overall score (0-100), per-dimension scores, issues (MAJOR/MINOR), and actionable suggestions.
|
|
456
99
|
|
|
457
100
|
### Step 5: Handle Export Flag
|
|
458
101
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
1. Parse all suggestions from quality assessment
|
|
462
|
-
2. Add to `.specweave/increments/0001-name/tasks.md`
|
|
463
|
-
3. Format as tasks with priority labels
|
|
464
|
-
|
|
465
|
-
**Example tasks.md addition**:
|
|
466
|
-
```markdown
|
|
467
|
-
## Quality Improvement Tasks (from AI assessment)
|
|
468
|
-
|
|
469
|
-
- [ ] **[HIGH]** Make acceptance criteria measurable (spec.md:78)
|
|
470
|
-
Current: "User can log in successfully"
|
|
471
|
-
Improved: "User can log in with valid credentials within 2 seconds, receiving JWT with 24h expiry"
|
|
472
|
-
Estimated: 1h
|
|
473
|
-
|
|
474
|
-
- [ ] **[HIGH]** Specify edge case handling for rate limiting (plan.md:145)
|
|
475
|
-
Add: Rate limiting (5 attempts â 15min lockout), invalid token handling, session expiry flow
|
|
476
|
-
Estimated: 2h
|
|
477
|
-
|
|
478
|
-
- [ ] **[MEDIUM]** Add performance requirements (spec.md:120)
|
|
479
|
-
Add: Login latency (p95 <500ms), concurrent logins (100/sec), token validation (<10ms)
|
|
480
|
-
Estimated: 1h
|
|
481
|
-
```
|
|
482
|
-
|
|
483
|
-
**Display confirmation**:
|
|
484
|
-
```
|
|
485
|
-
â
Exported 3 suggestions to tasks.md
|
|
486
|
-
|
|
487
|
-
Added tasks:
|
|
488
|
-
âĸ Make acceptance criteria measurable (HIGH, 1h)
|
|
489
|
-
âĸ Specify edge case handling (HIGH, 2h)
|
|
490
|
-
âĸ Add performance requirements (MEDIUM, 1h)
|
|
491
|
-
|
|
492
|
-
Total estimated effort: 4 hours
|
|
493
|
-
```
|
|
494
|
-
|
|
495
|
-
### Step 6: Handle Fix Flag (Experimental)
|
|
496
|
-
|
|
497
|
-
**If `--fix` flag provided**:
|
|
498
|
-
|
|
499
|
-
**Warning**: Auto-fix is experimental. Always show diff and ask confirmation.
|
|
500
|
-
|
|
501
|
-
1. **Identify fixable issues**:
|
|
502
|
-
- Only attempt to fix HIGH priority issues
|
|
503
|
-
- Only fix issues with clear, unambiguous improvements
|
|
504
|
-
- Skip issues requiring domain knowledge
|
|
505
|
-
|
|
506
|
-
2. **Generate fixes**:
|
|
507
|
-
- Use Edit tool to apply suggestions
|
|
508
|
-
- Show diff before applying
|
|
509
|
-
|
|
510
|
-
3. **Show diff and ask confirmation**:
|
|
511
|
-
```
|
|
512
|
-
đ§ Auto-Fix Available (2/3 suggestions)
|
|
513
|
-
|
|
514
|
-
Fix 1: Make acceptance criteria measurable
|
|
515
|
-
âââââââââââââââââââââââââââââââââââââââ
|
|
516
|
-
File: spec.md (line 78)
|
|
517
|
-
|
|
518
|
-
- User can log in successfully
|
|
519
|
-
+ User can log in with valid credentials within 2 seconds,
|
|
520
|
-
+ receiving a JWT token with 24h expiry. Success rate >99.9%.
|
|
521
|
-
|
|
522
|
-
âââââââââââââââââââââââââââââââââââââââ
|
|
523
|
-
|
|
524
|
-
Fix 2: Add performance requirements
|
|
525
|
-
âââââââââââââââââââââââââââââââââââââââ
|
|
526
|
-
File: spec.md (line 120)
|
|
527
|
-
|
|
528
|
-
+ ## Performance Requirements
|
|
529
|
-
+
|
|
530
|
-
+ - Login latency: p95 < 500ms, p99 < 1s
|
|
531
|
-
+ - Concurrent logins: Support 100 requests/sec
|
|
532
|
-
+ - Token validation: < 10ms per request
|
|
533
|
-
+ - Uptime SLA: 99.9% (43 min downtime/month)
|
|
534
|
-
|
|
535
|
-
âââââââââââââââââââââââââââââââââââââââ
|
|
536
|
-
|
|
537
|
-
Apply these fixes?
|
|
538
|
-
[Y] Yes, apply all
|
|
539
|
-
[S] Show more details
|
|
540
|
-
[N] No, cancel
|
|
541
|
-
[E] Export to tasks instead
|
|
542
|
-
|
|
543
|
-
Choice: _
|
|
544
|
-
```
|
|
545
|
-
|
|
546
|
-
4. **If user approves**:
|
|
547
|
-
- Apply fixes using Edit tool
|
|
548
|
-
- Re-run validation to confirm improvements
|
|
549
|
-
- Show summary
|
|
550
|
-
|
|
551
|
-
**After applying fixes**:
|
|
552
|
-
```
|
|
553
|
-
â
Applied 2 fixes successfully
|
|
554
|
-
|
|
555
|
-
Changes:
|
|
556
|
-
âĸ spec.md: Made acceptance criteria measurable (+3 lines)
|
|
557
|
-
âĸ spec.md: Added performance requirements section (+8 lines)
|
|
102
|
+
If `--export`: parse suggestions, add to tasks.md as prioritized tasks with `[HIGH]`/`[MEDIUM]` labels and estimates.
|
|
558
103
|
|
|
559
|
-
|
|
104
|
+
### Step 6: Handle Fix Flag
|
|
560
105
|
|
|
561
|
-
|
|
562
|
-
đ AI Quality Score: 92/100 (EXCELLENT) ââ
|
|
106
|
+
If `--fix`: identify HIGH-priority fixable issues, generate diffs, show to user for confirmation, apply if approved, then re-validate.
|
|
563
107
|
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
Remaining issues: 1 (requires manual review)
|
|
567
|
-
```
|
|
108
|
+
Only fix issues with clear unambiguous improvements. Skip domain-specific or ambiguous issues.
|
|
568
109
|
|
|
569
110
|
### Step 7: Handle Always Flag
|
|
570
111
|
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
1. SpecWeave uses auto-detection
|
|
574
|
-
```yaml
|
|
575
|
-
validation:
|
|
576
|
-
quality_judge:
|
|
577
|
-
enabled: true
|
|
578
|
-
always_run: true # â Set to true
|
|
579
|
-
auto_prompt: false # â Disable prompt
|
|
580
|
-
thresholds:
|
|
581
|
-
excellent: 90
|
|
582
|
-
good: 80
|
|
583
|
-
acceptable: 70
|
|
584
|
-
dimensions:
|
|
585
|
-
clarity: true
|
|
586
|
-
testability: true
|
|
587
|
-
completeness: true
|
|
588
|
-
feasibility: true
|
|
589
|
-
maintainability: true
|
|
590
|
-
edge_cases: true
|
|
591
|
-
max_tokens: 2000
|
|
592
|
-
export_to_tasks: false # User can still use --export flag
|
|
593
|
-
```
|
|
594
|
-
|
|
595
|
-
2. **Display confirmation**:
|
|
596
|
-
```
|
|
597
|
-
â
Configuration updated
|
|
598
|
-
|
|
599
|
-
Quality assessment will now run automatically for all future validations.
|
|
600
|
-
|
|
601
|
-
To disable:
|
|
602
|
-
1. Initialize your project
|
|
603
|
-
2. Set validation.quality_judge.always_run: false
|
|
604
|
-
|
|
605
|
-
Or run: /sw:validate-increment <id> (quality will run automatically)
|
|
606
|
-
```
|
|
112
|
+
If `--always`: enable `validation.quality_judge.always_run: true` so future validations auto-run quality assessment.
|
|
607
113
|
|
|
608
114
|
### Step 8: Generate Validation Report
|
|
609
115
|
|
|
610
|
-
|
|
611
|
-
`.specweave/increments/0001-name/reports/validation-report.md`
|
|
612
|
-
|
|
613
|
-
**Report structure**:
|
|
614
|
-
```markdown
|
|
615
|
-
# Validation Report: Increment 0001-authentication
|
|
616
|
-
|
|
617
|
-
Generated: 2025-10-28 14:32:15 UTC
|
|
618
|
-
Command: /sw:validate-increment 001 --quality
|
|
619
|
-
|
|
620
|
-
## Executive Summary
|
|
621
|
-
|
|
622
|
-
**Overall Status**: â
PASSED (with recommendations)
|
|
116
|
+
Save detailed report to: `.specweave/increments/<id>/reports/validation-report.md`
|
|
623
117
|
|
|
624
|
-
|
|
625
|
-
- AI Quality Score: 87/100 (GOOD)
|
|
626
|
-
- Issues Found: 3 (2 major, 1 minor)
|
|
627
|
-
- Suggestions: 3 (2 high, 1 medium priority)
|
|
118
|
+
Report includes: executive summary, rule-based results by category, AI quality scores, issues, suggestions, recommendations, and validation history.
|
|
628
119
|
|
|
629
|
-
##
|
|
120
|
+
## Scoring & Grading
|
|
630
121
|
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
-
|
|
634
|
-
-
|
|
635
|
-
|
|
122
|
+
| Score | Grade |
|
|
123
|
+
|-------|-------|
|
|
124
|
+
| 90-100 | EXCELLENT |
|
|
125
|
+
| 80-89 | GOOD |
|
|
126
|
+
| 70-79 | ACCEPTABLE |
|
|
127
|
+
| <70 | NEEDS WORK |
|
|
636
128
|
|
|
637
|
-
|
|
638
|
-
- spec.md sections: â
|
|
639
|
-
- plan.md sections: â
|
|
640
|
-
- tasks.md structure: â
|
|
641
|
-
|
|
642
|
-
### Quality (31/31) â
|
|
643
|
-
- Technology-agnostic spec: â
|
|
644
|
-
- Testable acceptance criteria: â
|
|
645
|
-
- Actionable tasks: â
|
|
646
|
-
|
|
647
|
-
### Traceability (19/19) â
|
|
648
|
-
- TC-0001 format: â
|
|
649
|
-
- ADR references: â
|
|
650
|
-
- Diagram references: â
|
|
651
|
-
|
|
652
|
-
## AI Quality Assessment
|
|
653
|
-
|
|
654
|
-
### Overall Score: 87/100 (GOOD)
|
|
655
|
-
|
|
656
|
-
### Dimension Scores
|
|
657
|
-
|
|
658
|
-
| Dimension | Score | Grade | Status |
|
|
659
|
-
|-----------|-------|-------|--------|
|
|
660
|
-
| Clarity | 92/100 | ââ | Excellent |
|
|
661
|
-
| Testability | 78/100 | â | Needs improvement |
|
|
662
|
-
| Completeness | 90/100 | ââ | Excellent |
|
|
663
|
-
| Feasibility | 88/100 | ââ | Excellent |
|
|
664
|
-
| Maintainability | 85/100 | â | Good |
|
|
665
|
-
| Edge Cases | 72/100 | â ī¸ | Action needed |
|
|
666
|
-
|
|
667
|
-
### Issues Found
|
|
668
|
-
|
|
669
|
-
#### đ´ MAJOR: Acceptance criteria not fully testable
|
|
670
|
-
- **Dimension**: Testability
|
|
671
|
-
- **Location**: spec.md:78, section "Success Criteria"
|
|
672
|
-
- **Issue**: "User can log in successfully" is vague
|
|
673
|
-
- **Impact**: QA won't know when feature is complete
|
|
674
|
-
- **Recommendation**: Make criteria measurable with specific metrics
|
|
675
|
-
|
|
676
|
-
#### đ´ MAJOR: Rate limiting edge case not addressed
|
|
677
|
-
- **Dimension**: Edge Cases
|
|
678
|
-
- **Location**: plan.md:145, section "Security"
|
|
679
|
-
- **Issue**: No mention of brute-force protection
|
|
680
|
-
- **Impact**: Security vulnerability risk (OWASP A07:2021)
|
|
681
|
-
- **Recommendation**: Add rate limiting (5 attempts â 15min lockout)
|
|
682
|
-
|
|
683
|
-
#### đ¸ MINOR: Performance requirements missing
|
|
684
|
-
- **Dimension**: Completeness
|
|
685
|
-
- **Location**: spec.md:120
|
|
686
|
-
- **Issue**: No latency or throughput targets
|
|
687
|
-
- **Impact**: Hard to measure success objectively
|
|
688
|
-
- **Recommendation**: Add p95 latency, concurrent users, SLA targets
|
|
689
|
-
|
|
690
|
-
### Suggestions
|
|
691
|
-
|
|
692
|
-
[Full suggestions with before/after examples]
|
|
693
|
-
|
|
694
|
-
## Recommendations
|
|
695
|
-
|
|
696
|
-
### Before Implementation
|
|
697
|
-
1. â
Fix 2 major issues (testability, edge cases)
|
|
698
|
-
2. â
Estimated effort: 3-4 hours
|
|
699
|
-
|
|
700
|
-
### During Implementation
|
|
701
|
-
1. Monitor testability of acceptance criteria
|
|
702
|
-
2. Add security tests for rate limiting
|
|
703
|
-
3. Set up performance monitoring
|
|
704
|
-
|
|
705
|
-
### Post-Implementation
|
|
706
|
-
1. Re-validate to confirm improvements
|
|
707
|
-
2. Update documentation with actual performance metrics
|
|
708
|
-
3. Create runbook for handling edge cases
|
|
709
|
-
|
|
710
|
-
## Files Validated
|
|
711
|
-
|
|
712
|
-
- spec.md (250 lines, 6 user stories, 15 requirements)
|
|
713
|
-
- plan.md (480 lines, 8 components, 3 ADRs)
|
|
714
|
-
- tasks.md (42 tasks, estimated 3-4 weeks)
|
|
715
|
-
- tests.md (12 test cases, 85% coverage)
|
|
716
|
-
|
|
717
|
-
## Validation History
|
|
718
|
-
|
|
719
|
-
| Date | Rule-Based | Quality Score | Command |
|
|
720
|
-
|------|------------|---------------|---------|
|
|
721
|
-
| 2025-10-28 | 120/120 | 87/100 | /sw:validate-increment 001 --quality |
|
|
722
|
-
| 2025-10-25 | 115/120 | N/A | Auto-validation on save |
|
|
723
|
-
| 2025-10-24 | 110/120 | N/A | Auto-validation on save |
|
|
724
|
-
|
|
725
|
-
---
|
|
726
|
-
|
|
727
|
-
Generated by SpecWeave validation system
|
|
728
|
-
For details: .specweave/docs/internal/delivery/guides/increment-validation.md
|
|
729
|
-
```
|
|
730
|
-
|
|
731
|
-
**Notify user**:
|
|
732
|
-
```
|
|
733
|
-
đ Full validation report saved:
|
|
734
|
-
.specweave/increments/0001-authentication/reports/validation-report.md
|
|
735
|
-
```
|
|
736
|
-
|
|
737
|
-
## Examples
|
|
738
|
-
|
|
739
|
-
### Example 1: Basic Validation (Rule-Based Only)
|
|
740
|
-
|
|
741
|
-
```bash
|
|
742
|
-
/sw:validate 001
|
|
743
|
-
```
|
|
744
|
-
|
|
745
|
-
**Output**:
|
|
746
|
-
```
|
|
747
|
-
â
Rule-Based Validation: PASSED (120/120 checks)
|
|
748
|
-
|
|
749
|
-
đ¤ Run AI Quality Assessment? [Y/n]: _
|
|
750
|
-
```
|
|
751
|
-
|
|
752
|
-
### Example 2: Validation with Quality Assessment
|
|
753
|
-
|
|
754
|
-
```bash
|
|
755
|
-
/sw:validate 001 --quality
|
|
756
|
-
```
|
|
757
|
-
|
|
758
|
-
**Output**:
|
|
759
|
-
```
|
|
760
|
-
â
Rule-Based: 120/120
|
|
761
|
-
đ AI Quality: 87/100 (GOOD)
|
|
762
|
-
|
|
763
|
-
Issues: 2 major, 1 minor
|
|
764
|
-
Suggestions: 3 (2 high, 1 medium)
|
|
765
|
-
|
|
766
|
-
đ Full report: .specweave/increments/0001-auth/reports/validation-report.md
|
|
767
|
-
```
|
|
768
|
-
|
|
769
|
-
### Example 3: Validate and Export Suggestions
|
|
770
|
-
|
|
771
|
-
```bash
|
|
772
|
-
/sw:validate 001 --quality --export
|
|
773
|
-
```
|
|
774
|
-
|
|
775
|
-
**Output**:
|
|
776
|
-
```
|
|
777
|
-
â
Rule-Based: 120/120
|
|
778
|
-
đ AI Quality: 87/100
|
|
779
|
-
|
|
780
|
-
â
Exported 3 suggestions to tasks.md
|
|
781
|
-
âĸ Make acceptance criteria measurable (HIGH)
|
|
782
|
-
âĸ Specify edge case handling (HIGH)
|
|
783
|
-
âĸ Add performance requirements (MEDIUM)
|
|
784
|
-
```
|
|
785
|
-
|
|
786
|
-
### Example 4: Auto-Fix Issues
|
|
787
|
-
|
|
788
|
-
```bash
|
|
789
|
-
/sw:validate 001 --quality --fix
|
|
790
|
-
```
|
|
791
|
-
|
|
792
|
-
**Output**:
|
|
793
|
-
```
|
|
794
|
-
â
Rule-Based: 120/120
|
|
795
|
-
đ AI Quality: 87/100
|
|
796
|
-
|
|
797
|
-
đ§ Auto-fix available for 2/3 issues
|
|
798
|
-
|
|
799
|
-
[Shows diff]
|
|
800
|
-
|
|
801
|
-
Apply fixes? [Y/s/n/e]: Y
|
|
802
|
-
|
|
803
|
-
â
Applied 2 fixes
|
|
804
|
-
Re-validated: 92/100 (improvement: +5)
|
|
805
|
-
```
|
|
806
|
-
|
|
807
|
-
### Example 5: Make Quality Assessment Default
|
|
808
|
-
|
|
809
|
-
```bash
|
|
810
|
-
/sw:validate 001 --always
|
|
811
|
-
```
|
|
812
|
-
|
|
813
|
-
**Output**:
|
|
814
|
-
```
|
|
815
|
-
â
Rule-Based: 120/120
|
|
816
|
-
đ AI Quality: 87/100
|
|
817
|
-
|
|
818
|
-
â
Configuration updated
|
|
819
|
-
Quality assessment will run automatically for future validations.
|
|
820
|
-
```
|
|
821
|
-
|
|
822
|
-
## Error Handling
|
|
823
|
-
|
|
824
|
-
### Increment Not Found
|
|
825
|
-
```
|
|
826
|
-
â Error: Increment 0001 not found
|
|
827
|
-
|
|
828
|
-
Available increments:
|
|
829
|
-
âĸ 0002-core-enhancements
|
|
830
|
-
âĸ 0003-payment-processing
|
|
831
|
-
|
|
832
|
-
Usage: /sw:validate-increment <id> [--quality] [--export] [--fix] [--always]
|
|
833
|
-
```
|
|
834
|
-
|
|
835
|
-
### Invalid Flags
|
|
836
|
-
```
|
|
837
|
-
â Error: Invalid flag '--qualitty'
|
|
838
|
-
|
|
839
|
-
Valid flags:
|
|
840
|
-
--quality Run AI quality assessment
|
|
841
|
-
--export Export suggestions to tasks.md
|
|
842
|
-
--fix Auto-fix issues (experimental)
|
|
843
|
-
--always Make quality assessment default
|
|
844
|
-
|
|
845
|
-
Usage: /sw:validate-increment <id> [--quality] [--export] [--fix] [--always]
|
|
846
|
-
```
|
|
847
|
-
|
|
848
|
-
### Quality Assessment Failed
|
|
849
|
-
```
|
|
850
|
-
â ī¸ Warning: AI quality assessment failed (API error)
|
|
851
|
-
|
|
852
|
-
â
Rule-based validation completed successfully (120/120)
|
|
853
|
-
|
|
854
|
-
You can:
|
|
855
|
-
1. Try again: /sw:validate-increment 001 --quality
|
|
856
|
-
2. Continue with rule-based results
|
|
857
|
-
3. Check logs: .specweave/increments/0001-name/logs/validation.log
|
|
858
|
-
```
|
|
859
|
-
|
|
860
|
-
### No Fixable Issues
|
|
861
|
-
```
|
|
862
|
-
âšī¸ No auto-fixable issues found
|
|
863
|
-
|
|
864
|
-
All issues require manual review:
|
|
865
|
-
âĸ Architectural decision (requires ADR)
|
|
866
|
-
âĸ Domain-specific requirement (requires expertise)
|
|
867
|
-
âĸ Ambiguous context (requires clarification)
|
|
868
|
-
|
|
869
|
-
Export suggestions to tasks? [Y/n]: _
|
|
870
|
-
```
|
|
871
|
-
|
|
872
|
-
## Integration with Hooks
|
|
873
|
-
|
|
874
|
-
This command can be triggered by:
|
|
875
|
-
|
|
876
|
-
1. **Manual execution**: `/sw:validate 001 --quality`
|
|
877
|
-
2. **Post-document-save hook**: Auto-runs rule-based validation
|
|
878
|
-
3. **Pre-implementation hook**: Validates before starting tasks
|
|
879
|
-
4. **CI/CD pipeline**: Automated validation in GitHub Actions
|
|
880
|
-
|
|
881
|
-
**Hook integration** (`.claude/hooks/post-document-save.sh`):
|
|
882
|
-
```bash
|
|
883
|
-
#!/bin/bash
|
|
884
|
-
# Auto-validate on save
|
|
885
|
-
|
|
886
|
-
if [[ "$FILE" =~ spec\.md|plan\.md|tasks\.md|tests\.md ]]; then
|
|
887
|
-
# Extract increment ID from path
|
|
888
|
-
INCREMENT_ID=$(echo "$FILE" | grep -oP '(?<=increments/)\d{4}')
|
|
889
|
-
|
|
890
|
-
# Run validation (rule-based only, no quality unless config says so)
|
|
891
|
-
/sw:validate-increment "$INCREMENT_ID"
|
|
892
|
-
fi
|
|
893
|
-
```
|
|
894
|
-
|
|
895
|
-
## Configuration
|
|
896
|
-
|
|
897
|
-
All validation settings use sensible defaults. Quality assessment is prompted each time unless `--quality` flag is used.
|
|
898
|
-
|
|
899
|
-
## Related Commands
|
|
900
|
-
|
|
901
|
-
- `/create-increment`: Create new increment (auto-validates on creation)
|
|
902
|
-
- `/sw:sync-docs`: Review strategic documentation before implementation
|
|
903
|
-
- `/close-increment`: Close increment (validates before closing)
|
|
904
|
-
- `/sync-github`: Sync to GitHub (validates before sync)
|
|
905
|
-
|
|
906
|
-
## Related Skills
|
|
907
|
-
|
|
908
|
-
- `increment-quality-judge`: AI-powered quality assessment
|
|
909
|
-
- `increment-validator`: Rule-based validation (120 checks)
|
|
910
|
-
- `increment-planner`: Creates increments with validation built-in
|
|
911
|
-
|
|
912
|
-
---
|
|
129
|
+
**Pass/fail gate**: Rule-based must pass all CRITICAL checks. Quality score is advisory (no hard gate).
|
|
913
130
|
|
|
914
|
-
|
|
915
|
-
- "Validate quality of increment 001" (intent-based)
|
|
916
|
-
- `/sw:validate 001 --quality` (slash command)
|
|
131
|
+
## Related
|
|
917
132
|
|
|
918
|
-
|
|
133
|
+
- `increment-quality-judge` skill: AI assessment engine
|
|
134
|
+
- `/sw:done`: validates before closing
|
|
135
|
+
- `specweave qa <id>`: CLI equivalent
|