specweave 0.6.8 → 0.7.1

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 (255) hide show
  1. package/.claude-plugin/README.md +1 -1
  2. package/CLAUDE.md +903 -99
  3. package/README.md +143 -207
  4. package/bin/specweave.js +67 -0
  5. package/dist/cli/commands/abandon.d.ts +13 -0
  6. package/dist/cli/commands/abandon.d.ts.map +1 -0
  7. package/dist/cli/commands/abandon.js +15 -0
  8. package/dist/cli/commands/abandon.js.map +1 -0
  9. package/dist/cli/commands/init.d.ts.map +1 -1
  10. package/dist/cli/commands/init.js +94 -18
  11. package/dist/cli/commands/init.js.map +1 -1
  12. package/dist/cli/commands/pause.d.ts +13 -0
  13. package/dist/cli/commands/pause.d.ts.map +1 -0
  14. package/dist/cli/commands/pause.js +15 -0
  15. package/dist/cli/commands/pause.js.map +1 -0
  16. package/dist/cli/commands/qa.d.ts +54 -0
  17. package/dist/cli/commands/qa.d.ts.map +1 -0
  18. package/dist/cli/commands/qa.js +98 -0
  19. package/dist/cli/commands/qa.js.map +1 -0
  20. package/dist/cli/commands/resume.d.ts +12 -0
  21. package/dist/cli/commands/resume.d.ts.map +1 -0
  22. package/dist/cli/commands/resume.js +14 -0
  23. package/dist/cli/commands/resume.js.map +1 -0
  24. package/dist/cli/commands/status.d.ts +12 -0
  25. package/dist/cli/commands/status.d.ts.map +1 -0
  26. package/dist/cli/commands/status.js +23 -0
  27. package/dist/cli/commands/status.js.map +1 -0
  28. package/dist/cli/helpers/issue-tracker/ado.d.ts +57 -0
  29. package/dist/cli/helpers/issue-tracker/ado.d.ts.map +1 -0
  30. package/dist/cli/helpers/issue-tracker/ado.js +223 -0
  31. package/dist/cli/helpers/issue-tracker/ado.js.map +1 -0
  32. package/dist/cli/helpers/issue-tracker/github.d.ts +65 -0
  33. package/dist/cli/helpers/issue-tracker/github.d.ts.map +1 -0
  34. package/dist/cli/helpers/issue-tracker/github.js +284 -0
  35. package/dist/cli/helpers/issue-tracker/github.js.map +1 -0
  36. package/dist/cli/helpers/issue-tracker/index.d.ts +22 -0
  37. package/dist/cli/helpers/issue-tracker/index.d.ts.map +1 -0
  38. package/dist/cli/helpers/issue-tracker/index.js +270 -0
  39. package/dist/cli/helpers/issue-tracker/index.js.map +1 -0
  40. package/dist/cli/helpers/issue-tracker/jira.d.ts +61 -0
  41. package/dist/cli/helpers/issue-tracker/jira.d.ts.map +1 -0
  42. package/dist/cli/helpers/issue-tracker/jira.js +265 -0
  43. package/dist/cli/helpers/issue-tracker/jira.js.map +1 -0
  44. package/dist/cli/helpers/issue-tracker/types.d.ts +86 -0
  45. package/dist/cli/helpers/issue-tracker/types.d.ts.map +1 -0
  46. package/dist/cli/helpers/issue-tracker/types.js +16 -0
  47. package/dist/cli/helpers/issue-tracker/types.js.map +1 -0
  48. package/dist/cli/helpers/issue-tracker/utils.d.ts +103 -0
  49. package/dist/cli/helpers/issue-tracker/utils.d.ts.map +1 -0
  50. package/dist/cli/helpers/issue-tracker/utils.js +240 -0
  51. package/dist/cli/helpers/issue-tracker/utils.js.map +1 -0
  52. package/dist/core/increment/limits.d.ts +68 -0
  53. package/dist/core/increment/limits.d.ts.map +1 -0
  54. package/dist/core/increment/limits.js +224 -0
  55. package/dist/core/increment/limits.js.map +1 -0
  56. package/dist/core/increment/metadata-manager.d.ts +114 -0
  57. package/dist/core/increment/metadata-manager.d.ts.map +1 -0
  58. package/dist/core/increment/metadata-manager.js +320 -0
  59. package/dist/core/increment/metadata-manager.js.map +1 -0
  60. package/dist/core/increment/status-commands.d.ts +43 -0
  61. package/dist/core/increment/status-commands.d.ts.map +1 -0
  62. package/dist/core/increment/status-commands.js +277 -0
  63. package/dist/core/increment/status-commands.js.map +1 -0
  64. package/dist/core/plugin-detector.d.ts +1 -0
  65. package/dist/core/plugin-detector.d.ts.map +1 -1
  66. package/dist/core/plugin-detector.js +25 -0
  67. package/dist/core/plugin-detector.js.map +1 -1
  68. package/dist/core/qa/qa-runner.d.ts +16 -0
  69. package/dist/core/qa/qa-runner.d.ts.map +1 -0
  70. package/dist/core/qa/qa-runner.js +404 -0
  71. package/dist/core/qa/qa-runner.js.map +1 -0
  72. package/dist/core/qa/quality-gate-decider.d.ts +53 -0
  73. package/dist/core/qa/quality-gate-decider.d.ts.map +1 -0
  74. package/dist/core/qa/quality-gate-decider.js +268 -0
  75. package/dist/core/qa/quality-gate-decider.js.map +1 -0
  76. package/dist/core/qa/risk-calculator.d.ts +126 -0
  77. package/dist/core/qa/risk-calculator.d.ts.map +1 -0
  78. package/dist/core/qa/risk-calculator.js +247 -0
  79. package/dist/core/qa/risk-calculator.js.map +1 -0
  80. package/dist/core/qa/types.d.ts +315 -0
  81. package/dist/core/qa/types.d.ts.map +1 -0
  82. package/dist/core/qa/types.js +8 -0
  83. package/dist/core/qa/types.js.map +1 -0
  84. package/dist/core/types/config.d.ts +35 -0
  85. package/dist/core/types/config.d.ts.map +1 -1
  86. package/dist/core/types/config.js +16 -0
  87. package/dist/core/types/config.js.map +1 -1
  88. package/dist/core/types/increment-metadata.d.ts +120 -0
  89. package/dist/core/types/increment-metadata.d.ts.map +1 -0
  90. package/dist/core/types/increment-metadata.js +138 -0
  91. package/dist/core/types/increment-metadata.js.map +1 -0
  92. package/dist/hooks/lib/invoke-translator-skill.d.ts +60 -0
  93. package/dist/hooks/lib/invoke-translator-skill.d.ts.map +1 -0
  94. package/dist/hooks/lib/invoke-translator-skill.js +201 -0
  95. package/dist/hooks/lib/invoke-translator-skill.js.map +1 -0
  96. package/dist/hooks/lib/translate-file.d.ts +59 -0
  97. package/dist/hooks/lib/translate-file.d.ts.map +1 -0
  98. package/dist/hooks/lib/translate-file.js +350 -0
  99. package/dist/hooks/lib/translate-file.js.map +1 -0
  100. package/dist/locales/en/cli.json +3 -1
  101. package/dist/metrics/calculators/change-failure-rate.d.ts +22 -0
  102. package/dist/metrics/calculators/change-failure-rate.d.ts.map +1 -0
  103. package/dist/metrics/calculators/change-failure-rate.js +70 -0
  104. package/dist/metrics/calculators/change-failure-rate.js.map +1 -0
  105. package/dist/metrics/calculators/deployment-frequency.d.ts +20 -0
  106. package/dist/metrics/calculators/deployment-frequency.d.ts.map +1 -0
  107. package/dist/metrics/calculators/deployment-frequency.js +61 -0
  108. package/dist/metrics/calculators/deployment-frequency.js.map +1 -0
  109. package/dist/metrics/calculators/lead-time.d.ts +22 -0
  110. package/dist/metrics/calculators/lead-time.d.ts.map +1 -0
  111. package/dist/metrics/calculators/lead-time.js +82 -0
  112. package/dist/metrics/calculators/lead-time.js.map +1 -0
  113. package/dist/metrics/calculators/mttr.d.ts +21 -0
  114. package/dist/metrics/calculators/mttr.d.ts.map +1 -0
  115. package/dist/metrics/calculators/mttr.js +60 -0
  116. package/dist/metrics/calculators/mttr.js.map +1 -0
  117. package/dist/metrics/dora-calculator.d.ts +24 -0
  118. package/dist/metrics/dora-calculator.d.ts.map +1 -0
  119. package/dist/metrics/dora-calculator.js +104 -0
  120. package/dist/metrics/dora-calculator.js.map +1 -0
  121. package/dist/metrics/github-client.d.ts +51 -0
  122. package/dist/metrics/github-client.d.ts.map +1 -0
  123. package/dist/metrics/github-client.js +133 -0
  124. package/dist/metrics/github-client.js.map +1 -0
  125. package/dist/metrics/types.d.ts +112 -0
  126. package/dist/metrics/types.d.ts.map +1 -0
  127. package/dist/metrics/types.js +10 -0
  128. package/dist/metrics/types.js.map +1 -0
  129. package/dist/metrics/utils/percentile.d.ts +25 -0
  130. package/dist/metrics/utils/percentile.d.ts.map +1 -0
  131. package/dist/metrics/utils/percentile.js +46 -0
  132. package/dist/metrics/utils/percentile.js.map +1 -0
  133. package/dist/metrics/utils/tier-classifier.d.ts +61 -0
  134. package/dist/metrics/utils/tier-classifier.d.ts.map +1 -0
  135. package/dist/metrics/utils/tier-classifier.js +100 -0
  136. package/dist/metrics/utils/tier-classifier.js.map +1 -0
  137. package/dist/utils/auth-helpers.d.ts +58 -0
  138. package/dist/utils/auth-helpers.d.ts.map +1 -0
  139. package/dist/utils/auth-helpers.js +108 -0
  140. package/dist/utils/auth-helpers.js.map +1 -0
  141. package/dist/utils/env-file.d.ts +88 -0
  142. package/dist/utils/env-file.d.ts.map +1 -0
  143. package/dist/utils/env-file.js +180 -0
  144. package/dist/utils/env-file.js.map +1 -0
  145. package/dist/utils/plugin-detection.d.ts +50 -0
  146. package/dist/utils/plugin-detection.d.ts.map +1 -0
  147. package/dist/utils/plugin-detection.js +229 -0
  148. package/dist/utils/plugin-detection.js.map +1 -0
  149. package/dist/utils/secrets-loader.d.ts +88 -0
  150. package/dist/utils/secrets-loader.d.ts.map +1 -0
  151. package/dist/utils/secrets-loader.js +271 -0
  152. package/dist/utils/secrets-loader.js.map +1 -0
  153. package/dist/utils/translation.d.ts +187 -0
  154. package/dist/utils/translation.d.ts.map +1 -0
  155. package/dist/utils/translation.js +414 -0
  156. package/dist/utils/translation.js.map +1 -0
  157. package/package.json +28 -44
  158. package/plugins/specweave/.claude-plugin/plugin.json +3 -3
  159. package/plugins/specweave/agents/pm/AGENT.md +330 -54
  160. package/plugins/specweave/agents/test-aware-planner/AGENT.md +1035 -0
  161. package/plugins/specweave/agents/test-aware-planner/templates/README.md +118 -0
  162. package/plugins/specweave/agents/test-aware-planner/templates/task-non-testable.md.template +24 -0
  163. package/plugins/specweave/agents/test-aware-planner/templates/task-testable.md.template +53 -0
  164. package/plugins/specweave/agents/test-aware-planner/templates/tasks-frontmatter.md.template +11 -0
  165. package/plugins/specweave/commands/README.md +88 -163
  166. package/plugins/specweave/commands/specweave-abandon.md +314 -0
  167. package/plugins/specweave/commands/specweave-check-tests.md +546 -0
  168. package/plugins/specweave/commands/{do.md → specweave-do.md} +5 -7
  169. package/plugins/specweave/commands/{increment.md → specweave-increment.md} +231 -4
  170. package/plugins/specweave/commands/specweave-pause.md +189 -0
  171. package/plugins/specweave/commands/specweave-qa.md +245 -0
  172. package/plugins/specweave/commands/specweave-resume.md +216 -0
  173. package/plugins/specweave/commands/specweave-status.md +397 -0
  174. package/plugins/specweave/commands/specweave-sync-tasks.md +256 -0
  175. package/plugins/specweave/commands/{translate.md → specweave-translate.md} +3 -3
  176. package/plugins/specweave/commands/specweave-update-scope.md +351 -0
  177. package/plugins/specweave/commands/specweave.md +21 -21
  178. package/plugins/specweave/hooks/post-increment-planning.sh +335 -0
  179. package/plugins/specweave/hooks/post-task-completion.sh +141 -0
  180. package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
  181. package/plugins/specweave/skills/brownfield-analyzer/SKILL.md +9 -9
  182. package/plugins/specweave/skills/increment-planner/SKILL.md +400 -212
  183. package/plugins/specweave/skills/increment-quality-judge-v2/SKILL.md +499 -0
  184. package/plugins/specweave/skills/plugin-detector/SKILL.md +114 -1
  185. package/plugins/specweave/skills/project-kickstarter/SKILL.md +74 -1
  186. package/plugins/specweave/skills/{rfc-generator → spec-generator}/SKILL.md +22 -29
  187. package/plugins/specweave/skills/specweave-detector/SKILL.md +3 -3
  188. package/plugins/specweave/skills/specweave-framework/SKILL.md +2 -2
  189. package/plugins/specweave-ado/.claude-plugin/plugin.json +18 -4
  190. package/plugins/specweave-ado/agents/ado-manager/AGENT.md +426 -0
  191. package/plugins/specweave-ado/commands/close-workitem.md +52 -0
  192. package/plugins/specweave-ado/commands/create-workitem.md +53 -0
  193. package/plugins/specweave-ado/commands/status.md +53 -0
  194. package/plugins/specweave-ado/commands/sync.md +55 -0
  195. package/plugins/specweave-ado/lib/ado-client.ts +361 -0
  196. package/plugins/specweave-ado/reference/ado-specweave-mapping.md +552 -0
  197. package/plugins/specweave-ado/skills/ado-sync/SKILL.md +344 -193
  198. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +73 -0
  199. package/plugins/specweave-github/agents/github-manager/AGENT.md +49 -0
  200. package/plugins/specweave-github/commands/{github-close-issue.md → close-issue.md} +1 -1
  201. package/plugins/specweave-github/commands/{github-create-issue.md → create-issue.md} +1 -1
  202. package/plugins/specweave-github/commands/{github-status.md → status.md} +1 -1
  203. package/plugins/specweave-github/commands/{github-sync-tasks.md → sync-tasks.md} +1 -1
  204. package/plugins/specweave-github/commands/{github-sync.md → sync.md} +1 -1
  205. package/plugins/specweave-github/reference/github-specweave-mapping.md +377 -0
  206. package/plugins/specweave-github/skills/github-sync/SKILL.md +11 -3
  207. package/plugins/specweave-infrastructure/commands/{specweave.monitor-setup.md → monitor-setup.md} +5 -0
  208. package/plugins/specweave-infrastructure/commands/{specweave.slo-implement.md → slo-implement.md} +5 -0
  209. package/plugins/specweave-jira/agents/jira-manager/AGENT.md +380 -0
  210. package/plugins/specweave-jira/commands/{specweave.sync-jira.md → sync.md} +1 -1
  211. package/plugins/specweave-jira/reference/jira-specweave-mapping.md +508 -0
  212. package/plugins/specweave-ml/commands/ml-deploy.md +1 -1
  213. package/plugins/specweave-ml/commands/ml-evaluate.md +1 -1
  214. package/plugins/specweave-ml/commands/ml-explain.md +1 -1
  215. package/plugins/specweave-ml/commands/{specweave.ml-pipeline.md → ml-pipeline.md} +5 -0
  216. package/src/templates/AGENTS.md.template +331 -31
  217. package/src/templates/CLAUDE.md.template +36 -21
  218. package/src/templates/COMPLETION-REPORT.template.md +128 -0
  219. package/src/templates/README.md.template +17 -16
  220. package/src/templates/docs/README.md +11 -9
  221. package/src/templates/docs/spec-template.md +229 -0
  222. package/plugins/specweave/commands/inc.md +0 -85
  223. package/plugins/specweave/commands/list-increments.md +0 -180
  224. package/src/adapters/README.md +0 -275
  225. package/src/adapters/adapter-base.ts +0 -182
  226. package/src/adapters/adapter-interface.ts +0 -166
  227. package/src/adapters/adapter-loader.ts +0 -256
  228. package/src/adapters/agents-md-generator.ts +0 -228
  229. package/src/adapters/claude/README.md +0 -233
  230. package/src/adapters/claude/adapter.ts +0 -468
  231. package/src/adapters/claude-md-generator.ts +0 -377
  232. package/src/adapters/codex/README.md +0 -105
  233. package/src/adapters/codex/adapter.ts +0 -333
  234. package/src/adapters/cursor/.cursor/context/docs-context.md +0 -62
  235. package/src/adapters/cursor/.cursor/context/increments-context.md +0 -71
  236. package/src/adapters/cursor/.cursor/context/strategy-context.md +0 -73
  237. package/src/adapters/cursor/.cursor/context/tests-context.md +0 -89
  238. package/src/adapters/cursor/README.md +0 -283
  239. package/src/adapters/cursor/adapter.ts +0 -451
  240. package/src/adapters/doc-generator.ts +0 -331
  241. package/src/adapters/gemini/README.md +0 -97
  242. package/src/adapters/gemini/adapter.ts +0 -298
  243. package/src/adapters/generic/README.md +0 -277
  244. package/src/adapters/generic/adapter.ts +0 -378
  245. package/src/adapters/registry.yaml +0 -187
  246. /package/plugins/specweave/commands/{costs.md → specweave-costs.md} +0 -0
  247. /package/plugins/specweave/commands/{done.md → specweave-done.md} +0 -0
  248. /package/plugins/specweave/commands/{next.md → specweave-next.md} +0 -0
  249. /package/plugins/specweave/commands/{progress.md → specweave-progress.md} +0 -0
  250. /package/plugins/specweave/commands/{sync-docs.md → specweave-sync-docs.md} +0 -0
  251. /package/plugins/specweave/commands/{tdd-cycle.md → specweave-tdd-cycle.md} +0 -0
  252. /package/plugins/specweave/commands/{tdd-green.md → specweave-tdd-green.md} +0 -0
  253. /package/plugins/specweave/commands/{tdd-red.md → specweave-tdd-red.md} +0 -0
  254. /package/plugins/specweave/commands/{tdd-refactor.md → specweave-tdd-refactor.md} +0 -0
  255. /package/plugins/specweave/commands/{validate.md → specweave-validate.md} +0 -0
@@ -0,0 +1,256 @@
1
+ ---
2
+ name: sync-tasks
3
+ description: Sync tasks.md with actual completion status (GitHub issue or reality check)
4
+ ---
5
+
6
+ # Sync Tasks Status
7
+
8
+ **Purpose**: Fix tasks.md when it's out of sync with reality (GitHub issue, git history, or actual files).
9
+
10
+ **Use When**:
11
+ - `/progress` shows wrong completion %
12
+ - GitHub issue says 24/24 but tasks.md says 1/24
13
+ - After manually completing work without updating tasks.md
14
+
15
+ ---
16
+
17
+ ## How It Works
18
+
19
+ 1. **Detect Active Increment**
20
+ - Find increment in-progress
21
+ - Check if tasks.md exists
22
+
23
+ 2. **Compare Sources**
24
+ - **tasks.md**: Current status
25
+ - **GitHub issue** (if synced): Checklist status
26
+ - **Git history**: What files were actually changed/created
27
+ - **File system**: What files exist
28
+
29
+ 3. **Show Diff**
30
+ ```
31
+ Sync Status Check:
32
+
33
+ tasks.md: 5/24 complete (21%)
34
+ GitHub #4: 24/24 complete (100%) ✓ TRUTH
35
+ Git commits: 24 task commits found
36
+
37
+ Mismatch detected! tasks.md is stale.
38
+ ```
39
+
40
+ 4. **Offer Fix**
41
+ ```
42
+ Options:
43
+ 1. Auto-sync from GitHub issue (recommended)
44
+ 2. Auto-sync from git history
45
+ 3. Manual review (show each task)
46
+ 4. Cancel
47
+ ```
48
+
49
+ 5. **Update tasks.md**
50
+ - Mark completed tasks as [x]
51
+ - Update progress counters
52
+ - Commit changes
53
+
54
+ ---
55
+
56
+ ## Usage
57
+
58
+ ```bash
59
+ # Auto-detect and sync
60
+ /specweave:sync-tasks
61
+
62
+ # Sync specific increment
63
+ /specweave:sync-tasks 0007
64
+
65
+ # Force sync from GitHub (skip git check)
66
+ /specweave:sync-tasks --source=github
67
+
68
+ # Dry run (show what would change)
69
+ /specweave:sync-tasks --dry-run
70
+ ```
71
+
72
+ ---
73
+
74
+ ## Implementation Steps
75
+
76
+ ### Step 1: Find Active Increment
77
+
78
+ ```bash
79
+ ACTIVE_INCREMENT=$(find .specweave/increments -name "tasks.md" -exec grep -l "Status: In Progress" {} \; | head -1)
80
+
81
+ if [[ -z "$ACTIVE_INCREMENT" ]]; then
82
+ echo "No active increment found"
83
+ exit 0
84
+ fi
85
+
86
+ INCREMENT_DIR=$(dirname "$ACTIVE_INCREMENT")
87
+ INCREMENT_ID=$(basename "$INCREMENT_DIR" | grep -oE "^[0-9]+")
88
+ ```
89
+
90
+ ### Step 2: Get GitHub Issue Status (if exists)
91
+
92
+ ```bash
93
+ # Check if GitHub sync is enabled
94
+ GITHUB_ISSUE=$(grep "github-issue:" "$INCREMENT_DIR/spec.md" | cut -d':' -f2 | tr -d ' ')
95
+
96
+ if [[ -n "$GITHUB_ISSUE" ]]; then
97
+ # Fetch issue body
98
+ ISSUE_BODY=$(gh issue view "$GITHUB_ISSUE" --json body --jq '.body')
99
+
100
+ # Count completed checkboxes
101
+ GH_TOTAL=$(echo "$ISSUE_BODY" | grep -c "^- \[")
102
+ GH_COMPLETE=$(echo "$ISSUE_BODY" | grep -c "^- \[x\]")
103
+
104
+ echo "GitHub Issue #$GITHUB_ISSUE: $GH_COMPLETE/$GH_TOTAL complete"
105
+ else
106
+ echo "No GitHub issue linked (skipping GitHub sync)"
107
+ fi
108
+ ```
109
+
110
+ ### Step 3: Get tasks.md Status
111
+
112
+ ```bash
113
+ TASKS_TOTAL=$(grep -c "^#### T-" "$INCREMENT_DIR/tasks.md")
114
+ TASKS_COMPLETE=$(grep -A1 "^#### T-" "$INCREMENT_DIR/tasks.md" | grep -c "\*\*Status\*\*: \[x\] completed")
115
+
116
+ echo "tasks.md: $TASKS_COMPLETE/$TASKS_TOTAL complete"
117
+ ```
118
+
119
+ ### Step 4: Detect Mismatch
120
+
121
+ ```bash
122
+ if [[ "$GH_COMPLETE" -ne "$TASKS_COMPLETE" ]]; then
123
+ echo "⚠️ Mismatch detected!"
124
+ echo " GitHub: $GH_COMPLETE/$GH_TOTAL"
125
+ echo " tasks.md: $TASKS_COMPLETE/$TASKS_TOTAL"
126
+ echo ""
127
+
128
+ # Offer to sync
129
+ read -p "Sync tasks.md from GitHub issue? (y/n): " CONFIRM
130
+
131
+ if [[ "$CONFIRM" == "y" ]]; then
132
+ sync_from_github "$INCREMENT_DIR" "$GITHUB_ISSUE"
133
+ fi
134
+ else
135
+ echo "✓ tasks.md is in sync with GitHub issue"
136
+ fi
137
+ ```
138
+
139
+ ### Step 5: Sync From GitHub
140
+
141
+ ```bash
142
+ sync_from_github() {
143
+ local increment_dir="$1"
144
+ local github_issue="$2"
145
+
146
+ # Parse GitHub issue checklist
147
+ gh issue view "$github_issue" --json body --jq '.body' | while IFS= read -r line; do
148
+ if [[ "$line" =~ ^\-\ \[x\]\ (T-[0-9]{3}) ]]; then
149
+ # Task is complete in GitHub, mark in tasks.md
150
+ TASK_ID="${BASH_REMATCH[1]}"
151
+ mark_task_complete "$increment_dir" "$TASK_ID"
152
+ fi
153
+ done
154
+
155
+ # Recalculate progress
156
+ recalculate_progress "$increment_dir"
157
+
158
+ echo "✓ Synced tasks.md from GitHub issue #$github_issue"
159
+ }
160
+
161
+ mark_task_complete() {
162
+ local increment_dir="$1"
163
+ local task_id="$2"
164
+
165
+ # Find task and update status
166
+ sed -i '' "/^#### $task_id:/,/^\*\*Status\*\*:/ s/\*\*Status\*\*: \[ \] pending/\*\*Status\*\*: [x] completed/" "$increment_dir/tasks.md"
167
+ }
168
+
169
+ recalculate_progress() {
170
+ local increment_dir="$1"
171
+
172
+ local total=$(grep -c "^#### T-" "$increment_dir/tasks.md")
173
+ local completed=$(grep -A1 "^#### T-" "$increment_dir/tasks.md" | grep -c "\*\*Status\*\*: \[x\] completed")
174
+ local progress=$((completed * 100 / total))
175
+
176
+ # Update header
177
+ sed -i '' "s/\*\*Completed\*\*: [0-9]*/\*\*Completed\*\*: $completed/" "$increment_dir/tasks.md"
178
+ sed -i '' "s/\*\*Progress\*\*: [0-9]*%/\*\*Progress\*\*: $progress%/" "$increment_dir/tasks.md"
179
+
180
+ echo "✓ Progress updated: $completed/$total ($progress%)"
181
+ }
182
+ ```
183
+
184
+ ---
185
+
186
+ ## Example Output
187
+
188
+ ```
189
+ 🔄 Syncing tasks.md status...
190
+
191
+ Active Increment: 0007-smart-increment-discipline
192
+
193
+ Status Comparison:
194
+ ├─ tasks.md: 1/24 complete (4%)
195
+ ├─ GitHub #4: 24/24 complete (100%)
196
+ └─ Mismatch: 23 tasks out of sync ⚠️
197
+
198
+ Sync Source:
199
+ ✓ GitHub issue #4 (most reliable)
200
+
201
+ Updating tasks.md...
202
+ ├─ T-001: [ ] → [x] ✓
203
+ ├─ T-002: [ ] → [x] ✓
204
+ ├─ T-003: [ ] → [x] ✓
205
+ ...
206
+ └─ T-024: [ ] → [x] ✓
207
+
208
+ Progress recalculated:
209
+ ├─ Completed: 1 → 24
210
+ ├─ Progress: 4% → 100%
211
+ └─ Status: In Progress → Complete
212
+
213
+ ✓ tasks.md synced successfully!
214
+
215
+ Next: Run /progress to verify
216
+ ```
217
+
218
+ ---
219
+
220
+ ## Integration with Other Commands
221
+
222
+ ### /progress
223
+ ```bash
224
+ # Check sync status before showing progress
225
+ /sync-tasks --validate
226
+ # If out of sync, warn user
227
+ ```
228
+
229
+ ### /validate
230
+ ```bash
231
+ # Validate tasks.md is in sync
232
+ /sync-tasks --validate
233
+ # Fail validation if mismatch detected
234
+ ```
235
+
236
+ ### /done
237
+ ```bash
238
+ # Ensure tasks.md is current before closing
239
+ /sync-tasks --auto
240
+ # Auto-sync if needed, then proceed
241
+ ```
242
+
243
+ ---
244
+
245
+ ## Success Criteria
246
+
247
+ - ✅ Detects when tasks.md is out of sync
248
+ - ✅ Syncs from GitHub issue (if available)
249
+ - ✅ Syncs from git history (fallback)
250
+ - ✅ Updates progress counters accurately
251
+ - ✅ Commits changes with clear message
252
+ - ✅ Integrates with /progress, /validate, /done
253
+
254
+ ---
255
+
256
+ **This command ensures `/progress` and `/done` always show accurate status!**
@@ -257,7 +257,7 @@ If issues found, restore from git:
257
257
  - Commands: /specweave:inc, /specweave:do, /specweave:progress, /specweave:sync-docs
258
258
  - File paths: .specweave/, src/, .claude/, .cursor/, .github/
259
259
  - Technical terms: TypeScript, npm, git, API, CLI, REST, JSON, HTTP
260
- - SpecWeave keywords: living docs, context-manifest.yaml, PM gate, RFC
260
+ - SpecWeave keywords: living docs, context-manifest.yaml, PM gate, Spec
261
261
  - Code blocks (entire blocks stay in English)
262
262
  - YAML frontmatter keys (only translate values if applicable)
263
263
 
@@ -279,7 +279,7 @@ If issues found, restore from git:
279
279
  - `living docs`
280
280
  - `PM gate`, `Architect`, `Tech Lead`
281
281
  - `context-manifest`
282
- - `RFC`, `ADR`, `PRD`, `HLD`, `LLD`
282
+ - `Spec`, `ADR`, `PRD`, `HLD`, `LLD`
283
283
 
284
284
  **Why?** These are framework primitives - translating them would break tooling, scripts, and cross-project consistency.
285
285
 
@@ -304,7 +304,7 @@ If issues found, restore from git:
304
304
  ```yaml
305
305
  # Only translate description values, NOT keys
306
306
  ---
307
- name: increment-planner # ← Keep as-is
307
+ name: specweave-increment-planner # ← Keep as-is
308
308
  description: Plans new increments # ← Translate this
309
309
  allowed-tools: Read, Write, Edit # ← Keep tools as-is
310
310
  ---
@@ -0,0 +1,351 @@
1
+ ---
2
+ name: update-scope
3
+ description: Update living completion report with scope changes during increment execution
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
+ /update-scope "Added dark mode toggle (stakeholder request from CMO, +16 hours)"
54
+ ```
55
+
56
+ ### Detailed Log
57
+
58
+ ```bash
59
+ /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 /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: 'list',
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 /inc 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: 'list',
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
+ - `/inc "feature"` - Creates increment with initial completion report
346
+ - `/done <id>` - Finalizes report and marks increment complete
347
+ - `/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.
@@ -43,11 +43,11 @@ This master command routes to SpecWeave increment lifecycle subcommands.
43
43
 
44
44
  | Subcommand | Description | Example |
45
45
  |------------|-------------|---------|
46
- | **github.create-issue** | Create GitHub issue from increment | `/specweave github.create-issue 0001` |
47
- | **github.sync** | Bidirectional sync with GitHub | `/specweave github.sync 0001` |
48
- | **github.sync-tasks** | Sync tasks as GitHub sub-issues | `/specweave github.sync-tasks 0001` |
49
- | **github.close-issue** | Close GitHub issue | `/specweave github.close-issue 0001` |
50
- | **github.status** | Show GitHub sync status | `/specweave github.status` |
46
+ | **github:create-issue** | Create GitHub issue from increment | `/specweave-github:create-issue 0001` |
47
+ | **github:sync** | Bidirectional sync with GitHub | `/specweave-github:sync 0001` |
48
+ | **github:sync-tasks** | Sync tasks as GitHub sub-issues | `/specweave-github:sync-tasks 0001` |
49
+ | **github:close-issue** | Close GitHub issue | `/specweave-github:close-issue 0001` |
50
+ | **github:status** | Show GitHub sync status | `/specweave-github:status` |
51
51
 
52
52
  ---
53
53
 
@@ -73,11 +73,11 @@ subcommands:
73
73
  sync-jira: .claude/commands/specweave:sync-jira.md
74
74
 
75
75
  # GitHub Plugin Commands
76
- github.create-issue: .claude/commands/specweave-github:github-create-issue.md
77
- github.sync: .claude/commands/specweave-github:github-sync.md
78
- github.sync-tasks: .claude/commands/specweave-github:github-sync-tasks.md
79
- github.close-issue: .claude/commands/specweave-github:github-close-issue.md
80
- github.status: .claude/commands/specweave-github:github-status.md
76
+ github:create-issue: .claude/commands/specweave-github:create-issue.md
77
+ github:sync: .claude/commands/specweave-github:sync.md
78
+ github:sync-tasks: .claude/commands/specweave-github:sync-tasks.md
79
+ github:close-issue: .claude/commands/specweave-github:close-issue.md
80
+ github:status: .claude/commands/specweave-github:status.md
81
81
  ```
82
82
 
83
83
  ---
@@ -183,15 +183,15 @@ Available subcommands:
183
183
  sync-docs - Sync documentation (review/update)
184
184
 
185
185
  GitHub Plugin:
186
- github.create-issue - Create GitHub issue from increment
187
- github.sync - Bidirectional sync with GitHub
188
- github.sync-tasks - Sync tasks as GitHub sub-issues
189
- github.close-issue - Close GitHub issue
190
- github.status - Show GitHub sync status
186
+ github:create-issue - Create GitHub issue from increment
187
+ github:sync - Bidirectional sync with GitHub
188
+ github:sync-tasks - Sync tasks as GitHub sub-issues
189
+ github:close-issue - Close GitHub issue
190
+ github:status - Show GitHub sync status
191
191
 
192
192
  Usage: /specweave <subcommand> [arguments]
193
193
  Example: /specweave inc "User authentication"
194
- Example: /specweave github.create-issue 0001
194
+ Example: /specweave-github:create-issue 0001
195
195
  ```
196
196
 
197
197
  ---
@@ -433,11 +433,11 @@ Project Setup:
433
433
  sync-docs [mode] [id] - Sync documentation (review/update)
434
434
 
435
435
  GitHub Plugin:
436
- github.create-issue <id> - Create GitHub issue from increment
437
- github.sync <id> - Bidirectional sync with GitHub
438
- github.sync-tasks <id> - Sync tasks as GitHub sub-issues
439
- github.close-issue <id> - Close GitHub issue
440
- github.status - Show GitHub sync status
436
+ github:create-issue <id> - Create GitHub issue from increment
437
+ github:sync <id> - Bidirectional sync with GitHub
438
+ github:sync-tasks <id> - Sync tasks as GitHub sub-issues
439
+ github:close-issue <id> - Close GitHub issue
440
+ github:status - Show GitHub sync status
441
441
 
442
442
  Examples:
443
443
  /specweave inc "User authentication"