specweave 0.17.16 → 0.18.0
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 +405 -2495
- package/README.md +92 -2
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts.map +1 -1
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js +188 -36
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js.map +1 -1
- package/dist/plugins/specweave-ado/lib/ado-status-sync.d.ts +54 -0
- package/dist/plugins/specweave-ado/lib/ado-status-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-status-sync.js +86 -0
- package/dist/plugins/specweave-ado/lib/ado-status-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.d.ts +139 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.js +389 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.js.map +1 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts +26 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.js +249 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-client.d.ts +1 -1
- package/dist/plugins/specweave-github/lib/github-client.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-client.js +25 -13
- package/dist/plugins/specweave-github/lib/github-client.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-epic-sync.d.ts +83 -0
- package/dist/plugins/specweave-github/lib/github-epic-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-epic-sync.js +451 -0
- package/dist/plugins/specweave-github/lib/github-epic-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.d.ts +43 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.js +82 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/task-sync.d.ts +5 -0
- package/dist/plugins/specweave-github/lib/task-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/task-sync.js +38 -2
- package/dist/plugins/specweave-github/lib/task-sync.js.map +1 -1
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.d.ts +66 -0
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.js +274 -0
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.d.ts +56 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.js +93 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.js +48 -3
- package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
- package/dist/src/core/living-docs/hierarchy-mapper.d.ts +142 -0
- package/dist/src/core/living-docs/hierarchy-mapper.d.ts.map +1 -0
- package/dist/src/core/living-docs/hierarchy-mapper.js +453 -0
- package/dist/src/core/living-docs/hierarchy-mapper.js.map +1 -0
- package/dist/src/core/living-docs/index.d.ts +10 -84
- package/dist/src/core/living-docs/index.d.ts.map +1 -1
- package/dist/src/core/living-docs/index.js +10 -164
- package/dist/src/core/living-docs/index.js.map +1 -1
- package/dist/src/core/living-docs/spec-distributor.d.ts +106 -0
- package/dist/src/core/living-docs/spec-distributor.d.ts.map +1 -0
- package/dist/src/core/living-docs/spec-distributor.js +823 -0
- package/dist/src/core/living-docs/spec-distributor.js.map +1 -0
- package/dist/src/core/living-docs/types.d.ts +201 -0
- package/dist/src/core/living-docs/types.d.ts.map +1 -0
- package/dist/src/core/living-docs/types.js +15 -0
- package/dist/src/core/living-docs/types.js.map +1 -0
- package/dist/src/core/logging/prompt-logger.d.ts +70 -0
- package/dist/src/core/logging/prompt-logger.d.ts.map +1 -0
- package/dist/src/core/logging/prompt-logger.js +247 -0
- package/dist/src/core/logging/prompt-logger.js.map +1 -0
- package/dist/src/core/status-line/status-line-manager.d.ts +15 -24
- package/dist/src/core/status-line/status-line-manager.d.ts.map +1 -1
- package/dist/src/core/status-line/status-line-manager.js +33 -70
- package/dist/src/core/status-line/status-line-manager.js.map +1 -1
- package/dist/src/core/status-line/types.d.ts +19 -31
- package/dist/src/core/status-line/types.d.ts.map +1 -1
- package/dist/src/core/status-line/types.js +5 -9
- package/dist/src/core/status-line/types.js.map +1 -1
- package/dist/src/core/sync/conflict-resolver.d.ts +66 -0
- package/dist/src/core/sync/conflict-resolver.d.ts.map +1 -0
- package/dist/src/core/sync/conflict-resolver.js +108 -0
- package/dist/src/core/sync/conflict-resolver.js.map +1 -0
- package/dist/src/core/sync/enhanced-content-builder.d.ts +77 -0
- package/dist/src/core/sync/enhanced-content-builder.d.ts.map +1 -0
- package/dist/src/core/sync/enhanced-content-builder.js +199 -0
- package/dist/src/core/sync/enhanced-content-builder.js.map +1 -0
- package/dist/src/core/sync/label-detector.d.ts +66 -0
- package/dist/src/core/sync/label-detector.d.ts.map +1 -0
- package/dist/src/core/sync/label-detector.js +211 -0
- package/dist/src/core/sync/label-detector.js.map +1 -0
- package/dist/src/core/sync/retry-logic.d.ts +64 -0
- package/dist/src/core/sync/retry-logic.d.ts.map +1 -0
- package/dist/src/core/sync/retry-logic.js +165 -0
- package/dist/src/core/sync/retry-logic.js.map +1 -0
- package/dist/src/core/sync/spec-increment-mapper.d.ts +100 -0
- package/dist/src/core/sync/spec-increment-mapper.d.ts.map +1 -0
- package/dist/src/core/sync/spec-increment-mapper.js +424 -0
- package/dist/src/core/sync/spec-increment-mapper.js.map +1 -0
- package/dist/src/core/sync/status-cache.d.ts +91 -0
- package/dist/src/core/sync/status-cache.d.ts.map +1 -0
- package/dist/src/core/sync/status-cache.js +140 -0
- package/dist/src/core/sync/status-cache.js.map +1 -0
- package/dist/src/core/sync/status-mapper.d.ts +69 -0
- package/dist/src/core/sync/status-mapper.d.ts.map +1 -0
- package/dist/src/core/sync/status-mapper.js +90 -0
- package/dist/src/core/sync/status-mapper.js.map +1 -0
- package/dist/src/core/sync/status-sync-engine.d.ts +162 -0
- package/dist/src/core/sync/status-sync-engine.d.ts.map +1 -0
- package/dist/src/core/sync/status-sync-engine.js +347 -0
- package/dist/src/core/sync/status-sync-engine.js.map +1 -0
- package/dist/src/core/sync/sync-event-logger.d.ts +99 -0
- package/dist/src/core/sync/sync-event-logger.d.ts.map +1 -0
- package/dist/src/core/sync/sync-event-logger.js +103 -0
- package/dist/src/core/sync/sync-event-logger.js.map +1 -0
- package/dist/src/core/sync/workflow-detector.d.ts +95 -0
- package/dist/src/core/sync/workflow-detector.d.ts.map +1 -0
- package/dist/src/core/sync/workflow-detector.js +175 -0
- package/dist/src/core/sync/workflow-detector.js.map +1 -0
- package/dist/src/core/types/config.d.ts.map +1 -1
- package/dist/src/core/types/config.js +31 -0
- package/dist/src/core/types/config.js.map +1 -1
- package/dist/src/utils/github-url.d.ts +53 -0
- package/dist/src/utils/github-url.d.ts.map +1 -0
- package/dist/src/utils/github-url.js +90 -0
- package/dist/src/utils/github-url.js.map +1 -0
- package/dist/src/utils/spec-parser.d.ts +145 -0
- package/dist/src/utils/spec-parser.d.ts.map +1 -0
- package/dist/src/utils/spec-parser.js +640 -0
- package/dist/src/utils/spec-parser.js.map +1 -0
- package/package.json +1 -1
- package/plugins/specweave/agents/pm/AGENT.md +1 -1
- package/plugins/specweave/agents/pm/templates/increment-spec.md +158 -0
- package/plugins/specweave/agents/pm/templates/living-docs-spec.md +113 -0
- package/plugins/specweave/commands/specweave-done.md +163 -0
- package/plugins/specweave/hooks/lib/update-status-line.sh +79 -111
- package/plugins/specweave/hooks/post-increment-planning.sh +107 -35
- package/plugins/specweave/lib/hooks/sync-living-docs.js +139 -34
- package/plugins/specweave/lib/hooks/sync-living-docs.ts +234 -38
- package/plugins/specweave/skills/SKILLS-INDEX.md +4 -24
- package/plugins/specweave/skills/increment-planner/SKILL.md +94 -0
- package/plugins/specweave/skills/increment-work-router/SKILL.md +466 -0
- package/plugins/specweave-ado/lib/ado-status-sync.js +80 -0
- package/plugins/specweave-ado/lib/ado-status-sync.ts +121 -0
- package/plugins/specweave-github/commands/specweave-github-cleanup-duplicates.md +205 -0
- package/plugins/specweave-github/commands/specweave-github-sync-epic.md +248 -0
- package/plugins/specweave-github/lib/duplicate-detector.js +370 -0
- package/plugins/specweave-github/lib/duplicate-detector.ts +525 -0
- package/plugins/specweave-github/lib/enhanced-github-sync.js +220 -0
- package/plugins/specweave-github/lib/enhanced-github-sync.ts +322 -0
- package/plugins/specweave-github/lib/github-client.js +21 -10
- package/plugins/specweave-github/lib/github-client.ts +27 -16
- package/plugins/specweave-github/lib/github-epic-sync.js +489 -0
- package/plugins/specweave-github/lib/github-epic-sync.ts +690 -0
- package/plugins/specweave-github/lib/github-status-sync.js +71 -0
- package/plugins/specweave-github/lib/github-status-sync.ts +107 -0
- package/plugins/specweave-github/lib/task-sync.js +33 -2
- package/plugins/specweave-github/lib/task-sync.ts +44 -2
- package/plugins/specweave-jira/commands/specweave-jira-sync-epic.md +267 -0
- package/plugins/specweave-jira/lib/enhanced-jira-sync.ts.disabled +222 -0
- package/plugins/specweave-jira/lib/jira-epic-sync.js +304 -0
- package/plugins/specweave-jira/lib/jira-epic-sync.ts +459 -0
- package/plugins/specweave-jira/lib/jira-status-sync.js +79 -0
- package/plugins/specweave-jira/lib/jira-status-sync.ts +139 -0
- package/src/templates/AGENTS.md.template +88 -1
- package/src/templates/CLAUDE.md.template +49 -0
- package/plugins/specweave/skills/increment-quality-judge/SKILL.md +0 -524
- package/plugins/specweave/skills/plugin-installer/SKILL.md +0 -353
|
@@ -17,6 +17,37 @@ This is a **SpecWeave project** where specifications and documentation are the s
|
|
|
17
17
|
- **Context Manifests**: Load only relevant files (70%+ token reduction)
|
|
18
18
|
- **Living Documentation**: Specs evolve with code, never diverge
|
|
19
19
|
- **Role-Based Development**: PM defines requirements, Architect designs, DevOps deploys
|
|
20
|
+
- **Bidirectional Linking**: Tasks automatically link to user stories (and vice versa)
|
|
21
|
+
|
|
22
|
+
### Bidirectional Task ↔ User Story Linking
|
|
23
|
+
|
|
24
|
+
**AUTOMATIC FEATURE**: When increment completes (`/specweave:done`), SpecWeave creates bidirectional links.
|
|
25
|
+
|
|
26
|
+
**How It Works**:
|
|
27
|
+
1. User stories extracted to `.specweave/docs/internal/specs/{project}/`
|
|
28
|
+
2. Tasks.md automatically updated with links back to user stories
|
|
29
|
+
3. Complete bidirectional navigation created!
|
|
30
|
+
|
|
31
|
+
**Requirements**:
|
|
32
|
+
- Tasks MUST have **AC**: field with AC-IDs (e.g., `AC-US1-01, AC-US1-02`)
|
|
33
|
+
- AC-IDs map to user stories: `AC-US1-01` → `US-001`
|
|
34
|
+
|
|
35
|
+
**Example Task** (WITH bidirectional link):
|
|
36
|
+
```markdown
|
|
37
|
+
### T-001: Implement User Login
|
|
38
|
+
|
|
39
|
+
**User Story**: [US-001: User Authentication](../../docs/internal/specs/default/auth-service/us-001-user-authentication.md)
|
|
40
|
+
|
|
41
|
+
**AC**: AC-US1-01, AC-US1-02, AC-US1-03
|
|
42
|
+
|
|
43
|
+
**Test Plan** (BDD):
|
|
44
|
+
- **Given** valid credentials → **When** login → **Then** receive JWT token
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Benefits**:
|
|
48
|
+
- ✅ Navigate both directions (Tasks → User Stories → Tasks)
|
|
49
|
+
- ✅ Automatic (no manual linking)
|
|
50
|
+
- ✅ Multi-project aware (works with backend, frontend, mobile, etc.)
|
|
20
51
|
|
|
21
52
|
---
|
|
22
53
|
|
|
@@ -490,10 +521,66 @@ When you complete a task (mark todo as done), the hook:
|
|
|
490
521
|
# After completing a task, run these three commands:
|
|
491
522
|
|
|
492
523
|
/specweave:sync-tasks # 1. Update tasks.md completion status
|
|
493
|
-
/specweave:sync-docs update # 2. Sync to living docs
|
|
524
|
+
/specweave:sync-docs update # 2. Sync to living docs (THIS IS CRITICAL!)
|
|
494
525
|
/specweave-github:sync <increment-id> # 3. Sync to GitHub (replace <increment-id> with your increment, e.g., 0007)
|
|
495
526
|
```
|
|
496
527
|
|
|
528
|
+
**🔥 CRITICAL: Living Docs Sync (`/specweave:sync-docs`)**
|
|
529
|
+
|
|
530
|
+
The `/specweave:sync-docs` command is one of the MOST IMPORTANT commands in SpecWeave. It ensures your increment work gets properly archived in the living documentation.
|
|
531
|
+
|
|
532
|
+
**How to call it** (for non-Claude tools):
|
|
533
|
+
|
|
534
|
+
```bash
|
|
535
|
+
# Read the command file
|
|
536
|
+
cat plugins/specweave/commands/specweave-sync-docs.md
|
|
537
|
+
|
|
538
|
+
# Then execute the workflow described in that file
|
|
539
|
+
# The command will:
|
|
540
|
+
# 1. Extract user stories from spec.md
|
|
541
|
+
# 2. Distribute them to .specweave/docs/internal/specs/{project}/
|
|
542
|
+
# 3. Create bidirectional links (Tasks ↔ User Stories)
|
|
543
|
+
# 4. Update epic folders (FS-*) with latest content
|
|
544
|
+
# 5. Generate proper Docusaurus frontmatter
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
**When to run it**:
|
|
548
|
+
- ✅ After completing an increment (`/specweave:done`)
|
|
549
|
+
- ✅ After making significant spec changes
|
|
550
|
+
- ✅ After implementing multiple user stories
|
|
551
|
+
- ✅ Before creating a PR/merge request
|
|
552
|
+
- ❌ NOT after every single task (too frequent)
|
|
553
|
+
|
|
554
|
+
**Two modes**:
|
|
555
|
+
- `review` mode: Review strategic docs BEFORE implementation starts
|
|
556
|
+
- `update` mode: Sync living docs AFTER implementation completes
|
|
557
|
+
|
|
558
|
+
**Example workflow**:
|
|
559
|
+
|
|
560
|
+
```bash
|
|
561
|
+
# Complete increment
|
|
562
|
+
/specweave:done 0031
|
|
563
|
+
|
|
564
|
+
# Sync to living docs (MANDATORY!)
|
|
565
|
+
/specweave:sync-docs update 0031
|
|
566
|
+
|
|
567
|
+
# Result: All user stories from increment 0031 are now in:
|
|
568
|
+
# .specweave/docs/internal/specs/{project}/FS-031-feature-name/
|
|
569
|
+
# ├── README.md (epic overview)
|
|
570
|
+
# ├── us-001-story-title.md (user story)
|
|
571
|
+
# ├── us-002-story-title.md
|
|
572
|
+
# └── ... (all user stories)
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
**Why this matters**:
|
|
576
|
+
- ✅ Permanent archive of all user stories (never lost)
|
|
577
|
+
- ✅ Bidirectional links created automatically
|
|
578
|
+
- ✅ Epic folders organized hierarchically
|
|
579
|
+
- ✅ Docusaurus-ready frontmatter generated
|
|
580
|
+
- ✅ Complete traceability (increment → living docs)
|
|
581
|
+
|
|
582
|
+
Without running this command, your increment work stays isolated in the increment folder and NEVER makes it to the permanent living documentation!
|
|
583
|
+
|
|
497
584
|
**Alternative: Manual Update** (if slash commands unavailable):
|
|
498
585
|
|
|
499
586
|
```bash
|
|
@@ -265,6 +265,55 @@ project-root/
|
|
|
265
265
|
|
|
266
266
|
---
|
|
267
267
|
|
|
268
|
+
## 🔗 Bidirectional Task ↔ User Story Linking
|
|
269
|
+
|
|
270
|
+
**AUTOMATIC FEATURE**: SpecWeave creates bidirectional links between tasks and user stories.
|
|
271
|
+
|
|
272
|
+
### How It Works
|
|
273
|
+
|
|
274
|
+
**When you complete an increment** (`/specweave:done`):
|
|
275
|
+
1. User stories are extracted to `.specweave/docs/internal/specs/default/`
|
|
276
|
+
2. Tasks.md is automatically updated with links back to user stories
|
|
277
|
+
3. Complete bidirectional navigation is created!
|
|
278
|
+
|
|
279
|
+
**Example Task** (WITH bidirectional link):
|
|
280
|
+
```markdown
|
|
281
|
+
### T-001: Implement User Login
|
|
282
|
+
|
|
283
|
+
**User Story**: [US-001: User Authentication](../../docs/internal/specs/default/auth-service/us-001-user-authentication.md)
|
|
284
|
+
|
|
285
|
+
**AC**: AC-US1-01, AC-US1-02, AC-US1-03
|
|
286
|
+
|
|
287
|
+
**Test Plan** (BDD):
|
|
288
|
+
- **Given** valid credentials → **When** login → **Then** receive JWT token
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Requirements
|
|
292
|
+
|
|
293
|
+
**Your tasks.md MUST have AC-IDs** for bidirectional linking:
|
|
294
|
+
|
|
295
|
+
```markdown
|
|
296
|
+
## T-001: Implement User Login
|
|
297
|
+
|
|
298
|
+
**AC**: AC-US1-01, AC-US1-02, AC-US1-03 ← CRITICAL for linking!
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**AC-ID Format**: `AC-US{number}-{criteria}` (e.g., `AC-US1-01`, `AC-US2-03`)
|
|
302
|
+
- Maps to user stories: `AC-US1-01` → `US-001`
|
|
303
|
+
- Multiple AC-IDs allowed per task
|
|
304
|
+
- Task links to FIRST user story found
|
|
305
|
+
|
|
306
|
+
### Benefits
|
|
307
|
+
|
|
308
|
+
- ✅ **Navigate both directions**: Tasks → User Stories → Tasks
|
|
309
|
+
- ✅ **Automatic**: No manual linking needed
|
|
310
|
+
- ✅ **Multi-project aware**: Works with backend, frontend, mobile, etc.
|
|
311
|
+
- ✅ **Always in sync**: Links created during `/specweave:done`
|
|
312
|
+
|
|
313
|
+
**For complete details**: Ask me about "bidirectional linking" or check `.specweave/docs/internal/specs/default/README.md`
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
268
317
|
## Tech Stack
|
|
269
318
|
|
|
270
319
|
**Project Type**: {MONOREPO_OR_SINGLE}
|
|
@@ -1,524 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: increment-quality-judge
|
|
3
|
-
description: Optional AI-powered quality assessment for specifications, plans, and tests. Goes beyond rule-based validation to evaluate clarity, testability, edge cases, and architecture soundness. Activates for validate quality, quality check, assess spec, evaluate increment, spec review, quality score.
|
|
4
|
-
allowed-tools: Read, Grep, Glob
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Increment Quality Judge
|
|
8
|
-
|
|
9
|
-
AI-powered quality assessment that evaluates specifications, plans, and tests beyond rule-based validation using LLM-as-Judge pattern.
|
|
10
|
-
|
|
11
|
-
## Purpose
|
|
12
|
-
|
|
13
|
-
Provide nuanced quality assessment of SpecWeave artifacts (spec.md, plan.md, tests.md) to catch subtle issues that rule-based validation might miss.
|
|
14
|
-
|
|
15
|
-
## When to Use
|
|
16
|
-
|
|
17
|
-
**Activates when user mentions:**
|
|
18
|
-
- "validate quality"
|
|
19
|
-
- "quality check"
|
|
20
|
-
- "assess spec"
|
|
21
|
-
- "evaluate increment"
|
|
22
|
-
- "spec review"
|
|
23
|
-
- "quality score"
|
|
24
|
-
- "how good is this spec"
|
|
25
|
-
|
|
26
|
-
**Triggered by:**
|
|
27
|
-
- Natural language: "validate quality of increment 0001", "quality check", "assess spec"
|
|
28
|
-
- Slash command: `/specweave:validate 0001 --quality` (supports --export, --fix, --always flags)
|
|
29
|
-
- Manual invocation when reviewing docs
|
|
30
|
-
|
|
31
|
-
## What It Does
|
|
32
|
-
|
|
33
|
-
### 1. Multi-Dimensional Quality Assessment
|
|
34
|
-
|
|
35
|
-
Evaluates specifications across 6 dimensions:
|
|
36
|
-
|
|
37
|
-
```yaml
|
|
38
|
-
dimensions:
|
|
39
|
-
clarity:
|
|
40
|
-
weight: 0.20
|
|
41
|
-
criteria:
|
|
42
|
-
- "Is the problem statement clear?"
|
|
43
|
-
- "Are objectives well-defined?"
|
|
44
|
-
- "Is terminology consistent?"
|
|
45
|
-
|
|
46
|
-
testability:
|
|
47
|
-
weight: 0.25
|
|
48
|
-
criteria:
|
|
49
|
-
- "Are acceptance criteria testable?"
|
|
50
|
-
- "Can success be measured objectively?"
|
|
51
|
-
- "Are edge cases identifiable?"
|
|
52
|
-
|
|
53
|
-
completeness:
|
|
54
|
-
weight: 0.20
|
|
55
|
-
criteria:
|
|
56
|
-
- "Are all requirements addressed?"
|
|
57
|
-
- "Is error handling specified?"
|
|
58
|
-
- "Are non-functional requirements included?"
|
|
59
|
-
|
|
60
|
-
feasibility:
|
|
61
|
-
weight: 0.15
|
|
62
|
-
criteria:
|
|
63
|
-
- "Is the architecture scalable?"
|
|
64
|
-
- "Are technical constraints realistic?"
|
|
65
|
-
- "Is timeline achievable?"
|
|
66
|
-
|
|
67
|
-
maintainability:
|
|
68
|
-
weight: 0.10
|
|
69
|
-
criteria:
|
|
70
|
-
- "Is design modular?"
|
|
71
|
-
- "Are extension points identified?"
|
|
72
|
-
- "Is technical debt addressed?"
|
|
73
|
-
|
|
74
|
-
edge_cases:
|
|
75
|
-
weight: 0.10
|
|
76
|
-
criteria:
|
|
77
|
-
- "Are failure scenarios covered?"
|
|
78
|
-
- "Are performance limits specified?"
|
|
79
|
-
- "Are security considerations included?"
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### 2. Scoring System
|
|
83
|
-
|
|
84
|
-
```typescript
|
|
85
|
-
interface QualityScore {
|
|
86
|
-
overall: number; // 0.00-1.00 (displayed as 0-100)
|
|
87
|
-
dimensions: {
|
|
88
|
-
clarity: number;
|
|
89
|
-
testability: number;
|
|
90
|
-
completeness: number;
|
|
91
|
-
feasibility: number;
|
|
92
|
-
maintainability: number;
|
|
93
|
-
edge_cases: number;
|
|
94
|
-
};
|
|
95
|
-
issues: Issue[];
|
|
96
|
-
suggestions: Suggestion[];
|
|
97
|
-
confidence: number; // 0.00-1.00 (how confident the assessment is)
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
interface Issue {
|
|
101
|
-
dimension: string;
|
|
102
|
-
severity: 'critical' | 'major' | 'minor';
|
|
103
|
-
description: string;
|
|
104
|
-
location: string; // Section reference
|
|
105
|
-
impact: string; // What could go wrong
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
interface Suggestion {
|
|
109
|
-
dimension: string;
|
|
110
|
-
priority: 'high' | 'medium' | 'low';
|
|
111
|
-
description: string;
|
|
112
|
-
example: string; // How to improve
|
|
113
|
-
}
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### 3. Interactive Workflow
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
/specweave:validate 001
|
|
120
|
-
|
|
121
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
122
|
-
VALIDATION RESULTS: Increment 0001-authentication
|
|
123
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
124
|
-
|
|
125
|
-
✅ Rule-Based Validation: PASSED (120/120 checks)
|
|
126
|
-
✓ Consistency (47/47)
|
|
127
|
-
✓ Completeness (23/23)
|
|
128
|
-
✓ Quality (31/31)
|
|
129
|
-
✓ Traceability (19/19)
|
|
130
|
-
|
|
131
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
132
|
-
|
|
133
|
-
🤔 Run AI Quality Assessment? (Optional)
|
|
134
|
-
|
|
135
|
-
This will:
|
|
136
|
-
• Evaluate spec clarity, testability, edge cases
|
|
137
|
-
• Provide detailed improvement suggestions
|
|
138
|
-
• Use ~2,000 tokens (1-2 minutes)
|
|
139
|
-
|
|
140
|
-
Your choice:
|
|
141
|
-
[Y] Yes, assess quality
|
|
142
|
-
[N] No, skip (default)
|
|
143
|
-
[A] Always run (save to config)
|
|
144
|
-
|
|
145
|
-
Choice: _
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
**If user selects Yes:**
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
🔍 Analyzing increment quality...
|
|
152
|
-
|
|
153
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
154
|
-
AI QUALITY ASSESSMENT
|
|
155
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
156
|
-
|
|
157
|
-
Overall Score: 87/100 (GOOD) ✓
|
|
158
|
-
|
|
159
|
-
Dimension Scores:
|
|
160
|
-
Clarity: 92/100 ✓✓
|
|
161
|
-
Testability: 78/100 ✓ (Needs improvement)
|
|
162
|
-
Completeness: 90/100 ✓✓
|
|
163
|
-
Feasibility: 88/100 ✓✓
|
|
164
|
-
Maintainability: 85/100 ✓
|
|
165
|
-
Edge Cases: 72/100 ⚠️ (Action needed)
|
|
166
|
-
|
|
167
|
-
Confidence: 92%
|
|
168
|
-
|
|
169
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
170
|
-
ISSUES FOUND (2)
|
|
171
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
172
|
-
|
|
173
|
-
⚠️ MAJOR: Acceptance criteria not fully testable
|
|
174
|
-
Dimension: Testability
|
|
175
|
-
Location: spec.md, section "Success Criteria"
|
|
176
|
-
Issue: "User can log in successfully" is vague
|
|
177
|
-
Impact: QA won't know when feature is complete
|
|
178
|
-
|
|
179
|
-
🔸 MINOR: Rate limiting edge case not addressed
|
|
180
|
-
Dimension: Edge Cases
|
|
181
|
-
Location: spec.md, section "Security"
|
|
182
|
-
Issue: No mention of brute-force protection
|
|
183
|
-
Impact: Security vulnerability risk
|
|
184
|
-
|
|
185
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
186
|
-
SUGGESTIONS (3)
|
|
187
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
188
|
-
|
|
189
|
-
🎯 HIGH PRIORITY: Make acceptance criteria measurable
|
|
190
|
-
|
|
191
|
-
Current:
|
|
192
|
-
"User can log in successfully"
|
|
193
|
-
|
|
194
|
-
Improved:
|
|
195
|
-
"User can log in with valid credentials within 2 seconds,
|
|
196
|
-
receiving a JWT token with 24h expiry"
|
|
197
|
-
|
|
198
|
-
🎯 HIGH PRIORITY: Specify edge case handling
|
|
199
|
-
|
|
200
|
-
Add section: "Error Scenarios"
|
|
201
|
-
- Rate limiting: 5 failed attempts → 15 min lockout
|
|
202
|
-
- Invalid token: Return 401 with error code
|
|
203
|
-
- Expired session: Redirect to login with message
|
|
204
|
-
|
|
205
|
-
🔹 MEDIUM PRIORITY: Add performance requirements
|
|
206
|
-
|
|
207
|
-
Suggested addition:
|
|
208
|
-
- Login latency: p95 < 500ms
|
|
209
|
-
- Concurrent logins: Support 100/sec
|
|
210
|
-
- Token validation: < 10ms
|
|
211
|
-
|
|
212
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
213
|
-
SUMMARY
|
|
214
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
215
|
-
|
|
216
|
-
✅ This specification is GOOD (87/100)
|
|
217
|
-
|
|
218
|
-
Strengths:
|
|
219
|
-
• Clear problem statement and objectives
|
|
220
|
-
• Architecture is sound and scalable
|
|
221
|
-
• Good coverage of functional requirements
|
|
222
|
-
|
|
223
|
-
Areas for improvement:
|
|
224
|
-
• Make acceptance criteria more testable (2 items)
|
|
225
|
-
• Address edge cases (rate limiting, errors)
|
|
226
|
-
• Add performance requirements
|
|
227
|
-
|
|
228
|
-
Recommendation: Address HIGH priority suggestions before
|
|
229
|
-
implementation. MEDIUM priority can be added incrementally.
|
|
230
|
-
|
|
231
|
-
Would you like to:
|
|
232
|
-
[F] Auto-fix HIGH priority issues (experimental)
|
|
233
|
-
[E] Export suggestions to tasks.md
|
|
234
|
-
[C] Continue without changes
|
|
235
|
-
|
|
236
|
-
Choice: _
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
## Configuration
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
## Usage Examples
|
|
244
|
-
|
|
245
|
-
### Example 1: Basic Quality Check
|
|
246
|
-
|
|
247
|
-
```bash
|
|
248
|
-
User: "Validate increment 001"
|
|
249
|
-
|
|
250
|
-
increment-quality-judge:
|
|
251
|
-
✅ Rule-based: 120/120 passed
|
|
252
|
-
🤔 Run AI quality check? [Y/n]: Y
|
|
253
|
-
|
|
254
|
-
🔍 Analyzing...
|
|
255
|
-
|
|
256
|
-
Overall: 87/100 (GOOD)
|
|
257
|
-
Issues: 2 major, 1 minor
|
|
258
|
-
Suggestions: 3 high priority
|
|
259
|
-
|
|
260
|
-
[Full report shown above]
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
### Example 2: Auto-Run Mode
|
|
264
|
-
|
|
265
|
-
```bash
|
|
266
|
-
User: "Validate increment 001 --quality"
|
|
267
|
-
|
|
268
|
-
increment-quality-judge:
|
|
269
|
-
✅ Rule-based: 120/120 passed
|
|
270
|
-
🔍 AI Quality: 87/100 (GOOD)
|
|
271
|
-
|
|
272
|
-
[Full report shown automatically]
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
### Example 3: Export Suggestions to Tasks
|
|
276
|
-
|
|
277
|
-
```bash
|
|
278
|
-
User: "Validate increment 001"
|
|
279
|
-
[After quality assessment shows suggestions]
|
|
280
|
-
|
|
281
|
-
User: E (Export to tasks.md)
|
|
282
|
-
|
|
283
|
-
increment-quality-judge:
|
|
284
|
-
✅ Exported 3 suggestions to .specweave/increments/0001-auth/tasks.md
|
|
285
|
-
|
|
286
|
-
Added tasks:
|
|
287
|
-
- [ ] Make acceptance criteria measurable (HIGH)
|
|
288
|
-
- [ ] Specify edge case handling (HIGH)
|
|
289
|
-
- [ ] Add performance requirements (MEDIUM)
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
## Scoring Algorithm
|
|
293
|
-
|
|
294
|
-
### Step 1: Dimension Evaluation
|
|
295
|
-
|
|
296
|
-
For each dimension, evaluate using prompt:
|
|
297
|
-
|
|
298
|
-
```markdown
|
|
299
|
-
You are evaluating a software specification for {dimension}.
|
|
300
|
-
|
|
301
|
-
Specification:
|
|
302
|
-
{spec_content}
|
|
303
|
-
|
|
304
|
-
Criteria:
|
|
305
|
-
{dimension_criteria}
|
|
306
|
-
|
|
307
|
-
Score 0.00-1.00 based on:
|
|
308
|
-
- 1.00: Exceptional, industry best practice
|
|
309
|
-
- 0.80-0.99: Good, minor improvements possible
|
|
310
|
-
- 0.60-0.79: Acceptable, notable gaps
|
|
311
|
-
- 0.00-0.59: Needs work, significant issues
|
|
312
|
-
|
|
313
|
-
Provide:
|
|
314
|
-
1. Score (0.00-1.00)
|
|
315
|
-
2. Issues found (if any)
|
|
316
|
-
3. Suggestions for improvement
|
|
317
|
-
4. Confidence (0.00-1.00)
|
|
318
|
-
|
|
319
|
-
Format:
|
|
320
|
-
{
|
|
321
|
-
"score": 0.85,
|
|
322
|
-
"issues": [...],
|
|
323
|
-
"suggestions": [...],
|
|
324
|
-
"confidence": 0.90
|
|
325
|
-
}
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
### Step 2: Weighted Overall Score
|
|
329
|
-
|
|
330
|
-
```typescript
|
|
331
|
-
overall_score =
|
|
332
|
-
(clarity * 0.20) +
|
|
333
|
-
(testability * 0.25) +
|
|
334
|
-
(completeness * 0.20) +
|
|
335
|
-
(feasibility * 0.15) +
|
|
336
|
-
(maintainability * 0.10) +
|
|
337
|
-
(edge_cases * 0.10)
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
### Step 3: Confidence Calculation
|
|
341
|
-
|
|
342
|
-
```typescript
|
|
343
|
-
confidence = average(dimension_confidences)
|
|
344
|
-
|
|
345
|
-
if (confidence < 0.80) {
|
|
346
|
-
show_warning = "⚠️ Low confidence. Results may be less accurate."
|
|
347
|
-
}
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
## Integration with Validation Workflow
|
|
351
|
-
|
|
352
|
-
### Current: Rule-Based Only
|
|
353
|
-
|
|
354
|
-
```
|
|
355
|
-
User: /specweave:validate-increment 001
|
|
356
|
-
↓
|
|
357
|
-
Run 120 rule-based checks
|
|
358
|
-
↓
|
|
359
|
-
Show results: ✅ PASSED or ❌ FAILED
|
|
360
|
-
```
|
|
361
|
-
|
|
362
|
-
### With Quality Judge (Interactive)
|
|
363
|
-
|
|
364
|
-
```
|
|
365
|
-
User: /specweave:validate-increment 001
|
|
366
|
-
↓
|
|
367
|
-
Run 120 rule-based checks
|
|
368
|
-
↓
|
|
369
|
-
Show results: ✅ PASSED
|
|
370
|
-
↓
|
|
371
|
-
Prompt: "Run AI quality check? [Y/n]"
|
|
372
|
-
↓ (if Yes)
|
|
373
|
-
Run quality assessment (~2k tokens)
|
|
374
|
-
↓
|
|
375
|
-
Show detailed quality report with scores
|
|
376
|
-
↓
|
|
377
|
-
Prompt: "Export suggestions to tasks? [Y/n]"
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
### With Quality Judge (Always-On)
|
|
381
|
-
|
|
382
|
-
```
|
|
383
|
-
User: /specweave:validate-increment 001
|
|
384
|
-
↓
|
|
385
|
-
Run in parallel:
|
|
386
|
-
• Rule-based checks (120 rules)
|
|
387
|
-
• AI quality assessment
|
|
388
|
-
↓
|
|
389
|
-
Show combined results:
|
|
390
|
-
✅ Rule-based: 120/120
|
|
391
|
-
🔍 Quality: 87/100
|
|
392
|
-
↓
|
|
393
|
-
Show detailed report
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
## Token Usage
|
|
397
|
-
|
|
398
|
-
**Estimated per increment:**
|
|
399
|
-
- Small spec (<100 lines): ~1,500 tokens
|
|
400
|
-
- Medium spec (100-250 lines): ~2,000 tokens
|
|
401
|
-
- Large spec (>250 lines): ~3,000 tokens
|
|
402
|
-
|
|
403
|
-
**Cost (Claude Sonnet 4.5):**
|
|
404
|
-
- Small: ~$0.015 per assessment
|
|
405
|
-
- Medium: ~$0.020 per assessment
|
|
406
|
-
- Large: ~$0.030 per assessment
|
|
407
|
-
|
|
408
|
-
**Optimization:**
|
|
409
|
-
- Only evaluate spec.md by default
|
|
410
|
-
- Optional: Include plan.md and tests.md
|
|
411
|
-
- Cache common patterns for 5 min
|
|
412
|
-
|
|
413
|
-
## Test Cases
|
|
414
|
-
|
|
415
|
-
### TC-001: Basic Quality Assessment
|
|
416
|
-
**Given:** Valid spec.md with minor issues
|
|
417
|
-
**When:** quality-judge runs
|
|
418
|
-
**Then:** Returns score 70-85 with specific suggestions
|
|
419
|
-
|
|
420
|
-
### TC-002: Excellent Spec
|
|
421
|
-
**Given:** High-quality spec with clear criteria
|
|
422
|
-
**When:** quality-judge runs
|
|
423
|
-
**Then:** Returns score 90+ with minimal suggestions
|
|
424
|
-
|
|
425
|
-
### TC-003: Poor Spec
|
|
426
|
-
**Given:** Vague spec with unclear requirements
|
|
427
|
-
**When:** quality-judge runs
|
|
428
|
-
**Then:** Returns score <60 with critical issues
|
|
429
|
-
|
|
430
|
-
### TC-004: Export to Tasks
|
|
431
|
-
**Given:** Quality assessment with 3 suggestions
|
|
432
|
-
**When:** User selects "Export to tasks"
|
|
433
|
-
**Then:** 3 tasks added to tasks.md with priority labels
|
|
434
|
-
|
|
435
|
-
### TC-005: Auto-Run Mode
|
|
436
|
-
**Given:** User provides --quality flag
|
|
437
|
-
**When:** User requests validation ("validate increment 001 --quality")
|
|
438
|
-
**Then:** Quality check runs automatically without prompt
|
|
439
|
-
|
|
440
|
-
## Best Practices
|
|
441
|
-
|
|
442
|
-
### 1. Use After Rule-Based Validation
|
|
443
|
-
|
|
444
|
-
Always run rule-based checks first:
|
|
445
|
-
- Faster (no API calls)
|
|
446
|
-
- Catches structural issues
|
|
447
|
-
- Free (no token cost)
|
|
448
|
-
|
|
449
|
-
Then optionally run quality judge for nuanced feedback.
|
|
450
|
-
|
|
451
|
-
### 2. Review Suggestions, Don't Auto-Apply
|
|
452
|
-
|
|
453
|
-
Quality judge provides suggestions, but:
|
|
454
|
-
- User reviews for context
|
|
455
|
-
- User decides what to apply
|
|
456
|
-
- Some suggestions may not fit domain
|
|
457
|
-
|
|
458
|
-
### 3. Adjust Thresholds for Your Domain
|
|
459
|
-
|
|
460
|
-
Healthcare/Finance may need 90+ scores.
|
|
461
|
-
Internal tools may accept 70+ scores.
|
|
462
|
-
|
|
463
|
-
### 4. Use Confidence Scores
|
|
464
|
-
|
|
465
|
-
If confidence < 80%, consider:
|
|
466
|
-
- Spec might be too short (not enough signal)
|
|
467
|
-
- Spec might use domain jargon (unfamiliar to LLM)
|
|
468
|
-
- Manual review recommended
|
|
469
|
-
|
|
470
|
-
## Limitations
|
|
471
|
-
|
|
472
|
-
**What quality-judge CAN'T do:**
|
|
473
|
-
- ❌ Understand domain-specific requirements (healthcare compliance, finance regulations)
|
|
474
|
-
- ❌ Validate against company-specific standards (unless in spec)
|
|
475
|
-
- ❌ Verify technical feasibility with actual codebase
|
|
476
|
-
- ❌ Replace human expertise and judgment
|
|
477
|
-
|
|
478
|
-
**What quality-judge CAN do:**
|
|
479
|
-
- ✅ Catch vague or ambiguous language
|
|
480
|
-
- ✅ Identify missing error handling
|
|
481
|
-
- ✅ Spot untestable acceptance criteria
|
|
482
|
-
- ✅ Suggest industry best practices
|
|
483
|
-
- ✅ Flag missing edge cases
|
|
484
|
-
|
|
485
|
-
## Future Enhancements
|
|
486
|
-
|
|
487
|
-
### Phase 2: Cross-Document Validation
|
|
488
|
-
- Check spec.md ↔ plan.md consistency
|
|
489
|
-
- Verify tests.md covers all acceptance criteria
|
|
490
|
-
- Detect missing ADRs for architectural decisions
|
|
491
|
-
|
|
492
|
-
### Phase 3: Historical Learning
|
|
493
|
-
- Compare with past increments
|
|
494
|
-
- Learn from user feedback (which suggestions were applied)
|
|
495
|
-
- Adapt scoring based on project type
|
|
496
|
-
|
|
497
|
-
### Phase 4: Custom Criteria
|
|
498
|
-
- Company-specific quality standards
|
|
499
|
-
- Domain-specific requirements (HIPAA, PCI-DSS)
|
|
500
|
-
- Team-specific conventions
|
|
501
|
-
|
|
502
|
-
## Resources
|
|
503
|
-
|
|
504
|
-
- [LLM-as-Judge Pattern](https://arxiv.org/abs/2306.05685) - Research paper
|
|
505
|
-
- [G-Eval Framework](https://arxiv.org/abs/2303.16634) - Quality scoring methodology
|
|
506
|
-
- [Anthropic Evals](https://github.com/anthropics/evals) - Evaluation best practices
|
|
507
|
-
|
|
508
|
-
---
|
|
509
|
-
|
|
510
|
-
## Summary
|
|
511
|
-
|
|
512
|
-
**increment-quality-judge** extends SpecWeave's validation with AI-powered quality assessment:
|
|
513
|
-
|
|
514
|
-
✅ **Multi-dimensional scoring** (6 dimensions, weighted)
|
|
515
|
-
✅ **Interactive workflow** (prompt user, optional)
|
|
516
|
-
✅ **Actionable suggestions** (with examples)
|
|
517
|
-
✅ **Export to tasks** (convert suggestions to work items)
|
|
518
|
-
✅ **Configurable** (thresholds, dimensions, auto-run)
|
|
519
|
-
✅ **Token-efficient** (~2k tokens per assessment)
|
|
520
|
-
✅ **Complements rule-based validation** (catches different issues)
|
|
521
|
-
|
|
522
|
-
**Use it when:** You want high-quality specs that go beyond structural correctness to ensure clarity, testability, and completeness.
|
|
523
|
-
|
|
524
|
-
**Skip it when:** Quick iteration, tight token budget, or simple features where rule-based validation is sufficient.
|