specweave 1.0.261 → 1.0.263

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.
Files changed (133) hide show
  1. package/.claude-plugin/README.md +0 -2
  2. package/CLAUDE.md +27 -27
  3. package/bin/specweave.js +14 -85
  4. package/dist/dashboard/assets/index-Cv1XUAKk.css +1 -0
  5. package/dist/dashboard/assets/index-DHOztQSu.js +11 -0
  6. package/dist/dashboard/index.html +2 -2
  7. package/dist/src/adapters/README.md +1 -1
  8. package/dist/src/adapters/agents-md-generator.js +1 -1
  9. package/dist/src/adapters/agents-md-generator.js.map +1 -1
  10. package/dist/src/adapters/claude/README.md +8 -8
  11. package/dist/src/adapters/claude/adapter.js +2 -2
  12. package/dist/src/adapters/claude-md-generator.js +2 -2
  13. package/dist/src/adapters/claude-md-generator.js.map +1 -1
  14. package/dist/src/adapters/cursor/README.md +7 -7
  15. package/dist/src/adapters/generic/README.md +2 -2
  16. package/dist/src/cli/commands/create-increment.d.ts +1 -1
  17. package/dist/src/cli/commands/create-increment.js +1 -1
  18. package/dist/src/cli/commands/update.d.ts.map +1 -1
  19. package/dist/src/cli/commands/update.js +64 -1
  20. package/dist/src/cli/commands/update.js.map +1 -1
  21. package/dist/src/cli/helpers/init/api-docs-config.js +7 -7
  22. package/dist/src/cli/helpers/init/api-docs-config.js.map +1 -1
  23. package/dist/src/core/config/types.d.ts +18 -0
  24. package/dist/src/core/config/types.d.ts.map +1 -1
  25. package/dist/src/core/config/types.js +4 -0
  26. package/dist/src/core/config/types.js.map +1 -1
  27. package/dist/src/core/external-tools/external-items-display.d.ts.map +1 -1
  28. package/dist/src/core/external-tools/external-items-display.js +1 -11
  29. package/dist/src/core/external-tools/external-items-display.js.map +1 -1
  30. package/dist/src/core/increment/increment-archiver.js +1 -1
  31. package/dist/src/core/increment/increment-archiver.js.map +1 -1
  32. package/dist/src/core/increment/metadata-manager.js +2 -2
  33. package/dist/src/core/increment/metadata-manager.js.map +1 -1
  34. package/dist/src/core/increment/template-creator.d.ts +1 -1
  35. package/dist/src/core/increment/template-creator.js +4 -4
  36. package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts +2 -2
  37. package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts.map +1 -1
  38. package/dist/src/core/lazy-loading/llm-plugin-detector.js +15 -5
  39. package/dist/src/core/lazy-loading/llm-plugin-detector.js.map +1 -1
  40. package/dist/src/core/living-docs/feature-consistency-validator.js +1 -1
  41. package/dist/src/core/living-docs/feature-consistency-validator.js.map +1 -1
  42. package/dist/src/core/living-docs/scaffolding/scaffold.js +3 -3
  43. package/dist/src/core/notifications/command-integration.d.ts.map +1 -1
  44. package/dist/src/core/notifications/command-integration.js +0 -1
  45. package/dist/src/core/notifications/command-integration.js.map +1 -1
  46. package/dist/src/core/reflection/reflect-handler.js +2 -2
  47. package/dist/src/core/reflection/reflect-handler.js.map +1 -1
  48. package/dist/src/core/validators/ac-presence-validator.d.ts +1 -1
  49. package/dist/src/core/validators/ac-presence-validator.js +3 -3
  50. package/dist/src/core/validators/ac-presence-validator.js.map +1 -1
  51. package/dist/src/dashboard/server/command-runner.d.ts.map +1 -1
  52. package/dist/src/dashboard/server/command-runner.js +2 -2
  53. package/dist/src/dashboard/server/command-runner.js.map +1 -1
  54. package/dist/src/dashboard/server/dashboard-server.d.ts.map +1 -1
  55. package/dist/src/dashboard/server/dashboard-server.js +22 -10
  56. package/dist/src/dashboard/server/dashboard-server.js.map +1 -1
  57. package/dist/src/dashboard/server/data/dashboard-data-aggregator.d.ts +9 -1
  58. package/dist/src/dashboard/server/data/dashboard-data-aggregator.d.ts.map +1 -1
  59. package/dist/src/dashboard/server/data/dashboard-data-aggregator.js +140 -13
  60. package/dist/src/dashboard/server/data/dashboard-data-aggregator.js.map +1 -1
  61. package/dist/src/dashboard/server/data/plugin-scanner.d.ts +1 -1
  62. package/dist/src/dashboard/server/data/plugin-scanner.d.ts.map +1 -1
  63. package/dist/src/dashboard/server/data/plugin-scanner.js +2 -2
  64. package/dist/src/dashboard/server/data/plugin-scanner.js.map +1 -1
  65. package/dist/src/utils/agents-md-compiler.js +1 -1
  66. package/dist/src/utils/agents-md-compiler.js.map +1 -1
  67. package/dist/src/utils/find-project-root.d.ts +5 -4
  68. package/dist/src/utils/find-project-root.d.ts.map +1 -1
  69. package/dist/src/utils/find-project-root.js +8 -10
  70. package/dist/src/utils/find-project-root.js.map +1 -1
  71. package/dist/src/utils/generate-skills-index.js +3 -3
  72. package/dist/src/utils/notification-constants.js +1 -1
  73. package/dist/src/utils/notification-constants.js.map +1 -1
  74. package/package.json +1 -1
  75. package/plugins/FINAL-AUDIT-RECOMMENDATIONS.md +3 -3
  76. package/plugins/specweave/PLUGIN.md +0 -22
  77. package/plugins/specweave/commands/analytics.md +1 -1
  78. package/plugins/specweave/commands/discrepancies.md +0 -1
  79. package/plugins/specweave/commands/living-docs.md +0 -1
  80. package/plugins/specweave/commands/reconcile.md +1 -1
  81. package/plugins/specweave/hooks/hooks.json +19 -0
  82. package/plugins/specweave/hooks/pre-compact.sh +39 -0
  83. package/plugins/specweave/hooks/stop-sync.sh +23 -1
  84. package/plugins/specweave/hooks/universal/fail-fast-wrapper.sh +4 -0
  85. package/plugins/specweave/hooks/user-prompt-submit.sh +193 -59
  86. package/plugins/specweave/hooks/v2/dispatchers/post-tool-use-analytics.sh +83 -0
  87. package/plugins/specweave/hooks/v2/dispatchers/session-start.sh +7 -0
  88. package/plugins/specweave/hooks/v2/guards/spec-template-enforcement-guard.sh +1 -1
  89. package/plugins/specweave/hooks/v2/handlers/ac-sync-dispatcher.sh +25 -6
  90. package/plugins/specweave/hooks/v2/handlers/universal-auto-create-dispatcher.sh +21 -3
  91. package/plugins/specweave/hooks/v2/lib/check-provider-enabled.sh +52 -0
  92. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +2 -2
  93. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -1
  94. package/plugins/specweave/scripts/track-analytics.sh +4 -0
  95. package/plugins/specweave/skills/do/SKILL.md +1 -1
  96. package/plugins/specweave/skills/done/SKILL.md +1 -1
  97. package/plugins/specweave/skills/framework/SKILL.md +4 -4
  98. package/plugins/specweave/skills/increment/SKILL.md +192 -25
  99. package/plugins/specweave/skills/next/SKILL.md +36 -630
  100. package/plugins/specweave/skills/pm/phases/00-deep-interview.md +2 -2
  101. package/plugins/specweave/skills/progress-sync/SKILL.md +7 -25
  102. package/plugins/specweave/skills/spec-generator/SKILL.md +44 -626
  103. package/plugins/specweave/skills/tdd-green/SKILL.md +10 -798
  104. package/plugins/specweave/skills/tdd-red/SKILL.md +8 -136
  105. package/plugins/specweave/skills/tdd-refactor/SKILL.md +15 -147
  106. package/plugins/specweave-github/hooks/github-auto-create-handler.sh +23 -5
  107. package/src/templates/AGENTS.md.template +11 -11
  108. package/src/templates/CLAUDE.md.template +1 -1
  109. package/dist/dashboard/assets/index-CDl14O5G.css +0 -1
  110. package/dist/dashboard/assets/index-CmqBqnWd.js +0 -11
  111. package/plugins/specweave/commands/api-docs.md +0 -672
  112. package/plugins/specweave/commands/check-hooks.md +0 -241
  113. package/plugins/specweave/commands/embed-acs.md +0 -445
  114. package/plugins/specweave/commands/external.md +0 -145
  115. package/plugins/specweave/commands/import-docs.md +0 -212
  116. package/plugins/specweave/commands/migrate-config.md +0 -104
  117. package/plugins/specweave/commands/notifications.md +0 -94
  118. package/plugins/specweave/commands/plugin-validator.md +0 -429
  119. package/plugins/specweave/commands/revert-wip-limit.md +0 -82
  120. package/plugins/specweave/commands/sync-acs.md +0 -342
  121. package/plugins/specweave/commands/sync-specs.md +0 -339
  122. package/plugins/specweave/commands/sync-tasks.md +0 -255
  123. package/plugins/specweave/commands/update-scope.md +0 -351
  124. package/plugins/specweave/commands/validate-features.md +0 -207
  125. package/plugins/specweave/skills/archive-increments/SKILL.md +0 -209
  126. package/plugins/specweave/skills/code-review/SKILL.md +0 -598
  127. package/plugins/specweave/skills/increment-planner/SKILL.md +0 -238
  128. package/plugins/specweave/skills/increment-work-router/SKILL.md +0 -562
  129. package/plugins/specweave/skills/multi-project-spec-mapper/SKILL.md +0 -423
  130. package/plugins/specweave/skills/pm-closure-validation/SKILL.md +0 -542
  131. package/plugins/specweave/skills/smart-reopen-detector/SKILL.md +0 -245
  132. package/plugins/specweave/skills/tdd-orchestrator/SKILL.md +0 -228
  133. package/plugins/specweave/skills/umbrella-repo-detector/SKILL.md +0 -301
@@ -1,255 +0,0 @@
1
- ---
2
- description: Sync tasks.md with actual completion status (GitHub issue or reality check)
3
- ---
4
-
5
- # Sync Tasks Status
6
-
7
- **Purpose**: Fix tasks.md when it's out of sync with reality (GitHub issue, git history, or actual files).
8
-
9
- **Use When**:
10
- - `/progress` shows wrong completion %
11
- - GitHub issue says 24/24 but tasks.md says 1/24
12
- - After manually completing work without updating tasks.md
13
-
14
- ---
15
-
16
- ## How It Works
17
-
18
- 1. **Detect Active Increment**
19
- - Find increment in-progress
20
- - Check if tasks.md exists
21
-
22
- 2. **Compare Sources**
23
- - **tasks.md**: Current status
24
- - **GitHub issue** (if synced): Checklist status
25
- - **Git history**: What files were actually changed/created
26
- - **File system**: What files exist
27
-
28
- 3. **Show Diff**
29
- ```
30
- Sync Status Check:
31
-
32
- tasks.md: 5/24 complete (21%)
33
- GitHub #4: 24/24 complete (100%) āœ“ TRUTH
34
- Git commits: 24 task commits found
35
-
36
- Mismatch detected! tasks.md is stale.
37
- ```
38
-
39
- 4. **Offer Fix**
40
- ```
41
- Options:
42
- 1. Auto-sync from GitHub issue (recommended)
43
- 2. Auto-sync from git history
44
- 3. Manual review (show each task)
45
- 4. Cancel
46
- ```
47
-
48
- 5. **Update tasks.md**
49
- - Mark completed tasks as [x]
50
- - Update progress counters
51
- - Commit changes
52
-
53
- ---
54
-
55
- ## Usage
56
-
57
- ```bash
58
- # Auto-detect and sync
59
- /sw:sync-tasks
60
-
61
- # Sync specific increment
62
- /sw:sync-tasks 0007
63
-
64
- # Force sync from GitHub (skip git check)
65
- /sw:sync-tasks --source=github
66
-
67
- # Dry run (show what would change)
68
- /sw:sync-tasks --dry-run
69
- ```
70
-
71
- ---
72
-
73
- ## Implementation Steps
74
-
75
- ### Step 1: Find Active Increment
76
-
77
- ```bash
78
- ACTIVE_INCREMENT=$(find .specweave/increments -name "tasks.md" -exec grep -l "Status: In Progress" {} \; | head -1)
79
-
80
- if [[ -z "$ACTIVE_INCREMENT" ]]; then
81
- echo "No active increment found"
82
- exit 0
83
- fi
84
-
85
- INCREMENT_DIR=$(dirname "$ACTIVE_INCREMENT")
86
- INCREMENT_ID=$(basename "$INCREMENT_DIR" | grep -oE "^[0-9]+")
87
- ```
88
-
89
- ### Step 2: Get GitHub Issue Status (if exists)
90
-
91
- ```bash
92
- # Check if GitHub sync is enabled
93
- GITHUB_ISSUE=$(grep "github-issue:" "$INCREMENT_DIR/spec.md" | cut -d':' -f2 | tr -d ' ')
94
-
95
- if [[ -n "$GITHUB_ISSUE" ]]; then
96
- # Fetch issue body
97
- ISSUE_BODY=$(gh issue view "$GITHUB_ISSUE" --json body --jq '.body')
98
-
99
- # Count completed checkboxes
100
- GH_TOTAL=$(echo "$ISSUE_BODY" | grep -c "^- \[")
101
- GH_COMPLETE=$(echo "$ISSUE_BODY" | grep -c "^- \[x\]")
102
-
103
- echo "GitHub Issue #$GITHUB_ISSUE: $GH_COMPLETE/$GH_TOTAL complete"
104
- else
105
- echo "No GitHub issue linked (skipping GitHub sync)"
106
- fi
107
- ```
108
-
109
- ### Step 3: Get tasks.md Status
110
-
111
- ```bash
112
- TASKS_TOTAL=$(grep -c "^#### T-" "$INCREMENT_DIR/tasks.md")
113
- TASKS_COMPLETE=$(grep -A1 "^#### T-" "$INCREMENT_DIR/tasks.md" | grep -c "\*\*Status\*\*: \[x\] completed")
114
-
115
- echo "tasks.md: $TASKS_COMPLETE/$TASKS_TOTAL complete"
116
- ```
117
-
118
- ### Step 4: Detect Mismatch
119
-
120
- ```bash
121
- if [[ "$GH_COMPLETE" -ne "$TASKS_COMPLETE" ]]; then
122
- echo "āš ļø Mismatch detected!"
123
- echo " GitHub: $GH_COMPLETE/$GH_TOTAL"
124
- echo " tasks.md: $TASKS_COMPLETE/$TASKS_TOTAL"
125
- echo ""
126
-
127
- # Offer to sync
128
- read -p "Sync tasks.md from GitHub issue? (y/n): " CONFIRM
129
-
130
- if [[ "$CONFIRM" == "y" ]]; then
131
- sync_from_github "$INCREMENT_DIR" "$GITHUB_ISSUE"
132
- fi
133
- else
134
- echo "āœ“ tasks.md is in sync with GitHub issue"
135
- fi
136
- ```
137
-
138
- ### Step 5: Sync From GitHub
139
-
140
- ```bash
141
- sync_from_github() {
142
- local increment_dir="$1"
143
- local github_issue="$2"
144
-
145
- # Parse GitHub issue checklist
146
- gh issue view "$github_issue" --json body --jq '.body' | while IFS= read -r line; do
147
- if [[ "$line" =~ ^\-\ \[x\]\ (T-[0-9]{3}) ]]; then
148
- # Task is complete in GitHub, mark in tasks.md
149
- TASK_ID="${BASH_REMATCH[1]}"
150
- mark_task_complete "$increment_dir" "$TASK_ID"
151
- fi
152
- done
153
-
154
- # Recalculate progress
155
- recalculate_progress "$increment_dir"
156
-
157
- echo "āœ“ Synced tasks.md from GitHub issue #$github_issue"
158
- }
159
-
160
- mark_task_complete() {
161
- local increment_dir="$1"
162
- local task_id="$2"
163
-
164
- # Find task and update status
165
- sed -i '' "/^#### $task_id:/,/^\*\*Status\*\*:/ s/\*\*Status\*\*: \[ \] pending/\*\*Status\*\*: [x] completed/" "$increment_dir/tasks.md"
166
- }
167
-
168
- recalculate_progress() {
169
- local increment_dir="$1"
170
-
171
- local total=$(grep -c "^#### T-" "$increment_dir/tasks.md")
172
- local completed=$(grep -A1 "^#### T-" "$increment_dir/tasks.md" | grep -c "\*\*Status\*\*: \[x\] completed")
173
- local progress=$((completed * 100 / total))
174
-
175
- # Update header
176
- sed -i '' "s/\*\*Completed\*\*: [0-9]*/\*\*Completed\*\*: $completed/" "$increment_dir/tasks.md"
177
- sed -i '' "s/\*\*Progress\*\*: [0-9]*%/\*\*Progress\*\*: $progress%/" "$increment_dir/tasks.md"
178
-
179
- echo "āœ“ Progress updated: $completed/$total ($progress%)"
180
- }
181
- ```
182
-
183
- ---
184
-
185
- ## Example Output
186
-
187
- ```
188
- šŸ”„ Syncing tasks.md status...
189
-
190
- Active Increment: 0007-smart-increment-discipline
191
-
192
- Status Comparison:
193
- ā”œā”€ tasks.md: 1/24 complete (4%)
194
- ā”œā”€ GitHub #4: 24/24 complete (100%)
195
- └─ Mismatch: 23 tasks out of sync āš ļø
196
-
197
- Sync Source:
198
- āœ“ GitHub issue #4 (most reliable)
199
-
200
- Updating tasks.md...
201
- ā”œā”€ T-001: [ ] → [x] āœ“
202
- ā”œā”€ T-002: [ ] → [x] āœ“
203
- ā”œā”€ T-003: [ ] → [x] āœ“
204
- ...
205
- └─ T-024: [ ] → [x] āœ“
206
-
207
- Progress recalculated:
208
- ā”œā”€ Completed: 1 → 24
209
- ā”œā”€ Progress: 4% → 100%
210
- └─ Status: In Progress → Complete
211
-
212
- āœ“ tasks.md synced successfully!
213
-
214
- Next: Run /sw:progress to verify
215
- ```
216
-
217
- ---
218
-
219
- ## Integration with Other Commands
220
-
221
- ### /sw:progress
222
- ```bash
223
- # Check sync status before showing progress
224
- /sw:sync-tasks --validate
225
- # If out of sync, warn user
226
- ```
227
-
228
- ### /sw:validate
229
- ```bash
230
- # Validate tasks.md is in sync
231
- /sw:sync-tasks --validate
232
- # Fail validation if mismatch detected
233
- ```
234
-
235
- ### /sw:done
236
- ```bash
237
- # Ensure tasks.md is current before closing
238
- /sw:sync-tasks --auto
239
- # Auto-sync if needed, then proceed
240
- ```
241
-
242
- ---
243
-
244
- ## Success Criteria
245
-
246
- - āœ… Detects when tasks.md is out of sync
247
- - āœ… Syncs from GitHub issue (if available)
248
- - āœ… Syncs from git history (fallback)
249
- - āœ… Updates progress counters accurately
250
- - āœ… Commits changes with clear message
251
- - āœ… Integrates with /sw:progress, /sw:validate, /sw:done
252
-
253
- ---
254
-
255
- **This command ensures `/progress` and `/done` always show accurate status!**
@@ -1,351 +0,0 @@
1
- ---
2
- description: Update living completion report with scope changes during increment execution
3
- disable-model-invocation: true
4
- ---
5
-
6
- # Update Increment Scope (Living Reports)
7
-
8
- **Purpose**: Log scope changes in real-time during increment execution for complete traceability.
9
-
10
- This command adds entries to the **Scope Evolution** section of the completion report, capturing:
11
- - What changed (user stories added/removed/modified)
12
- - Why it changed (business reason, technical blocker, stakeholder request)
13
- - Who approved it (PM, stakeholder, architect)
14
- - Impact on timeline and effort
15
-
16
- ---
17
-
18
- ## Why Living Reports Matter
19
-
20
- **Problem** (traditional approach):
21
- ```
22
- Start: Plan 10 tasks
23
- During work: Scope changes 5 times (but not documented)
24
- End: Report says "Completed 8/10 tasks"
25
- Future: "Why was Task 5 removed?" → No one remembers
26
- ```
27
-
28
- **Solution** (living reports):
29
- ```
30
- Start: Plan 10 tasks + initialize completion report
31
- During work:
32
- - 2025-11-06: Added US6 (dark mode) → update-scope logged
33
- - 2025-11-07: Deferred US3 (CSV export) → update-scope logged
34
- - 2025-11-08: WebSockets → Polling pivot → update-scope logged
35
- End: Report shows complete scope evolution with WHY
36
- Future: "Why was Task 5 removed?" → Check report, find exact reason
37
- ```
38
-
39
- **Value**:
40
- - Complete audit trail (why scope changed)
41
- - Real-time documentation (not reconstructed later)
42
- - Regulatory compliance (explains deviations)
43
- - Learning for future increments
44
- - Onboarding new team members
45
-
46
- ---
47
-
48
- ## Usage
49
-
50
- ### Quick Log
51
-
52
- ```bash
53
- /sw:update-scope "Added dark mode toggle (stakeholder request from CMO, +16 hours)"
54
- ```
55
-
56
- ### Detailed Log
57
-
58
- ```bash
59
- /sw:update-scope
60
- # Interactive prompts:
61
- # - What changed? (Added/Removed/Modified user story)
62
- # - What specifically? (e.g., "US6: Dark mode toggle")
63
- # - Why changed? (Stakeholder request, technical blocker, etc.)
64
- # - Impact on effort? (+16 hours, -4 hours, 0)
65
- # - Who approved? (PM, Architect, CTO, etc.)
66
- # - Documentation links? (ADR-008, GitHub issue #123, etc.)
67
- ```
68
-
69
- ---
70
-
71
- ## How It Works
72
-
73
- ### Step 1: Detect Current Increment
74
-
75
- ```typescript
76
- import { MetadataManager } from '../core/metadata-manager';
77
-
78
- // Find active increment
79
- const active = await MetadataManager.getActive();
80
-
81
- if (active.length === 0) {
82
- console.error('āŒ No active increment found');
83
- console.error(' Run /sw:status to check increment status');
84
- process.exit(1);
85
- }
86
-
87
- if (active.length > 1) {
88
- // Multiple active - ask which one
89
- const choice = await prompt({
90
- type: 'select',
91
- message: 'Which increment to update?',
92
- choices: active.map(inc => ({ name: inc.id, value: inc.id }))
93
- });
94
- increment = choice;
95
- } else {
96
- increment = active[0].id;
97
- }
98
-
99
- console.log(`\nšŸ“ Updating scope for: ${increment}\n`);
100
- ```
101
-
102
- ### Step 2: Load Existing Report
103
-
104
- ```typescript
105
- const reportPath = `.specweave/increments/${increment}/reports/COMPLETION-REPORT.md`;
106
-
107
- if (!fs.existsSync(reportPath)) {
108
- console.error('āŒ Completion report not found');
109
- console.error(` Expected: ${reportPath}`);
110
- console.error(' Run /sw:increment to create increment properly');
111
- process.exit(1);
112
- }
113
-
114
- const report = fs.readFileSync(reportPath, 'utf-8');
115
- ```
116
-
117
- ### Step 3: Gather Scope Change Details
118
-
119
- **Prompt user** (if not provided in command):
120
-
121
- ```typescript
122
- const changeType = await prompt({
123
- type: 'select',
124
- message: 'What changed?',
125
- choices: [
126
- 'Added user story',
127
- 'Removed/deferred user story',
128
- 'Modified user story',
129
- 'Technical pivot (architecture change)',
130
- 'Scope reduction',
131
- 'Scope expansion',
132
- 'Other'
133
- ]
134
- });
135
-
136
- const changeDescription = await prompt({
137
- type: 'input',
138
- message: 'What specifically changed?',
139
- validate: input => input.length > 5 || 'Please provide details'
140
- });
141
-
142
- const changeReason = await prompt({
143
- type: 'input',
144
- message: 'Why did it change?',
145
- validate: input => input.length > 5 || 'Please provide reason'
146
- });
147
-
148
- const impactHours = await prompt({
149
- type: 'input',
150
- message: 'Impact on effort (hours):',
151
- default: '0',
152
- validate: input => !isNaN(parseInt(input)) || 'Must be a number'
153
- });
154
-
155
- const approver = await prompt({
156
- type: 'input',
157
- message: 'Who approved this change?',
158
- default: 'PM'
159
- });
160
-
161
- const docLinks = await prompt({
162
- type: 'input',
163
- message: 'Related documentation (ADR, issue, PR):',
164
- default: 'None'
165
- });
166
- ```
167
-
168
- ### Step 4: Add Entry to Scope Evolution Section
169
-
170
- ```typescript
171
- const today = new Date().toISOString().split('T')[0]; // YYYY-MM-DD
172
-
173
- const impactDirection = parseInt(impactHours) > 0 ? '+' : '';
174
- const impactText = impactHours === '0' ? '0 hours' : `${impactDirection}${impactHours} hours`;
175
-
176
- const newEntry = `
177
- ### ${today}: ${changeType}
178
-
179
- **Changed**: ${changeDescription}
180
- **Reason**: ${changeReason}
181
- **Impact**: ${impactText}
182
- **Decision**: ${approver}
183
- **Documentation**: ${docLinks}
184
-
185
- ---
186
- `;
187
-
188
- // Find "## Scope Evolution" section
189
- const scopeEvolutionMarker = '## Scope Evolution (Living Updates)';
190
- const noChangesMarker = '_No scope changes during this increment._';
191
-
192
- let updatedReport;
193
-
194
- if (report.includes(noChangesMarker)) {
195
- // First scope change - replace placeholder
196
- updatedReport = report.replace(
197
- noChangesMarker,
198
- '_This section is updated during the increment whenever scope changes occur._\n\n' + newEntry
199
- );
200
- } else {
201
- // Append to existing changes
202
- const scopeIndex = report.indexOf(scopeEvolutionMarker);
203
- const nextSectionIndex = report.indexOf('\n## ', scopeIndex + scopeEvolutionMarker.length);
204
-
205
- const beforeScope = report.substring(0, nextSectionIndex);
206
- const afterScope = report.substring(nextSectionIndex);
207
-
208
- updatedReport = beforeScope + '\n' + newEntry + afterScope;
209
- }
210
-
211
- // Update report version
212
- const versionRegex = /\*\*Report Version\*\*: v(\d+\.\d+)/;
213
- const match = updatedReport.match(versionRegex);
214
-
215
- if (match) {
216
- const currentVersion = parseFloat(match[1]);
217
- const newVersion = (currentVersion + 0.1).toFixed(1);
218
- updatedReport = updatedReport.replace(versionRegex, `**Report Version**: v${newVersion}`);
219
- }
220
-
221
- // Update last updated timestamp
222
- const timestampRegex = /\*\*Last Updated\*\*: .*/;
223
- updatedReport = updatedReport.replace(timestampRegex, `**Last Updated**: ${new Date().toISOString()}`);
224
-
225
- fs.writeFileSync(reportPath, updatedReport, 'utf-8');
226
-
227
- console.log(chalk.green('\nāœ… Scope change logged successfully!\n'));
228
- console.log(chalk.dim(` ${reportPath}\n`));
229
- console.log(chalk.blue('šŸ“‹ Change summary:'));
230
- console.log(chalk.white(` Type: ${changeType}`));
231
- console.log(chalk.white(` Impact: ${impactText}`));
232
- console.log(chalk.white(` Approved by: ${approver}\n`));
233
-
234
- console.log(chalk.dim('šŸ’” View full report:'));
235
- console.log(chalk.dim(` cat ${reportPath}\n`));
236
- ```
237
-
238
- ---
239
-
240
- ## Example Output
241
-
242
- ```
243
- šŸ“ Updating scope for: 0008-user-dashboard
244
-
245
- What changed? Added user story
246
- What specifically changed? US6: Dark mode toggle
247
- Why did it change? Stakeholder request from CMO (high priority, blocks marketing launch)
248
- Impact on effort (hours): 16
249
- Who approved this change? PM + CMO
250
- Related documentation (ADR, issue, PR): GitHub issue #45
251
-
252
- āœ… Scope change logged successfully!
253
-
254
- .specweave/increments/0008-user-dashboard/reports/COMPLETION-REPORT.md
255
-
256
- šŸ“‹ Change summary:
257
- Type: Added user story
258
- Impact: +16 hours
259
- Approved by: PM + CMO
260
-
261
- šŸ’” View full report:
262
- cat .specweave/increments/0008-user-dashboard/reports/COMPLETION-REPORT.md
263
- ```
264
-
265
- ---
266
-
267
- ## Completion Report Format
268
-
269
- The completion report is initialized when increment is created and updated throughout:
270
-
271
- ```markdown
272
- ## Scope Evolution (Living Updates)
273
-
274
- _This section is updated during the increment whenever scope changes occur._
275
-
276
- ### 2025-11-06: Added user story
277
-
278
- **Changed**: US6: Dark mode toggle
279
- **Reason**: Stakeholder request from CMO (high priority, blocks marketing launch)
280
- **Impact**: +16 hours
281
- **Decision**: PM + CMO
282
- **Documentation**: GitHub issue #45
283
-
284
- ---
285
-
286
- ### 2025-11-07: Removed/deferred user story
287
-
288
- **Changed**: US3: Data export to CSV
289
- **Reason**: Not critical for MVP, can be added later without breaking changes
290
- **Impact**: -8 hours (deferred to increment 0009)
291
- **Decision**: PM
292
- **Documentation**: None
293
-
294
- ---
295
-
296
- ### 2025-11-08: Technical pivot (architecture change)
297
-
298
- **Changed**: WebSockets → Long-polling
299
- **Reason**: WebSocket library had critical security vulnerability (CVE-2025-1234)
300
- **Impact**: -4 hours (simpler implementation)
301
- **Decision**: Architect + Security Lead
302
- **Documentation**: ADR-008: Why We Chose Polling Over WebSockets
303
-
304
- ---
305
- ```
306
-
307
- ---
308
-
309
- ## Best Practices
310
-
311
- ### When to Update
312
-
313
- **DO update** when:
314
- - Adding new user story or task
315
- - Removing/deferring work
316
- - Modifying scope of existing story
317
- - Making architecture pivots
318
- - Reducing/expanding scope
319
- - Blocking issues discovered
320
-
321
- **DON'T update** for:
322
- - Bug fixes discovered during implementation (normal)
323
- - Minor implementation details
324
- - Code refactoring (unless scope-affecting)
325
-
326
- ### What to Capture
327
-
328
- Always include:
329
- - **What changed**: Specific user story or task
330
- - **Why**: Business reason, technical blocker, stakeholder request
331
- - **Impact**: Hours added/removed
332
- - **Approval**: Who made the decision
333
- - **Links**: ADR, GitHub issue, Jira ticket
334
-
335
- ### Frequency
336
-
337
- - Update in **real-time** when change occurs (don't batch)
338
- - Better to have 10 small entries than 1 large summary
339
- - Captures decision context while fresh
340
-
341
- ---
342
-
343
- ## Related Commands
344
-
345
- - `/sw:increment "feature"` - Creates increment with initial completion report
346
- - `/sw:done <id>` - Finalizes report and marks increment complete
347
- - `/sw:status` - Check which increment is active
348
-
349
- ---
350
-
351
- **Pro Tip**: Use this command liberally! Living reports are your future self's best friend. When someone asks "Why did we defer feature X?", you'll have the exact answer with full context.