specweave 0.6.7 → 0.7.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.
Files changed (281) hide show
  1. package/.claude-plugin/README.md +1 -1
  2. package/CLAUDE.md +920 -107
  3. package/README.md +143 -207
  4. package/bin/specweave.js +67 -0
  5. package/dist/adapters/adapter-interface.d.ts +11 -11
  6. package/dist/adapters/adapter-interface.d.ts.map +1 -1
  7. package/dist/adapters/adapter-interface.js +1 -1
  8. package/dist/adapters/adapter-loader.d.ts +1 -2
  9. package/dist/adapters/adapter-loader.d.ts.map +1 -1
  10. package/dist/adapters/adapter-loader.js +3 -6
  11. package/dist/adapters/adapter-loader.js.map +1 -1
  12. package/dist/adapters/agents-md-generator.d.ts +3 -3
  13. package/dist/adapters/agents-md-generator.js +3 -3
  14. package/dist/adapters/generic/adapter.d.ts +2 -2
  15. package/dist/adapters/generic/adapter.d.ts.map +1 -1
  16. package/dist/adapters/generic/adapter.js +28 -9
  17. package/dist/adapters/generic/adapter.js.map +1 -1
  18. package/dist/cli/commands/abandon.d.ts +13 -0
  19. package/dist/cli/commands/abandon.d.ts.map +1 -0
  20. package/dist/cli/commands/abandon.js +15 -0
  21. package/dist/cli/commands/abandon.js.map +1 -0
  22. package/dist/cli/commands/init.d.ts.map +1 -1
  23. package/dist/cli/commands/init.js +141 -40
  24. package/dist/cli/commands/init.js.map +1 -1
  25. package/dist/cli/commands/pause.d.ts +13 -0
  26. package/dist/cli/commands/pause.d.ts.map +1 -0
  27. package/dist/cli/commands/pause.js +15 -0
  28. package/dist/cli/commands/pause.js.map +1 -0
  29. package/dist/cli/commands/qa.d.ts +54 -0
  30. package/dist/cli/commands/qa.d.ts.map +1 -0
  31. package/dist/cli/commands/qa.js +98 -0
  32. package/dist/cli/commands/qa.js.map +1 -0
  33. package/dist/cli/commands/resume.d.ts +12 -0
  34. package/dist/cli/commands/resume.d.ts.map +1 -0
  35. package/dist/cli/commands/resume.js +14 -0
  36. package/dist/cli/commands/resume.js.map +1 -0
  37. package/dist/cli/commands/status.d.ts +12 -0
  38. package/dist/cli/commands/status.d.ts.map +1 -0
  39. package/dist/cli/commands/status.js +23 -0
  40. package/dist/cli/commands/status.js.map +1 -0
  41. package/dist/cli/helpers/issue-tracker/ado.d.ts +57 -0
  42. package/dist/cli/helpers/issue-tracker/ado.d.ts.map +1 -0
  43. package/dist/cli/helpers/issue-tracker/ado.js +223 -0
  44. package/dist/cli/helpers/issue-tracker/ado.js.map +1 -0
  45. package/dist/cli/helpers/issue-tracker/github.d.ts +65 -0
  46. package/dist/cli/helpers/issue-tracker/github.d.ts.map +1 -0
  47. package/dist/cli/helpers/issue-tracker/github.js +284 -0
  48. package/dist/cli/helpers/issue-tracker/github.js.map +1 -0
  49. package/dist/cli/helpers/issue-tracker/index.d.ts +22 -0
  50. package/dist/cli/helpers/issue-tracker/index.d.ts.map +1 -0
  51. package/dist/cli/helpers/issue-tracker/index.js +270 -0
  52. package/dist/cli/helpers/issue-tracker/index.js.map +1 -0
  53. package/dist/cli/helpers/issue-tracker/jira.d.ts +61 -0
  54. package/dist/cli/helpers/issue-tracker/jira.d.ts.map +1 -0
  55. package/dist/cli/helpers/issue-tracker/jira.js +265 -0
  56. package/dist/cli/helpers/issue-tracker/jira.js.map +1 -0
  57. package/dist/cli/helpers/issue-tracker/types.d.ts +86 -0
  58. package/dist/cli/helpers/issue-tracker/types.d.ts.map +1 -0
  59. package/dist/cli/helpers/issue-tracker/types.js +16 -0
  60. package/dist/cli/helpers/issue-tracker/types.js.map +1 -0
  61. package/dist/cli/helpers/issue-tracker/utils.d.ts +103 -0
  62. package/dist/cli/helpers/issue-tracker/utils.d.ts.map +1 -0
  63. package/dist/cli/helpers/issue-tracker/utils.js +240 -0
  64. package/dist/cli/helpers/issue-tracker/utils.js.map +1 -0
  65. package/dist/core/increment/limits.d.ts +68 -0
  66. package/dist/core/increment/limits.d.ts.map +1 -0
  67. package/dist/core/increment/limits.js +224 -0
  68. package/dist/core/increment/limits.js.map +1 -0
  69. package/dist/core/increment/metadata-manager.d.ts +114 -0
  70. package/dist/core/increment/metadata-manager.d.ts.map +1 -0
  71. package/dist/core/increment/metadata-manager.js +320 -0
  72. package/dist/core/increment/metadata-manager.js.map +1 -0
  73. package/dist/core/increment/status-commands.d.ts +43 -0
  74. package/dist/core/increment/status-commands.d.ts.map +1 -0
  75. package/dist/core/increment/status-commands.js +277 -0
  76. package/dist/core/increment/status-commands.js.map +1 -0
  77. package/dist/core/plugin-detector.d.ts +1 -0
  78. package/dist/core/plugin-detector.d.ts.map +1 -1
  79. package/dist/core/plugin-detector.js +25 -0
  80. package/dist/core/plugin-detector.js.map +1 -1
  81. package/dist/core/qa/qa-runner.d.ts +16 -0
  82. package/dist/core/qa/qa-runner.d.ts.map +1 -0
  83. package/dist/core/qa/qa-runner.js +404 -0
  84. package/dist/core/qa/qa-runner.js.map +1 -0
  85. package/dist/core/qa/quality-gate-decider.d.ts +53 -0
  86. package/dist/core/qa/quality-gate-decider.d.ts.map +1 -0
  87. package/dist/core/qa/quality-gate-decider.js +268 -0
  88. package/dist/core/qa/quality-gate-decider.js.map +1 -0
  89. package/dist/core/qa/risk-calculator.d.ts +126 -0
  90. package/dist/core/qa/risk-calculator.d.ts.map +1 -0
  91. package/dist/core/qa/risk-calculator.js +247 -0
  92. package/dist/core/qa/risk-calculator.js.map +1 -0
  93. package/dist/core/qa/types.d.ts +315 -0
  94. package/dist/core/qa/types.d.ts.map +1 -0
  95. package/dist/core/qa/types.js +8 -0
  96. package/dist/core/qa/types.js.map +1 -0
  97. package/dist/core/types/config.d.ts +37 -2
  98. package/dist/core/types/config.d.ts.map +1 -1
  99. package/dist/core/types/config.js +16 -0
  100. package/dist/core/types/config.js.map +1 -1
  101. package/dist/core/types/increment-metadata.d.ts +120 -0
  102. package/dist/core/types/increment-metadata.d.ts.map +1 -0
  103. package/dist/core/types/increment-metadata.js +138 -0
  104. package/dist/core/types/increment-metadata.js.map +1 -0
  105. package/dist/hooks/lib/invoke-translator-skill.d.ts +60 -0
  106. package/dist/hooks/lib/invoke-translator-skill.d.ts.map +1 -0
  107. package/dist/hooks/lib/invoke-translator-skill.js +201 -0
  108. package/dist/hooks/lib/invoke-translator-skill.js.map +1 -0
  109. package/dist/hooks/lib/translate-file.d.ts +59 -0
  110. package/dist/hooks/lib/translate-file.d.ts.map +1 -0
  111. package/dist/hooks/lib/translate-file.js +350 -0
  112. package/dist/hooks/lib/translate-file.js.map +1 -0
  113. package/dist/locales/en/cli.json +3 -1
  114. package/dist/metrics/calculators/change-failure-rate.d.ts +22 -0
  115. package/dist/metrics/calculators/change-failure-rate.d.ts.map +1 -0
  116. package/dist/metrics/calculators/change-failure-rate.js +70 -0
  117. package/dist/metrics/calculators/change-failure-rate.js.map +1 -0
  118. package/dist/metrics/calculators/deployment-frequency.d.ts +20 -0
  119. package/dist/metrics/calculators/deployment-frequency.d.ts.map +1 -0
  120. package/dist/metrics/calculators/deployment-frequency.js +61 -0
  121. package/dist/metrics/calculators/deployment-frequency.js.map +1 -0
  122. package/dist/metrics/calculators/lead-time.d.ts +22 -0
  123. package/dist/metrics/calculators/lead-time.d.ts.map +1 -0
  124. package/dist/metrics/calculators/lead-time.js +82 -0
  125. package/dist/metrics/calculators/lead-time.js.map +1 -0
  126. package/dist/metrics/calculators/mttr.d.ts +21 -0
  127. package/dist/metrics/calculators/mttr.d.ts.map +1 -0
  128. package/dist/metrics/calculators/mttr.js +60 -0
  129. package/dist/metrics/calculators/mttr.js.map +1 -0
  130. package/dist/metrics/dora-calculator.d.ts +24 -0
  131. package/dist/metrics/dora-calculator.d.ts.map +1 -0
  132. package/dist/metrics/dora-calculator.js +104 -0
  133. package/dist/metrics/dora-calculator.js.map +1 -0
  134. package/dist/metrics/github-client.d.ts +51 -0
  135. package/dist/metrics/github-client.d.ts.map +1 -0
  136. package/dist/metrics/github-client.js +133 -0
  137. package/dist/metrics/github-client.js.map +1 -0
  138. package/dist/metrics/types.d.ts +112 -0
  139. package/dist/metrics/types.d.ts.map +1 -0
  140. package/dist/metrics/types.js +10 -0
  141. package/dist/metrics/types.js.map +1 -0
  142. package/dist/metrics/utils/percentile.d.ts +25 -0
  143. package/dist/metrics/utils/percentile.d.ts.map +1 -0
  144. package/dist/metrics/utils/percentile.js +46 -0
  145. package/dist/metrics/utils/percentile.js.map +1 -0
  146. package/dist/metrics/utils/tier-classifier.d.ts +61 -0
  147. package/dist/metrics/utils/tier-classifier.d.ts.map +1 -0
  148. package/dist/metrics/utils/tier-classifier.js +100 -0
  149. package/dist/metrics/utils/tier-classifier.js.map +1 -0
  150. package/dist/utils/auth-helpers.d.ts +58 -0
  151. package/dist/utils/auth-helpers.d.ts.map +1 -0
  152. package/dist/utils/auth-helpers.js +108 -0
  153. package/dist/utils/auth-helpers.js.map +1 -0
  154. package/dist/utils/env-file.d.ts +88 -0
  155. package/dist/utils/env-file.d.ts.map +1 -0
  156. package/dist/utils/env-file.js +180 -0
  157. package/dist/utils/env-file.js.map +1 -0
  158. package/dist/utils/plugin-detection.d.ts +50 -0
  159. package/dist/utils/plugin-detection.d.ts.map +1 -0
  160. package/dist/utils/plugin-detection.js +229 -0
  161. package/dist/utils/plugin-detection.js.map +1 -0
  162. package/dist/utils/secrets-loader.d.ts +88 -0
  163. package/dist/utils/secrets-loader.d.ts.map +1 -0
  164. package/dist/utils/secrets-loader.js +271 -0
  165. package/dist/utils/secrets-loader.js.map +1 -0
  166. package/dist/utils/translation.d.ts +187 -0
  167. package/dist/utils/translation.d.ts.map +1 -0
  168. package/dist/utils/translation.js +414 -0
  169. package/dist/utils/translation.js.map +1 -0
  170. package/package.json +28 -44
  171. package/plugins/specweave/.claude-plugin/plugin.json +3 -3
  172. package/plugins/specweave/agents/pm/AGENT.md +330 -54
  173. package/plugins/specweave/agents/test-aware-planner/AGENT.md +1035 -0
  174. package/plugins/specweave/agents/test-aware-planner/templates/README.md +118 -0
  175. package/plugins/specweave/agents/test-aware-planner/templates/task-non-testable.md.template +24 -0
  176. package/plugins/specweave/agents/test-aware-planner/templates/task-testable.md.template +53 -0
  177. package/plugins/specweave/agents/test-aware-planner/templates/tasks-frontmatter.md.template +11 -0
  178. package/plugins/specweave/commands/README.md +88 -163
  179. package/plugins/specweave/commands/specweave-abandon.md +314 -0
  180. package/plugins/specweave/commands/specweave-check-tests.md +546 -0
  181. package/plugins/specweave/commands/{do.md → specweave-do.md} +5 -5
  182. package/plugins/specweave/commands/{done.md → specweave-done.md} +2 -0
  183. package/plugins/specweave/commands/{increment.md → specweave-increment.md} +231 -4
  184. package/plugins/specweave/commands/specweave-pause.md +189 -0
  185. package/plugins/specweave/commands/specweave-qa.md +245 -0
  186. package/plugins/specweave/commands/specweave-resume.md +216 -0
  187. package/plugins/specweave/commands/specweave-status.md +397 -0
  188. package/plugins/specweave/commands/specweave-sync-tasks.md +256 -0
  189. package/plugins/specweave/commands/{translate.md → specweave-translate.md} +3 -3
  190. package/plugins/specweave/commands/specweave-update-scope.md +351 -0
  191. package/plugins/specweave/commands/{validate.md → specweave-validate.md} +2 -0
  192. package/plugins/specweave/commands/specweave.md +21 -21
  193. package/plugins/specweave/hooks/docs-changed.sh +23 -3
  194. package/plugins/specweave/hooks/human-input-required.sh +23 -3
  195. package/plugins/specweave/hooks/post-increment-planning.sh +335 -0
  196. package/plugins/specweave/hooks/post-task-completion.sh +161 -1
  197. package/plugins/specweave/hooks/pre-implementation.sh +23 -3
  198. package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
  199. package/plugins/specweave/skills/brownfield-analyzer/SKILL.md +9 -9
  200. package/plugins/specweave/skills/increment-planner/SKILL.md +400 -212
  201. package/plugins/specweave/skills/increment-quality-judge-v2/SKILL.md +499 -0
  202. package/plugins/specweave/skills/plugin-detector/SKILL.md +114 -1
  203. package/plugins/specweave/skills/project-kickstarter/SKILL.md +74 -1
  204. package/plugins/specweave/skills/{rfc-generator → spec-generator}/SKILL.md +22 -29
  205. package/plugins/specweave/skills/specweave-detector/SKILL.md +3 -3
  206. package/plugins/specweave/skills/specweave-framework/SKILL.md +2 -2
  207. package/plugins/specweave-ado/.claude-plugin/plugin.json +18 -4
  208. package/plugins/specweave-ado/agents/ado-manager/AGENT.md +426 -0
  209. package/plugins/specweave-ado/commands/close-workitem.md +52 -0
  210. package/plugins/specweave-ado/commands/create-workitem.md +53 -0
  211. package/plugins/specweave-ado/commands/status.md +53 -0
  212. package/plugins/specweave-ado/commands/sync.md +55 -0
  213. package/plugins/specweave-ado/lib/ado-client.ts +361 -0
  214. package/plugins/specweave-ado/reference/ado-specweave-mapping.md +552 -0
  215. package/plugins/specweave-ado/skills/ado-sync/SKILL.md +344 -193
  216. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +73 -0
  217. package/plugins/specweave-github/agents/github-manager/AGENT.md +49 -0
  218. package/plugins/specweave-github/commands/{github-close-issue.md → close-issue.md} +1 -1
  219. package/plugins/specweave-github/commands/{github-create-issue.md → create-issue.md} +1 -1
  220. package/plugins/specweave-github/commands/{github-status.md → status.md} +1 -1
  221. package/plugins/specweave-github/commands/{github-sync-tasks.md → sync-tasks.md} +1 -1
  222. package/plugins/specweave-github/commands/{github-sync.md → sync.md} +1 -1
  223. package/plugins/specweave-github/reference/github-specweave-mapping.md +377 -0
  224. package/plugins/specweave-github/skills/github-sync/SKILL.md +11 -3
  225. package/plugins/specweave-infrastructure/commands/{specweave.monitor-setup.md → monitor-setup.md} +5 -0
  226. package/plugins/specweave-infrastructure/commands/{specweave.slo-implement.md → slo-implement.md} +5 -0
  227. package/plugins/specweave-jira/agents/jira-manager/AGENT.md +380 -0
  228. package/plugins/specweave-jira/commands/{specweave.sync-jira.md → sync.md} +1 -1
  229. package/plugins/specweave-jira/reference/jira-specweave-mapping.md +508 -0
  230. package/plugins/specweave-ml/commands/ml-deploy.md +1 -1
  231. package/plugins/specweave-ml/commands/ml-evaluate.md +1 -1
  232. package/plugins/specweave-ml/commands/ml-explain.md +1 -1
  233. package/plugins/specweave-ml/commands/{specweave.ml-pipeline.md → ml-pipeline.md} +5 -0
  234. package/src/templates/AGENTS.md.template +652 -1
  235. package/src/templates/CLAUDE.md.template +36 -21
  236. package/src/templates/COMPLETION-REPORT.template.md +128 -0
  237. package/src/templates/README.md.template +17 -16
  238. package/src/templates/docs/README.md +11 -9
  239. package/src/templates/docs/spec-template.md +229 -0
  240. package/dist/adapters/copilot/adapter.d.ts +0 -86
  241. package/dist/adapters/copilot/adapter.d.ts.map +0 -1
  242. package/dist/adapters/copilot/adapter.js +0 -396
  243. package/dist/adapters/copilot/adapter.js.map +0 -1
  244. package/plugins/.specweave/logs/hooks-debug.log +0 -24
  245. package/plugins/.specweave/logs/last-hook-fire +0 -1
  246. package/plugins/.specweave/logs/last-todowrite-time +0 -1
  247. package/plugins/.specweave/logs/tasks.log +0 -6
  248. package/plugins/specweave/commands/inc.md +0 -85
  249. package/plugins/specweave/commands/list-increments.md +0 -180
  250. package/src/adapters/README.md +0 -311
  251. package/src/adapters/adapter-base.ts +0 -182
  252. package/src/adapters/adapter-interface.ts +0 -166
  253. package/src/adapters/adapter-loader.ts +0 -259
  254. package/src/adapters/agents-md-generator.ts +0 -228
  255. package/src/adapters/claude/README.md +0 -233
  256. package/src/adapters/claude/adapter.ts +0 -468
  257. package/src/adapters/claude-md-generator.ts +0 -377
  258. package/src/adapters/codex/README.md +0 -105
  259. package/src/adapters/codex/adapter.ts +0 -333
  260. package/src/adapters/copilot/README.md +0 -240
  261. package/src/adapters/copilot/adapter.ts +0 -444
  262. package/src/adapters/cursor/.cursor/context/docs-context.md +0 -62
  263. package/src/adapters/cursor/.cursor/context/increments-context.md +0 -71
  264. package/src/adapters/cursor/.cursor/context/strategy-context.md +0 -73
  265. package/src/adapters/cursor/.cursor/context/tests-context.md +0 -89
  266. package/src/adapters/cursor/README.md +0 -283
  267. package/src/adapters/cursor/adapter.ts +0 -451
  268. package/src/adapters/doc-generator.ts +0 -331
  269. package/src/adapters/gemini/README.md +0 -97
  270. package/src/adapters/gemini/adapter.ts +0 -298
  271. package/src/adapters/generic/README.md +0 -277
  272. package/src/adapters/generic/adapter.ts +0 -359
  273. package/src/adapters/registry.yaml +0 -187
  274. /package/plugins/specweave/commands/{costs.md → specweave-costs.md} +0 -0
  275. /package/plugins/specweave/commands/{next.md → specweave-next.md} +0 -0
  276. /package/plugins/specweave/commands/{progress.md → specweave-progress.md} +0 -0
  277. /package/plugins/specweave/commands/{sync-docs.md → specweave-sync-docs.md} +0 -0
  278. /package/plugins/specweave/commands/{tdd-cycle.md → specweave-tdd-cycle.md} +0 -0
  279. /package/plugins/specweave/commands/{tdd-green.md → specweave-tdd-green.md} +0 -0
  280. /package/plugins/specweave/commands/{tdd-red.md → specweave-tdd-red.md} +0 -0
  281. /package/plugins/specweave/commands/{tdd-refactor.md → specweave-tdd-refactor.md} +0 -0
package/CLAUDE.md CHANGED
@@ -31,10 +31,9 @@ Users receive a different CLAUDE.md via the template system.
31
31
 
32
32
  ✅ CORRECT - INCREMENT FOLDERS:
33
33
  .specweave/increments/0004-plugin-architecture/
34
- ├── spec.md # Spec files (core 4)
34
+ ├── spec.md # Spec files (core 3)
35
35
  ├── plan.md
36
- ├── tasks.md
37
- ├── tests.md
36
+ ├── tasks.md # Tasks with embedded tests
38
37
  ├── reports/ # ✅ PUT REPORTS HERE!
39
38
  │ ├── PLUGIN-MIGRATION-COMPLETE.md # ✅ Completion reports
40
39
  │ ├── SESSION-SUMMARY.md # ✅ Session summaries
@@ -94,22 +93,21 @@ Claude Code isn't just another AI coding assistant - **Anthropic defines the ind
94
93
 
95
94
  ### Why SpecWeave + Claude Code = 10x Better
96
95
 
97
- | Feature | Claude Code (Native) | Cursor 2.0 | Copilot | Generic |
98
- |---------|---------------------|------------|---------|---------|
99
- | **Living Docs** | ✅ Auto-sync via hooks | ❌ Manual | ❌ Manual | ❌ Manual |
100
- | **Skills** | ✅ Auto-activate | 🟡 Must @mention | ❌ None | ❌ None |
101
- | **Commands** | ✅ Plugin-based `/specweave:*` | 🟡 Team commands | ❌ None | ❌ None |
102
- | **Hooks** | ✅ Pre/Post lifecycle | ❌ No hooks | ❌ No hooks | ❌ No hooks |
103
- | **Agents** | ✅ Isolated contexts | 🟡 Shared (8 parallel) | ❌ None | ❌ None |
104
- | **Context** | ✅ MCP + 60-80% reduction | 🟡 @ shortcuts | ❌ Limited | ❌ None |
105
- | **Quality** | ⭐⭐⭐⭐⭐ 100% | ⭐⭐⭐⭐ 85% | ⭐⭐⭐ 60% | ⭐⭐ 40% |
96
+ | Feature | Claude Code (Native) | Cursor 2.0 | Other (Copilot, ChatGPT, etc.) |
97
+ |---------|---------------------|------------|-------------------------------|
98
+ | **Living Docs** | ✅ Auto-sync via hooks | ❌ Manual | ❌ Manual |
99
+ | **Skills** | ✅ Auto-activate | 🟡 Must @mention | ❌ None |
100
+ | **Commands** | ✅ Plugin-based `/specweave:*` | 🟡 Team commands | ❌ None |
101
+ | **Hooks** | ✅ Pre/Post lifecycle | ❌ No hooks | ❌ No hooks |
102
+ | **Agents** | ✅ Isolated contexts | 🟡 Shared (8 parallel) | ❌ None |
103
+ | **Context** | ✅ MCP + 60-80% reduction | 🟡 @ shortcuts | ❌ High usage |
104
+ | **Quality** | ⭐⭐⭐⭐⭐ 100% Reliable | ⭐⭐⭐ 60% Less reliable | ⭐⭐ 40% Manual workflow |
106
105
 
107
106
  **Quick Comparison**:
108
107
 
109
- **Claude Code** - Full automation with native hooks, MCP protocol, plugin system, isolated agent contexts
110
- **Cursor 2.0** - Good multi-tool support (AGENTS.md compilation, team commands, @ shortcuts) but no hooks or agent isolation
111
- **Copilot** - Basic instructions.md support, no automation features
112
- **Generic** - Manual copy-paste workflow
108
+ **Claude Code** - Full automation with native hooks, MCP protocol, plugin system, isolated agent contexts. **ONLY fully reliable option.**
109
+ **Cursor 2.0** - Partial support (AGENTS.md compilation, team commands, @ shortcuts) but no hooks, no agent isolation, less reliable than Claude
110
+ **Other (Copilot, ChatGPT, Gemini)** - Manual workflow, high context usage, AGENTS.md support but no automation, least reliable
113
111
 
114
112
  **The Key Differentiator**: Only Claude Code supports **automated living docs** via native hooks. After EVERY task completion, docs sync automatically - zero manual intervention. This is why SpecWeave is designed Claude Code-first, though it gracefully degrades to other tools.
115
113
 
@@ -138,11 +136,11 @@ Claude Code isn't just another AI coding assistant - **Anthropic defines the ind
138
136
  **When Creating Increments**:
139
137
  ```bash
140
138
  # ❌ Wrong
141
- /specweave:inc "0004"
139
+ /specweave:increment "0004"
142
140
 
143
141
  # ✅ Correct
144
- /specweave:inc "0004-cost-optimization"
145
- /specweave:inc "0005-github-sync-enhancements"
142
+ /specweave:increment "0004-cost-optimization"
143
+ /specweave:increment "0005-github-sync-enhancements"
146
144
  ```
147
145
 
148
146
  **Enforcement**:
@@ -158,7 +156,79 @@ Claude Code isn't just another AI coding assistant - **Anthropic defines the ind
158
156
 
159
157
  ---
160
158
 
161
- ## Increment Discipline (v0.6.0+ MANDATORY)
159
+ ## Increment Discipline
160
+
161
+ ### Core Philosophy: **ONE Active Increment = Maximum Focus**
162
+
163
+ Simplified from complex per-type limits to **focus-first architecture**:
164
+ - ✅ **Default**: 1 active increment (maximum productivity)
165
+ - ✅ **Emergency ceiling**: 2 active max (hotfix/bug can interrupt)
166
+ - ✅ **Hard cap**: Never >2 active (enforced)
167
+
168
+ **Why 1?** Research shows:
169
+ - 1 task = 100% productivity
170
+ - 2 tasks = 20% slower (context switching cost)
171
+ - 3+ tasks = 40% slower + more bugs
172
+
173
+ ### What is an Increment?
174
+
175
+ **An increment can be any type of work**, not just features. SpecWeave supports six increment types:
176
+
177
+ | Type | Description | Use When | Can Interrupt? | Examples |
178
+ |------|-------------|----------|----------------|----------|
179
+ | **feature** | Standard feature development | Adding new functionality | No | User authentication, payment integration, real-time chat |
180
+ | **hotfix** | Critical production fixes | Production is broken | ✅ Yes (emergency) | Security patch, critical bug causing downtime |
181
+ | **bug** | Production bugs with SRE investigation | Bug requires root cause analysis | ✅ Yes (emergency) | Memory leak investigation, performance degradation |
182
+ | **change-request** | Stakeholder requests | Business requirements change | No | UI redesign per stakeholder feedback, API contract changes |
183
+ | **refactor** | Code improvement | Technical debt, code quality | No | Extract service layer, migrate to TypeScript, improve test coverage |
184
+ | **experiment** | POC/spike work | Exploring options, prototypes | No* | Evaluate GraphQL vs REST, test new library, architecture spike |
185
+
186
+ **Notes**:
187
+ - **Experiments auto-abandon** after 14 days of inactivity (prevents accumulation of stale POCs)
188
+ - **Types are for tracking**, not separate limits (git log shows hotfixes vs features)
189
+ - **Single simple rule**: 1 active, allow 2 for emergencies only
190
+
191
+ **Key Insight**: The increment structure (spec.md, plan.md, tasks.md) works for ALL types. A bug investigation still needs:
192
+ - **spec.md**: What's broken? Why? What's the expected behavior?
193
+ - **plan.md**: How to investigate? What tools? What hypothesis?
194
+ - **tasks.md**: Investigation steps, fix implementation, verification tests
195
+
196
+ ### WIP Limits
197
+
198
+ **Configuration** (`.specweave/config.json`):
199
+ ```json
200
+ {
201
+ "limits": {
202
+ "maxActiveIncrements": 1, // Default: 1 active (focus)
203
+ "hardCap": 2, // Emergency ceiling (never exceeded)
204
+ "allowEmergencyInterrupt": true, // hotfix/bug can interrupt
205
+ "typeBehaviors": {
206
+ "canInterrupt": ["hotfix", "bug"], // Emergency types
207
+ "autoAbandonDays": {
208
+ "experiment": 14 // Auto-abandon stale experiments
209
+ }
210
+ }
211
+ }
212
+ }
213
+ ```
214
+
215
+ **Enforcement**:
216
+ - **0 active** → Create new (no warnings)
217
+ - **1 active** → Warn about context switching (allow with confirmation)
218
+ - **2 active** → HARD BLOCK (must complete or pause one first)
219
+
220
+ **Exception**: Hotfix/bug can interrupt to start 2nd active (emergency only)
221
+
222
+ **Multiple hotfixes?** Combine into ONE increment:
223
+ ```bash
224
+ # ❌ Wrong: Multiple hotfix increments
225
+ 0009-sql-injection-fix
226
+ 0010-xss-vulnerability-fix
227
+ 0011-csrf-token-fix
228
+
229
+ # ✅ Right: Combined hotfix increment
230
+ 0009-security-fixes (SQL + XSS + CSRF)
231
+ ```
162
232
 
163
233
  **⛔ THE IRON RULE: You CANNOT start increment N+1 until increment N is DONE**
164
234
 
@@ -166,14 +236,14 @@ This is **NOT negotiable**. It is a **hard enforcement** to prevent chaos, scope
166
236
 
167
237
  ### Why This Rule Exists
168
238
 
169
- **The Problem (before v0.6.0)**:
239
+ **The Problem**:
170
240
  - Multiple incomplete increments piling up (0002, 0003, 0006 all in progress)
171
241
  - No clear source of truth ("which increment are we working on?")
172
242
  - Living docs become stale (sync doesn't know what's current)
173
243
  - Scope creep (jumping between features without finishing)
174
244
  - Quality degradation (tests not run, docs not updated)
175
245
 
176
- **The Solution (v0.6.0+)**:
246
+ **The Solution**:
177
247
  - ✅ **Hard block** on `/specweave:inc` if previous increments incomplete
178
248
  - ✅ **Helper commands** to close increments properly
179
249
  - ✅ **Clear guidance** on how to resolve incomplete work
@@ -192,7 +262,7 @@ An increment is DONE if **ONE** of the following is true:
192
262
  **When you try to start a new increment**:
193
263
 
194
264
  ```bash
195
- /specweave:inc "new feature"
265
+ /specweave:increment "new feature"
196
266
  ```
197
267
 
198
268
  **If previous increments are incomplete, you'll see**:
@@ -242,7 +312,7 @@ Previous increments are incomplete:
242
312
  /specweave:do
243
313
 
244
314
  # Once all tasks done, it's automatically complete
245
- /specweave:inc "new feature" # ✅ Now works!
315
+ /specweave:increment "new feature" # ✅ Now works!
246
316
  ```
247
317
 
248
318
  #### Option 2: Close Interactively
@@ -275,7 +345,7 @@ Previous increments are incomplete:
275
345
 
276
346
  ```bash
277
347
  # Bypass the check (USE SPARINGLY!)
278
- /specweave:inc "urgent-hotfix" --force
348
+ /specweave:increment "urgent-hotfix" --force
279
349
 
280
350
  # This is logged and should be explained in the next standup/PR
281
351
  ```
@@ -292,7 +362,7 @@ Remove parts from `spec.md`, regenerate `plan.md` and `tasks.md` to match reduce
292
362
  # 1. Edit spec.md - remove features you're not doing
293
363
  # 2. Delete plan.md and tasks.md
294
364
  # 3. Regenerate from spec
295
- /specweave:inc "same increment" --regenerate
365
+ /specweave:increment "same increment" --regenerate
296
366
 
297
367
  # Now tasks match reduced scope → 100% complete!
298
368
  ```
@@ -364,16 +434,16 @@ Result: Clean increments, clear progress, shipping regularly
364
434
 
365
435
  **Scenario**: You have 0002 at 73% complete, want to start 0006.
366
436
 
367
- **Before v0.6.0** (broken):
437
+ **Old approach** (broken):
368
438
  ```bash
369
- /specweave:inc "0006-i18n"
439
+ /specweave:increment "0006-i18n"
370
440
  # ✅ Creates 0006 (no check)
371
441
  # Result: 0002, 0003, 0006 all incomplete
372
442
  ```
373
443
 
374
- **After v0.6.0** (disciplined):
444
+ **Current approach** (disciplined):
375
445
  ```bash
376
- /specweave:inc "0006-i18n"
446
+ /specweave:increment "0006-i18n"
377
447
  # ❌ Blocked! "Close 0002 and 0003 first"
378
448
 
379
449
  # Check status
@@ -386,7 +456,7 @@ Result: Clean increments, clear progress, shipping regularly
386
456
  # Select 0003 → Move tasks to 0007 (defer work)
387
457
 
388
458
  # Now can proceed
389
- /specweave:inc "0006-i18n"
459
+ /specweave:increment "0006-i18n"
390
460
  # ✅ Works! Clean slate, disciplined workflow
391
461
  ```
392
462
 
@@ -395,7 +465,7 @@ Result: Clean increments, clear progress, shipping regularly
395
465
  For **emergencies only** (hotfixes, urgent features):
396
466
 
397
467
  ```bash
398
- /specweave:inc "urgent-security-fix" --force
468
+ /specweave:increment "urgent-security-fix" --force
399
469
  ```
400
470
 
401
471
  **This bypasses the check** but:
@@ -412,6 +482,164 @@ For **emergencies only** (hotfixes, urgent features):
412
482
 
413
483
  ---
414
484
 
485
+ ## Test-Aware Planning
486
+
487
+ **MAJOR ARCHITECTURE CHANGE**: Tests are now embedded in tasks.md instead of separate tests.md file.
488
+
489
+ ### Why the Change?
490
+
491
+ **OLD Format**:
492
+ - ❌ Separate tests.md file (duplication, sync issues)
493
+ - ❌ Manual TC-ID management (TC-001, TC-002, etc.)
494
+ - ❌ No BDD format (hard to understand test intent)
495
+ - ❌ Tests disconnected from tasks (traceability gaps)
496
+
497
+ **NEW Format**:
498
+ - ✅ Tests embedded in tasks.md (single source of truth)
499
+ - ✅ BDD format (Given/When/Then - clear intent)
500
+ - ✅ AC-ID traceability (spec.md → tasks.md → tests)
501
+ - ✅ Test-first workflow (TDD supported naturally)
502
+ - ✅ Coverage targets per task (realistic 80-90%, not 100%)
503
+
504
+ ### Quick Workflow Example
505
+
506
+ **Step 1: Create increment** → PM agent generates spec.md with user stories and AC-IDs:
507
+
508
+ ```bash
509
+ /specweave:increment "Add user authentication" # → generates spec.md with AC-US1-01, AC-US1-02, etc.
510
+ ```
511
+
512
+ **spec.md excerpt** (acceptance criteria with AC-IDs):
513
+
514
+ ### US1: Basic Login Flow
515
+ **Acceptance Criteria**:
516
+ - [ ] **AC-US1-01**: User can log in with valid email/password (P1, testable)
517
+ - [ ] **AC-US1-02**: Invalid credentials show error (P1, testable)
518
+ - [ ] **AC-US1-03**: 5 failed attempts lock account 15min (P2, testable)
519
+ ```
520
+
521
+ **Step 2: Architect creates plan.md** with architecture and test strategy (85% unit, 80% integration, 100% E2E critical path)
522
+
523
+ **Step 3: test-aware-planner generates tasks.md** with embedded tests:
524
+
525
+ ```markdown
526
+ ---
527
+ increment: 0008-user-authentication
528
+ total_tasks: 5
529
+ test_mode: TDD
530
+ coverage_target: 85%
531
+ ---
532
+
533
+ # Tasks for Increment 0008: User Authentication
534
+
535
+ ## T-001: Implement Authentication Service (FULL EXAMPLE)
536
+
537
+ **AC**: AC-US1-01, AC-US1-02, AC-US1-03
538
+
539
+ **Test Plan** (BDD format):
540
+ - **Given** user with valid credentials → **When** login → **Then** receive JWT token + timestamp update
541
+
542
+ **Test Cases**:
543
+ - Unit (`auth.test.ts`): validLogin, invalidPassword, nonexistentUser, rateLimiting → 90% coverage
544
+ - Integration (`auth-flow.test.ts`): loginEndpoint, lockedAccount → 85% coverage
545
+ - **Overall: 87% coverage**
546
+
547
+ **Implementation**: AuthService.ts, password hashing (bcrypt), JWT generation, rate limiting (Redis), TDD tests
548
+
549
+ ---
550
+
551
+ ## T-002 through T-005 (Abbreviated)
552
+
553
+ - **T-002**: Session Manager (AC-US2-01, AC-US2-02) - session persistence, "Remember Me", 85% coverage, deps: T-001
554
+ - **T-003**: Login API Endpoint (AC-US1-01, AC-US1-02) - REST API, validation, rate limiting, 85% coverage, deps: T-001, T-002
555
+ - **T-004**: Update Documentation - API docs, flow diagram, user guide (validation: manual review, link checker, build check)
556
+ - **T-005**: Security Audit (AC-US1-03) - OWASP scan, password/JWT verification, 90% coverage, deps: T-001, T-002, T-003
557
+ ```
558
+
559
+ **Step 4: Validate** → `/specweave:check-tests 0008` shows per-task coverage, AC-ID coverage, missing tests, recommendations
560
+
561
+ **AC-ID Format**: `AC-US{story}-{number}` (e.g., AC-US1-01) enables traceability from spec.md → tasks.md → tests
562
+
563
+ ### Agent Invocation (increment-planner skill)
564
+
565
+ The `increment-planner` skill automatically invokes the `test-aware-planner` agent:
566
+
567
+ ```markdown
568
+ STEP 4: Invoke Test-Aware Planner Agent (🚨 MANDATORY - USE TASK TOOL)
569
+
570
+ Task(
571
+ subagent_type: "test-aware-planner",
572
+ description: "Generate tasks with embedded tests",
573
+ prompt: "Create tasks.md with embedded test plans for: [user feature description]
574
+
575
+ FIRST, read the increment files:
576
+ - .specweave/increments/0008-user-authentication/spec.md
577
+ - .specweave/increments/0008-user-authentication/plan.md
578
+
579
+ Generate tasks.md with:
580
+ - Test Plan (Given/When/Then in BDD format)
581
+ - Test Cases (unit/integration/E2E with file paths)
582
+ - Coverage Targets (80-90% overall)
583
+ - Implementation steps
584
+ - Ensure all AC-IDs from spec.md are covered"
585
+ )
586
+ ```
587
+
588
+ ### TDD Workflow Mode
589
+
590
+ When `test_mode: TDD` in tasks.md frontmatter:
591
+
592
+ **Red → Green → Refactor**:
593
+ 1. **Red**: Write failing test first
594
+ 2. **Green**: Implement minimal code to pass test
595
+ 3. **Refactor**: Improve code while keeping tests green
596
+
597
+ **Example**:
598
+ ```bash
599
+ # 1. RED - Write failing test
600
+ vim tests/unit/services/auth.test.ts
601
+ npm test # ❌ Fails (expected)
602
+
603
+ # 2. GREEN - Implement feature
604
+ vim src/services/auth/AuthService.ts
605
+ npm test # ✅ Passes
606
+
607
+ # 3. REFACTOR - Improve code
608
+ vim src/services/auth/AuthService.ts
609
+ npm test # ✅ Still passes
610
+ ```
611
+
612
+ ### Migration from OLD Format
613
+
614
+ **If you have increments with tests.md**:
615
+
616
+ ```bash
617
+ # Option 1: Keep old format (works, but deprecated)
618
+ # No action needed - old increments continue to work
619
+
620
+ # Option 2: Migrate to new format (recommended)
621
+ # 1. Extract tests from tests.md
622
+ # 2. Embed them in tasks.md for each task
623
+ # 3. Delete tests.md
624
+ # 4. Run /specweave:check-tests to validate
625
+ ```
626
+
627
+ **Note**: New increments ONLY use tasks.md format. Backward compatibility removed per user feedback (greenfield product).
628
+
629
+ ### Quick Reference
630
+
631
+ | Aspect | OLD (tests.md) | NEW (tasks.md) |
632
+ |--------|---------------|----------------|
633
+ | **File** | Separate tests.md | Embedded in tasks.md |
634
+ | **Format** | TC-IDs (TC-001) | Function names + BDD |
635
+ | **Traceability** | Manual | Automatic (AC-IDs) |
636
+ | **BDD** | No | Yes (Given/When/Then) |
637
+ | **Sync Issues** | Yes (tasks ↔ tests) | No (single file) |
638
+ | **Coverage** | Per test case | Per task + overall |
639
+ | **TDD Support** | Limited | Native (test_mode: TDD) |
640
+
641
+ ---
642
+
415
643
  ## Root-Level .specweave/ Folder (MANDATORY)
416
644
 
417
645
  **CRITICAL ARCHITECTURE RULE**: SpecWeave ONLY supports root-level `.specweave/` folders. Nested `.specweave/` folders are NOT supported and MUST be prevented.
@@ -528,7 +756,7 @@ git init && npx specweave init .
528
756
  mkdir -p services/{user,order,payment}
529
757
 
530
758
  # Work normally - SpecWeave sees all services
531
- /specweave:inc "0001-add-service-mesh"
759
+ /specweave:increment "0001-add-service-mesh"
532
760
  # Creates: .specweave/increments/0001-add-service-mesh/
533
761
  # Can reference: services/user-service/, infrastructure/k8s/, etc.
534
762
  ```
@@ -595,16 +823,16 @@ if (parentSpecweave) {
595
823
 
596
824
  ---
597
825
 
598
- ## Project Scale (v0.4.0 - Plugin Architecture)
826
+ ## Project Scale - Plugin Architecture
599
827
 
600
828
  ### Core Plugin (Always Auto-Loaded)
601
829
 
602
830
  **Plugin**: `specweave` - The essential SpecWeave plugin loaded in every project:
603
- - **Skills**: 9 skills (increment-planner, tdd-workflow, rfc-generator, context-loader, project-kickstarter, brownfield-analyzer, brownfield-onboarder, increment-quality-judge, context-optimizer)
831
+ - **Skills**: 9 skills (increment-planner, tdd-workflow, spec-generator, context-loader, project-kickstarter, brownfield-analyzer, brownfield-onboarder, increment-quality-judge, context-optimizer)
604
832
  - **Agents**: 22 agents (PM, Architect, Tech Lead, + 19 specialized including tdd-orchestrator)
605
833
  - **Commands**: 22 commands (/specweave:inc, /specweave:do, /specweave:next, /specweave:done, /specweave:progress, /specweave:validate, /specweave:sync-docs, + 15 specialized)
606
834
  - **Hooks**: 8 lifecycle hooks
607
- - **Size**: ~12K tokens (vs. 50K in v0.3.7)
835
+ - **Size**: ~12K tokens
608
836
 
609
837
  **Result**: **75%+ context reduction** out of the box!
610
838
 
@@ -616,7 +844,7 @@ if (parentSpecweave) {
616
844
 
617
845
  ### Available Plugins (Opt-In)
618
846
 
619
- **Implemented Plugins** (v0.4.0):
847
+ **Implemented Plugins**:
620
848
 
621
849
  | Plugin | Skills | Agents | Commands | Status |
622
850
  |--------|--------|--------|----------|--------|
@@ -665,12 +893,12 @@ if (parentSpecweave) {
665
893
 
666
894
  ### Context Efficiency Examples
667
895
 
668
- **Before (v0.3.7)** - Monolithic:
896
+ **Before** - Monolithic approach:
669
897
  - Simple React app: Loads ALL 44 skills + 20 agents ≈ **50K tokens**
670
898
  - Backend API: Loads ALL 44 skills + 20 agents ≈ **50K tokens**
671
899
  - ML pipeline: Loads ALL 44 skills + 20 agents ≈ **50K tokens**
672
900
 
673
- **After (v0.4.0)** - Modular:
901
+ **After** - Modular plugin architecture:
674
902
  - Simple React app: Core + frontend-stack + github ≈ **16K tokens** (68% reduction!)
675
903
  - Backend API: Core + nodejs-backend + github ≈ **15K tokens** (70% reduction!)
676
904
  - ML pipeline: Core + ml-ops + github ≈ **18K tokens** (64% reduction!)
@@ -684,7 +912,7 @@ if (parentSpecweave) {
684
912
 
685
913
  When you run `specweave init`:
686
914
 
687
- 1. ✅ **GitHub Marketplace Registration** (v0.6.7+)
915
+ 1. ✅ **GitHub Marketplace Registration**
688
916
  - Creates `.claude/settings.json` with GitHub marketplace reference
689
917
  - **No local copying** - plugins fetched from GitHub on-demand
690
918
  - Settings.json structure:
@@ -704,7 +932,7 @@ When you run `specweave init`:
704
932
  - Claude Code automatically discovers plugins from GitHub
705
933
  - No manual `/plugin marketplace add` needed!
706
934
 
707
- 2. ✅ **Core Plugin Auto-Installation** (v0.6.1+)
935
+ 2. ✅ **Core Plugin Auto-Installation**
708
936
  - Automatically runs: `claude plugin marketplace add` and `claude plugin install specweave@specweave`
709
937
  - Works via CLI during init (uses user's shell to access `claude` command)
710
938
  - Slash commands available IMMEDIATELY - no manual install!
@@ -715,13 +943,13 @@ When you run `specweave init`:
715
943
  - Based on project detection (Git, package.json, etc.)
716
944
  - User can install now or later
717
945
 
718
- **Key Architectural Change (v0.6.7)**:
946
+ **Key Architectural Change**:
719
947
  - ❌ Old: Copied `.claude-plugin/` + `plugins/` to every project (~2MB bloat)
720
948
  - ✅ New: Reference GitHub marketplace (~2KB settings.json, always up-to-date)
721
949
 
722
950
  #### Phase 2: Increment Planning (On-Demand Loading)
723
951
 
724
- When you create increments (e.g., `/specweave:inc "Add Stripe billing"`):
952
+ When you create increments (e.g., `/specweave:increment "Add Stripe billing"`):
725
953
 
726
954
  1. **Spec Analysis** (NEW! v0.6.0+)
727
955
  - increment-planner skill scans spec.md content
@@ -792,7 +1020,7 @@ All plugin management happens through Claude Code's native commands:
792
1020
  ```
793
1021
  specweave/ (GitHub repo - Contributors)
794
1022
  ├── .claude/
795
- │ └── settings.json # Local path reference
1023
+ │ └── settings.json # Empty or minimal (no local paths supported)
796
1024
  ├── .claude-plugin/
797
1025
  │ └── marketplace.json # Marketplace definition
798
1026
  └── plugins/
@@ -800,20 +1028,20 @@ specweave/ (GitHub repo - Contributors)
800
1028
  └── specweave-github/ # Plugin SOURCE CODE
801
1029
  ```
802
1030
 
803
- **Settings.json for development** (.claude/settings.json):
804
- ```json
805
- {
806
- "extraKnownMarketplaces": {
807
- "specweave": "../.claude-plugin"
808
- }
809
- }
810
- ```
1031
+ **Marketplace setup for development** (use CLI, NOT settings.json):
1032
+
1033
+ Local paths are **NOT supported** in `extraKnownMarketplaces` in settings.json. Use CLI instead:
811
1034
 
812
- **OR use CLI** (recommended for contributors):
813
1035
  ```bash
1036
+ # Add local marketplace (only way for development)
814
1037
  /plugin marketplace add ./.claude-plugin
1038
+
1039
+ # Then install plugins
1040
+ /plugin install specweave@specweave
815
1041
  ```
816
1042
 
1043
+ **Why CLI-only?** Claude Code's `extraKnownMarketplaces` in settings.json only supports remote sources (GitHub, Git). Local paths must be added via CLI commands.
1044
+
817
1045
  #### User Projects (Production)
818
1046
 
819
1047
  ```
@@ -843,8 +1071,8 @@ my-saas-app/ (User's project)
843
1071
  **Key Differences**:
844
1072
  - ✅ **Development**: Local `.claude-plugin/` and `plugins/` in repo (for editing)
845
1073
  - ✅ **Production**: GitHub reference only (no local plugin copies)
846
- - ✅ **Development**: Use string path `"../​.claude-plugin"`
847
- - ✅ **Production**: Use GitHub object `{"source": "github", ...}`
1074
+ - ✅ **Development**: Use CLI `/plugin marketplace add ./.claude-plugin` (settings.json cannot reference local paths)
1075
+ - ✅ **Production**: Use GitHub object in settings.json: `{"source": {"source": "github", ...}}`
848
1076
 
849
1077
  No per-project installation needed!
850
1078
 
@@ -874,7 +1102,7 @@ plugins/ ← ROOT: All plugins (version controlled)
874
1102
  ├── specweave/ ← CORE PLUGIN (framework essentials)
875
1103
  │ ├── .claude-plugin/ ← plugin.json (Claude native)
876
1104
  │ ├── skills/ ← Core skills (9 total)
877
- │ │ ├── rfc-generator/
1105
+ │ │ ├── spec-generator/
878
1106
  │ │ ├── increment-planner/
879
1107
  │ │ ├── tdd-workflow/
880
1108
  │ │ └── ...
@@ -914,16 +1142,15 @@ plugins/ ← ROOT: All plugins (version controlled)
914
1142
 
915
1143
  **Rules**:
916
1144
  - ✅ `src/` = TypeScript code ONLY (compiled to `dist/`)
917
- - ✅ ALL skills/agents/commands/hooks = Inside plugins (including core!)
1145
+ - ✅ ALL skills/agents/commands/hooks = Inside `plugins/` (including core!)
918
1146
  - ✅ `plugins/specweave/` = Core framework plugin (always loaded)
919
- - ✅ `.claude/` = Installed from all enabled plugins
1147
+ - ✅ `.claude/` = Plugin settings only (settings.json references marketplace)
920
1148
  - ❌ NEVER mix `*.ts` and `SKILL.md` in the same directory
921
- - ❌ NEVER edit files in `.claude/` directly (they get overwritten)
922
1149
  - ❌ NEVER create new files in project root (use increment folders)
923
1150
 
924
1151
  **Key Architectural Principle**:
925
1152
  - TypeScript code (`*.ts`) goes in `src/` → compiled to `dist/`
926
- - Claude-native files (`SKILL.md`, `AGENT.md`, `*.md`) go in `plugins/` → copied to `.claude/`
1153
+ - Claude-native files (`SKILL.md`, `AGENT.md`, `*.md`) stay in `plugins/` → loaded directly by Claude Code
927
1154
  - Even "core" framework components are in `plugins/specweave/` (everything is a plugin!)
928
1155
  - This separation ensures clean builds and prevents mixing compiled code with runtime files
929
1156
 
@@ -977,7 +1204,6 @@ specweave/
977
1204
  │ │ ├── adapter-base.ts
978
1205
  │ │ ├── claude/
979
1206
  │ │ ├── cursor/ (legacy)
980
- │ │ ├── copilot/ (legacy)
981
1207
  │ │ └── generic/ (legacy)
982
1208
  │ ├── templates/ # User project templates
983
1209
  │ │ ├── CLAUDE.md.template
@@ -990,7 +1216,7 @@ specweave/
990
1216
  │ │ ├── .claude-plugin/
991
1217
  │ │ │ └── plugin.json # Claude native manifest
992
1218
  │ │ ├── skills/ # Core skills (9 total)
993
- │ │ │ ├── rfc-generator/ # RFC generation for increments
1219
+ │ │ │ ├── spec-generator/ # Specification generation for increments
994
1220
  │ │ │ ├── increment-planner/ # Increment planning and spec generation
995
1221
  │ │ │ ├── context-loader/ # Context loading optimization
996
1222
  │ │ │ ├── tdd-workflow/ # Test-driven development workflow
@@ -1048,21 +1274,22 @@ specweave/
1048
1274
  │ │ ├── 0002-core-enhancements/
1049
1275
  │ │ │ ├── spec.md
1050
1276
  │ │ │ ├── plan.md
1051
- │ │ │ ├── tasks.md
1052
- │ │ │ ├── tests.md
1277
+ │ │ │ ├── tasks.md # Tasks with embedded tests (v0.7.0+)
1053
1278
  │ │ │ ├── logs/ # ✅ Session logs go here
1054
1279
  │ │ │ ├── scripts/ # ✅ Helper scripts
1055
1280
  │ │ │ └── reports/ # ✅ Analysis files
1056
1281
  │ │ └── _backlog/
1057
1282
  │ ├── docs/
1058
- │ │ ├── internal/ # Strategic docs (NEVER published)
1059
- │ │ │ ├── strategy/ # Business strategy, market analysis
1060
- │ │ │ ├── architecture/ # Technical architecture
1061
- │ │ │ │ ├── adr/ # Architecture Decision Records
1062
- │ │ │ ├── rfc/ # Request for Comments (detailed specs)
1063
- │ │ │ │ ├── diagrams/ # Mermaid + SVG
1064
- │ │ │ │ └── hld-system.md # High-Level Design
1065
- │ │ │ └── delivery/ # Implementation notes, runbooks
1283
+ │ │ ├── internal/ # Strategic docs (NEVER published) - 6 core folders
1284
+ │ │ │ ├── strategy/ # Business rationale, vision, PRDs, OKRs
1285
+ │ │ │ ├── rfc/ # Feature specifications (detailed requirements, project history)
1286
+ │ │ │ │ └── rfc-####-{name}.md # User stories, AC, implementation plans
1287
+ │ │ │ ├── architecture/ # Technical design (HLD, LLD, ADR, diagrams)
1288
+ │ │ │ │ ├── adr/ # Architecture Decision Records (why we chose X over Y)
1289
+ │ │ │ │ └── diagrams/ # Mermaid + SVG (C4 model diagrams)
1290
+ │ │ │ ├── delivery/ # Build & release processes (roadmap, DORA, branching)
1291
+ │ │ │ ├── operations/ # Production operations (runbooks, SLOs, incidents)
1292
+ │ │ │ └── governance/ # Policies (security, compliance, coding standards)
1066
1293
  │ │ └── public/ # User-facing docs (can publish)
1067
1294
  │ │ ├── guides/
1068
1295
  │ │ └── api/
@@ -1137,6 +1364,395 @@ specweave/
1137
1364
 
1138
1365
  ---
1139
1366
 
1367
+ ## Internal Documentation Structure
1368
+
1369
+ **Location**: `.specweave/docs/internal/` - Six core folders for engineering playbook
1370
+
1371
+ **Quick Reference**:
1372
+
1373
+ | Folder | Purpose | Use When | Examples |
1374
+ |--------|---------|----------|----------|
1375
+ | **strategy/** | Business rationale (Why?) | Defining business case for features | `prd-user-auth.md` |
1376
+ | **specs/** | Feature specifications (What?) | Detailed requirements with user stories | `spec-0007-smart-discipline.md` |
1377
+ | **architecture/** | Technical design (How?) | System architecture, decisions | `hld-system.md`, `adr/0001-postgres.md` |
1378
+ | **delivery/** | Build & release (How we build) | Git workflow, DORA metrics, CI/CD | `branch-strategy.md`, `dora-metrics.md` |
1379
+ | **operations/** | Production ops (How we run) | Runbooks, incidents, performance | `runbook-api.md`, `performance-tuning.md` |
1380
+ | **governance/** | Policies (Guardrails) | Security, compliance, coding standards | `security-policy.md`, `coding-standards.md` |
1381
+
1382
+ **Document Flow**: `PRD → Spec → Architecture → Delivery → Operations`
1383
+
1384
+ **See**: [Internal Docs README](.specweave/docs/internal/README.md) for complete guidance
1385
+
1386
+ ---
1387
+
1388
+ ## Specs Architecture: Two Locations Explained
1389
+
1390
+ **CRITICAL ARCHITECTURAL CONCEPT**: SpecWeave uses specs in TWO locations for different purposes. Understanding this distinction is essential.
1391
+
1392
+ ### The Core Question: Why Two Locations?
1393
+
1394
+ 1. **Living Docs Specs**: `.specweave/docs/internal/specs/spec-NNN-feature-area.md` - **Permanent, feature-level knowledge base**
1395
+ 2. **Increment Specs**: `.specweave/increments/####-name/spec.md` - **Temporary, focused implementation snapshot**
1396
+
1397
+ **Key Difference**: Specs use **3-digit numbers** (001, 002, 003) for **feature areas**, increments use **4-digit numbers** (0001, 0002, 0003) for **implementations**.
1398
+
1399
+ ### The Answer: Permanent vs Temporary
1400
+
1401
+ **Living Docs Specs = Permanent, Feature-Level Knowledge Base**
1402
+
1403
+ - **Location**: `.specweave/docs/internal/specs/spec-001-core-framework-architecture.md`
1404
+ - **Purpose**: COMPLETE, PERMANENT source of truth for entire feature area
1405
+ - **Lifecycle**: Created once, updated over time, NEVER deleted
1406
+ - **Scope**: Comprehensive feature area (e.g., "Core Framework", 10-50 user stories)
1407
+ - **Contains**:
1408
+ - ✅ ALL user stories for the feature area (across multiple increments)
1409
+ - ✅ ALL acceptance criteria for those user stories
1410
+ - ✅ Implementation history (which increments implemented which parts)
1411
+ - ✅ Links to brownfield documentation (existing project docs)
1412
+ - ✅ External PM tool links (GitHub Project, Jira Epic, ADO Feature)
1413
+ - ✅ Architecture decisions rationale (ADRs)
1414
+ - ✅ Success criteria & metrics for the feature area
1415
+
1416
+ **Increment Specs = Temporary, Focused Implementation Snapshot**
1417
+
1418
+ - **Location**: `.specweave/increments/0001-core-framework/spec.md`
1419
+ - **Purpose**: TEMPORARY implementation reference (what am I building THIS iteration?)
1420
+ - **Lifecycle**: Created per increment, can be deleted after completion
1421
+ - **Scope**: Focused subset (3-5 user stories for this increment only)
1422
+ - **Contains**:
1423
+ - ✅ Reference to living docs: `"See: SPEC-001-core-framework-architecture"`
1424
+ - ✅ Subset of user stories: `"Implements: US-001, US-002, US-003 only"`
1425
+ - ✅ What's being implemented RIGHT NOW (this iteration)
1426
+ - ✅ Out of scope: Lists what's NOT in this increment (deferred to future increments)
1427
+
1428
+ ### Real-World Example: SpecWeave Core Framework
1429
+
1430
+ **Living Docs Spec** (Permanent, Feature-Level):
1431
+ ```
1432
+ File: .specweave/docs/internal/specs/spec-001-core-framework-architecture.md
1433
+
1434
+ # SPEC-001: Core Framework & Architecture
1435
+ Foundation framework with CLI, plugin system, cross-platform support
1436
+
1437
+ ## Increments (Implementation History)
1438
+ - 0001-core-framework: MVP CLI, skills, agents (Complete)
1439
+ - 0002-core-enhancements: Context optimization, PM agent (Complete)
1440
+ - 0004-plugin-architecture: Claude native plugins (Complete)
1441
+ - 0005-cross-platform-cli: Windows/Mac/Linux support (Complete)
1442
+
1443
+ ## User Stories (35 total across all 4 increments)
1444
+ - US-001: NPM installation (0001) ✅
1445
+ - US-003: Context optimization (0002) ✅
1446
+ - US-005: Plugin system (0004) ✅
1447
+ - US-007: Cross-platform CLI (0005) ✅
1448
+ ... (31 more stories)
1449
+
1450
+ ## External References
1451
+ - GitHub Project: TBD (create for 1.0.0)
1452
+ ```
1453
+
1454
+ **Increment Spec** (Temporary, Implementation-Level):
1455
+ ```
1456
+ File: .specweave/increments/0001-core-framework/spec.md
1457
+
1458
+ # Increment 0001: Core Framework MVP
1459
+ **Implements**: SPEC-001-core-framework-architecture (US-001 to US-002 only)
1460
+ **Complete Specification**: See ../../docs/internal/specs/spec-001-core-framework-architecture.md
1461
+
1462
+ ## What We're Implementing (This Increment Only)
1463
+ - US-001: NPM installation + CLI basics ✅
1464
+ - US-002: Plugin system foundation ✅
1465
+
1466
+ ## Out of Scope (For This Increment)
1467
+ - ❌ Context optimization (US-003) → Increment 0002
1468
+ - ❌ Claude native plugins (US-005) → Increment 0004
1469
+ - ❌ Cross-platform support (US-007) → Increment 0005
1470
+ ```
1471
+
1472
+ ### Key Benefits
1473
+
1474
+ **Why This Architecture?**
1475
+
1476
+ 1. **Permanent Knowledge Base**: Living docs = long-term memory. Answer: "How did we build authentication?"
1477
+ 2. **Focused Implementation**: Increment specs = short-term focus. Answer: "What am I building RIGHT NOW?"
1478
+ 3. **Brownfield Integration**: Living docs link to existing project documentation, increment specs don't need this complexity
1479
+ 4. **Clean After Completion**: Delete increment specs (optional), living docs remain as knowledge base
1480
+ 5. **External PM Tool Integration**: Jira epic → Living docs spec (permanent link), increment specs don't need external links
1481
+
1482
+ ### When to Use Which?
1483
+
1484
+ **Create Living Docs Spec When**:
1485
+ - ✅ Planning a major feature (authentication, payments, messaging)
1486
+ - ✅ Feature spans multiple increments (will take weeks/months)
1487
+ - ✅ Need brownfield integration (link to existing project docs)
1488
+ - ✅ Want permanent historical record (how did we build this?)
1489
+ - ✅ Need external PM tool link (Jira epic, ADO feature, GitHub milestone)
1490
+
1491
+ **Create Increment Spec When**:
1492
+ - ✅ Starting implementation of one increment
1493
+ - ✅ Want quick reference (what am I building right now?)
1494
+ - ✅ Need focused scope (just 3 user stories, not 20)
1495
+
1496
+ ### Comparison Table
1497
+
1498
+ | Aspect | Living Docs Specs | Increment Specs |
1499
+ |--------|------------------|----------------|
1500
+ | **Location** | `.specweave/docs/internal/specs/` | `.specweave/increments/####/` |
1501
+ | **Lifecycle** | ✅ Permanent (never deleted) | ⏳ Temporary (optional deletion) |
1502
+ | **Scope** | 📚 Complete feature (20 US) | 🎯 Focused subset (3 US) |
1503
+ | **Size** | 500+ lines (comprehensive) | 50-100 lines (focused) |
1504
+ | **Purpose** | Knowledge base + history | Implementation tracker |
1505
+ | **Coverage** | ALL user stories | SUBSET of user stories |
1506
+ | **Brownfield** | ✅ Links to existing docs | ❌ Rarely needed |
1507
+ | **External Links** | ✅ Jira, ADO, GitHub | ❌ Rarely needed |
1508
+ | **Multiple Increments** | ✅ One spec → many increments | ❌ One increment → one spec |
1509
+ | **After Completion** | ✅ Remains forever | ⚠️ Can be deleted |
1510
+
1511
+ ### Analogy: Wikipedia vs Sticky Notes
1512
+
1513
+ - **Living Docs Specs** = 📚 Wikipedia Article (permanent, comprehensive, updated over time)
1514
+ - **Increment Specs** = 📝 Sticky Note Reminder (temporary, focused, disposable after done)
1515
+
1516
+ ### Typical Workflow
1517
+
1518
+ **Phase 1: Planning** (PM Agent)
1519
+ ```
1520
+ User: "I want to build a plugin-based framework with CLI"
1521
+ PM Agent:
1522
+ 1. Creates living docs spec:
1523
+ → .specweave/docs/internal/specs/spec-001-core-framework-architecture.md
1524
+ → Contains ALL 35 user stories (comprehensive, feature-level)
1525
+ → Links to GitHub Project (TBD)
1526
+ → Maps to 4 increments (0001, 0002, 0004, 0005)
1527
+ ```
1528
+
1529
+ **Phase 2: Increment 1** (Core MVP)
1530
+ ```
1531
+ User: "/specweave:increment 0001-core-framework"
1532
+ PM Agent:
1533
+ 1. Creates increment spec:
1534
+ → .specweave/increments/0001-core-framework/spec.md
1535
+ → References living docs: "See SPEC-001"
1536
+ → Contains ONLY US-001 to US-002 (focused, this iteration only)
1537
+ 2. Implementation happens...
1538
+ 3. Increment completes ✅
1539
+ 4. Increment spec stays for history (or can be deleted)
1540
+ ```
1541
+
1542
+ **Phase 3: Increment 2** (Enhancements)
1543
+ ```
1544
+ User: "/specweave:increment 0002-core-enhancements"
1545
+ PM Agent:
1546
+ 1. Creates increment spec:
1547
+ → .specweave/increments/0002-core-enhancements/spec.md
1548
+ → References SAME living docs: "See SPEC-001"
1549
+ → Contains ONLY US-003 to US-004 (focused, this iteration only)
1550
+ 2. Implementation happens...
1551
+ 3. Increment completes ✅
1552
+ ```
1553
+
1554
+ **Phase 4: All Increments Done!**
1555
+ ```
1556
+ After ALL increments complete (0001, 0002, 0004, 0005):
1557
+ - ✅ Living docs spec REMAINS (permanent knowledge base)
1558
+ - ⏳ Increment specs can be deleted (optional cleanup)
1559
+ - ✅ Complete history preserved in spec-001
1560
+ - ✅ GitHub Project linked to SPEC-001 (not increments)
1561
+ ```
1562
+
1563
+ ### Relationship
1564
+
1565
+ **One living docs spec → Many increment specs**
1566
+
1567
+ ```
1568
+ SPEC-001: Core Framework & Architecture (Living Docs - Permanent, Feature-Level)
1569
+ ├── 0001-core-framework (Increment - Temporary, Implementation-Level)
1570
+ ├── 0002-core-enhancements (Increment - Temporary, Implementation-Level)
1571
+ ├── 0004-plugin-architecture (Increment - Temporary, Implementation-Level)
1572
+ └── 0005-cross-platform-cli (Increment - Temporary, Implementation-Level)
1573
+
1574
+ SPEC-002: Intelligent AI Capabilities (Living Docs - Permanent, Feature-Level)
1575
+ ├── 0003-intelligent-model-selection (Increment - Temporary, Implementation-Level)
1576
+ ├── 0007-smart-increment-discipline (Increment - Temporary, Implementation-Level)
1577
+ └── 0009-intelligent-reopen-logic (Increment - Temporary, Implementation-Level)
1578
+ ```
1579
+
1580
+ ### Summary
1581
+
1582
+ **Two Locations, Two Purposes**:
1583
+
1584
+ 1. **Living Docs Specs** (`.specweave/docs/internal/specs/`):
1585
+ - ✅ Permanent knowledge base
1586
+ - ✅ Complete feature specification
1587
+ - ✅ Links to brownfield docs
1588
+ - ✅ External PM tool integration
1589
+ - ✅ Spans multiple increments
1590
+
1591
+ 2. **Increment Specs** (`.specweave/increments/####/`):
1592
+ - ⏳ Temporary implementation tracker
1593
+ - 🎯 Focused subset of work
1594
+ - 📝 Quick reference: "What am I building?"
1595
+ - 🗑️ Can be deleted after completion
1596
+
1597
+ **Result**: Clean, focused implementation + permanent knowledge base
1598
+
1599
+ **For comprehensive explanation**: See [SPECS-ARCHITECTURE-CLARIFICATION.md](.specweave/increments/0007-smart-increment-discipline/reports/SPECS-ARCHITECTURE-CLARIFICATION.md)
1600
+
1601
+ ---
1602
+
1603
+ ## Living Completion Reports
1604
+
1605
+ ### The Problem with Traditional Reports
1606
+
1607
+ **Traditional approach** (report written at the end):
1608
+ ```
1609
+ Start increment: Plan 10 user stories
1610
+ During work: Scope changes 5 times (not documented)
1611
+ End increment: Write report "Completed 8/10 stories"
1612
+ Future: "Why was Story 5 removed?" → No one remembers!
1613
+ ```
1614
+
1615
+ **Problems**:
1616
+ - ❌ No audit trail for scope changes
1617
+ - ❌ Decision rationale lost
1618
+ - ❌ Difficult for onboarding/compliance
1619
+ - ❌ Can't learn from past iterations
1620
+
1621
+ ### Living Reports Solution
1622
+
1623
+ **SpecWeave approach** (report updated in real-time):
1624
+ ```
1625
+ Start: Initialize completion report (v1.0)
1626
+ During work:
1627
+ - 2025-11-06: Added US6 (dark mode) → /update-scope → v1.1
1628
+ - 2025-11-07: Deferred US3 (CSV export) → /update-scope → v1.2
1629
+ - 2025-11-08: WebSockets → Polling pivot → /update-scope → v1.3
1630
+ End: Finalize report with complete scope evolution history
1631
+ Future: "Why was Story 5 removed?" → Check report, find exact reason with WHO approved and WHY!
1632
+ ```
1633
+
1634
+ **Benefits**:
1635
+ - ✅ Complete audit trail (every scope change documented)
1636
+ - ✅ Real-time context (captured when decision is fresh)
1637
+ - ✅ Regulatory compliance (explains deviations from plan)
1638
+ - ✅ Learning for future increments
1639
+ - ✅ Onboarding new team members (understand project history)
1640
+
1641
+ ### Report Structure
1642
+
1643
+ **Location**: `.specweave/increments/{id}/reports/COMPLETION-REPORT.md`
1644
+
1645
+ **Sections**:
1646
+ 1. **Original Scope**: What was planned at increment start
1647
+ 2. **Scope Evolution**: Living log of changes (updated during increment)
1648
+ 3. **Final Delivery**: What was actually delivered
1649
+ 4. **What Changed and Why**: Rationale for scope changes
1650
+ 5. **Lessons Learned**: What we learned for next time
1651
+ 6. **Metrics**: Velocity, scope creep, test coverage, defects
1652
+
1653
+ ### Workflow
1654
+
1655
+ **1. Initialize Report** (automatic when increment created):
1656
+ ```bash
1657
+ /specweave:increment "User dashboard"
1658
+ # Creates: .specweave/increments/0008-user-dashboard/reports/COMPLETION-REPORT.md (v1.0)
1659
+ ```
1660
+
1661
+ **2. Update During Work** (whenever scope changes):
1662
+ ```bash
1663
+ # Quick log
1664
+ /specweave:update-scope "Added dark mode toggle (stakeholder request from CMO, +16 hours)"
1665
+
1666
+ # Or interactive
1667
+ /specweave:update-scope
1668
+ # Prompts:
1669
+ # - What changed? (Added/Removed/Modified)
1670
+ # - Why? (Business reason, technical blocker, etc.)
1671
+ # - Impact? (+/- hours)
1672
+ # - Who approved? (PM, stakeholder, etc.)
1673
+ # - Documentation? (ADR, GitHub issue, etc.)
1674
+ ```
1675
+
1676
+ **3. Finalize at Completion** (via `/specweave:done`):
1677
+ ```bash
1678
+ /specweave:done 0008
1679
+ # Validates report completeness
1680
+ # Prompts to fill any missing sections
1681
+ # Marks increment as complete
1682
+ ```
1683
+
1684
+ ### Example Entry
1685
+
1686
+ ```markdown
1687
+ ## Scope Evolution (Living Updates)
1688
+
1689
+ ### 2025-11-06: Added user story
1690
+
1691
+ **Changed**: US6: Dark mode toggle
1692
+ **Reason**: Stakeholder request from CMO (high priority, blocks marketing launch)
1693
+ **Impact**: +16 hours
1694
+ **Decision**: PM + CMO
1695
+ **Documentation**: GitHub issue #45
1696
+
1697
+ ---
1698
+
1699
+ ### 2025-11-07: Removed/deferred user story
1700
+
1701
+ **Changed**: US3: Data export to CSV
1702
+ **Reason**: Not critical for MVP, can be added later without breaking changes
1703
+ **Impact**: -8 hours (deferred to increment 0009)
1704
+ **Decision**: PM
1705
+ **Documentation**: None
1706
+
1707
+ ---
1708
+
1709
+ ### 2025-11-08: Technical pivot (architecture change)
1710
+
1711
+ **Changed**: WebSockets → Long-polling
1712
+ **Reason**: WebSocket library had critical security vulnerability (CVE-2025-1234)
1713
+ **Impact**: -4 hours (simpler implementation)
1714
+ **Decision**: Architect + Security Lead
1715
+ **Documentation**: ADR-008: Why We Chose Polling Over WebSockets
1716
+
1717
+ ---
1718
+ ```
1719
+
1720
+ ### When to Update
1721
+
1722
+ ✅ **DO update** when:
1723
+ - Adding new user story or task
1724
+ - Removing/deferring work
1725
+ - Modifying scope of existing story
1726
+ - Making architecture pivots (technical decisions)
1727
+ - Reducing/expanding scope
1728
+ - Blocking issues discovered
1729
+
1730
+ ❌ **DON'T update** for:
1731
+ - Bug fixes discovered during implementation (normal)
1732
+ - Minor implementation details
1733
+ - Code refactoring (unless scope-affecting)
1734
+
1735
+ ### Best Practices
1736
+
1737
+ 1. **Update in real-time**: Don't batch updates (capture context while fresh)
1738
+ 2. **Be specific**: "Added US6: Dark mode" not "Added feature"
1739
+ 3. **Include rationale**: Always answer WHY
1740
+ 4. **Link to docs**: ADR, GitHub issue, Jira ticket
1741
+ 5. **Track approvals**: Who made the decision
1742
+ 6. **Quantify impact**: +/- hours for scope changes
1743
+
1744
+ ### Commands
1745
+
1746
+ | Command | Purpose |
1747
+ |---------|---------|
1748
+ | `/specweave:increment "feature"` | Creates increment with initial completion report |
1749
+ | `/specweave:update-scope` | Log scope change during increment |
1750
+ | `/specweave:done <id>` | Finalize report and mark increment complete |
1751
+
1752
+ **See**: [update-scope.md](plugins/specweave/commands/update-scope.md) for detailed documentation
1753
+
1754
+ ---
1755
+
1140
1756
  ## Development Workflow
1141
1757
 
1142
1758
  ### Making Changes
@@ -1146,7 +1762,7 @@ specweave/
1146
1762
  **1. Editing Skills** (any plugin):
1147
1763
  ```bash
1148
1764
  # Core plugin (auto-loaded):
1149
- vim plugins/specweave/skills/rfc-generator/SKILL.md
1765
+ vim plugins/specweave/skills/spec-generator/SKILL.md
1150
1766
 
1151
1767
  # Other plugins (opt-in):
1152
1768
  vim plugins/specweave-github/skills/github-sync/SKILL.md
@@ -1195,13 +1811,14 @@ npm run build && npm test
1195
1811
  - Acceptance criteria in PRDs
1196
1812
  - Manual validation
1197
1813
 
1198
- 2. **Feature Tests** (`.specweave/increments/####/tests.md`)
1199
- - Test coverage plans per increment
1200
- - TC-XXXX test case IDs
1814
+ 2. **Embedded Tests** (`.specweave/increments/####/tasks.md`)
1815
+ - Test plans embedded in tasks (BDD format, v0.7.0+)
1816
+ - AC-ID traceability (AC-US1-01, AC-US1-02, etc.)
1201
1817
 
1202
- 3. **Skill Tests** (`tests/specs/{skill-name}/` or `tests/integration/{skill-name}/`)
1203
- - Test cases for skill functionality
1204
- - Minimum 3 test cases per skill
1818
+ 3. **Integration Tests** (`tests/integration/{skill-name}/`)
1819
+ - Tests for plugin and skill functionality
1820
+ - Tool sync (github, ado, jira)
1821
+ - Brownfield detection and other integrations
1205
1822
  - Run via: `npm run test:integration`
1206
1823
 
1207
1824
  4. **Code Tests** (`tests/`)
@@ -1222,7 +1839,7 @@ npm run build && npm test
1222
1839
 
1223
1840
  ### Hooks and Automation
1224
1841
 
1225
- **Post-Task Completion Hook v2.0** (`.claude/hooks/post-task-completion.sh`):
1842
+ **Post-Task Completion Hook** (`.claude/hooks/post-task-completion.sh`):
1226
1843
 
1227
1844
  **Smart Session-End Detection**:
1228
1845
  - ✅ Tracks inactivity gaps between TodoWrite calls
@@ -1255,10 +1872,54 @@ Solution: Inactivity-based detection
1255
1872
  - Update `README.md` for user-facing changes
1256
1873
  - Update `CHANGELOG.md` for API changes
1257
1874
 
1258
- **Living Docs Sync** (after `/specweave:do` completes):
1259
- - Run `/specweave:sync-docs update`
1260
- - Updates `.specweave/docs/` with implementation learnings
1261
- - Updates ADRs from Proposed → Accepted
1875
+ **Living Docs Sync** (AUTOMATIC after task completion):
1876
+
1877
+ **The Critical Problem**: `.specweave/docs/internal/specs/` is the **permanent source of truth** for ALL completed work across the entire enterprise. Without automatic sync, this documentation becomes stale and incomplete.
1878
+
1879
+ **How It Works** (Automatic):
1880
+ 1. **Hook Triggers**: After every task completion (TodoWrite), `post-task-completion.sh` fires
1881
+ 2. **Sync Check**: Runs `dist/hooks/lib/sync-living-docs.js` to check if sync is needed
1882
+ 3. **Automatic Sync**: If enabled in config, syncs increment specs to living docs
1883
+ 4. **Result**: `.specweave/docs/internal/specs/spec-{id}.md` is always up-to-date
1884
+
1885
+ **Configuration** (`.specweave/config.json`):
1886
+ ```json
1887
+ {
1888
+ "hooks": {
1889
+ "post_task_completion": {
1890
+ "sync_living_docs": true, // ✅ MUST be true!
1891
+ "sync_tasks_md": true, // Updates tasks.md with completion status
1892
+ "external_tracker_sync": true // Syncs to GitHub/Jira/ADO
1893
+ }
1894
+ }
1895
+ }
1896
+ ```
1897
+
1898
+ **Manual Sync** (when automatic sync was disabled):
1899
+ ```bash
1900
+ # Sync all completed increments to living docs
1901
+ /specweave:sync-docs update
1902
+
1903
+ # Or copy manually (emergency only):
1904
+ cp .specweave/increments/0001-core-framework/spec.md \
1905
+ .specweave/docs/internal/specs/spec-0001-core-framework.md
1906
+ ```
1907
+
1908
+ **Verify Sync**:
1909
+ ```bash
1910
+ # Check all synced specs
1911
+ ls -1 .specweave/docs/internal/specs/spec-*.md
1912
+
1913
+ # Should match number of completed increments
1914
+ ls -1 .specweave/increments/ | grep -E '^[0-9]{4}' | wc -l
1915
+ ```
1916
+
1917
+ **Why This Matters**:
1918
+ - ✅ **Enterprise-level traceability**: Every increment's spec is permanently archived
1919
+ - ✅ **Cross-increment history**: See all work completed across the entire project
1920
+ - ✅ **Onboarding new developers**: Read specs to understand what was built and why
1921
+ - ✅ **Compliance & auditing**: Complete audit trail of all product decisions
1922
+ - ✅ **Living documentation**: Specs stay up-to-date without manual intervention
1262
1923
 
1263
1924
  ---
1264
1925
 
@@ -1330,7 +1991,7 @@ plugins/specweave-{name}/
1330
1991
  ```
1331
1992
  Is this feature...
1332
1993
  ├─ Used by EVERY project? → specweave (auto-loaded)
1333
- │ Examples: increment-planner, rfc-generator, tdd-workflow, PM/Architect agents
1994
+ │ Examples: increment-planner, spec-generator, tdd-workflow, PM/Architect agents
1334
1995
 
1335
1996
  ├─ Part of increment lifecycle? → specweave (auto-loaded)
1336
1997
  │ Examples: /specweave:inc, /specweave:do, living docs hooks
@@ -1433,9 +2094,53 @@ vim .claude-plugin/marketplace.json
1433
2094
 
1434
2095
  ## Release Process
1435
2096
 
2097
+ ### Versioning Strategy
2098
+
2099
+ **IMPORTANT**: SpecWeave follows semantic versioning (semver), but version bumps are **MANUAL** and controlled:
2100
+
2101
+ **The Rules**:
2102
+ - ✅ **Patch version** (0.7.X) - Increment ONLY when explicitly requested by maintainer
2103
+ - ✅ **Minor version** (0.X.0) - Increment ONLY when maintainer says to
2104
+ - ✅ **Major version** (X.0.0) - Increment ONLY when maintainer says to
2105
+ - ❌ **NEVER auto-increment** versions after each increment completion
2106
+
2107
+ **Why Manual Control?**
2108
+ - Multiple increments may be part of the same release (e.g., 0.7.0 = increments 0006 + 0007 + 0008)
2109
+ - Version bumps signal user-facing releases, not internal development progress
2110
+ - Maintainer decides when features are ready to ship
2111
+ - Prevents version number inflation (e.g., jumping from 0.7.0 to 0.12.0 in one day)
2112
+
2113
+ **When Completing Increments**:
2114
+ ```bash
2115
+ # ❌ WRONG - Don't auto-bump version
2116
+ git commit -m "feat: complete increment 0008"
2117
+ npm version patch # ❌ NO! Wait for maintainer approval
2118
+
2119
+ # ✅ CORRECT - Just commit the work
2120
+ git commit -m "feat: complete increment 0008"
2121
+ # Version stays at 0.7.0 until maintainer says to bump
2122
+ ```
2123
+
2124
+ **When Maintainer Requests Version Bump**:
2125
+ ```bash
2126
+ # Maintainer says: "Bump to 0.7.1"
2127
+ npm version patch # ✅ Now bump
2128
+ npm publish # ✅ And publish
2129
+
2130
+ # Maintainer says: "Bump to 0.8.0"
2131
+ npm version minor # ✅ New minor version
2132
+ npm publish
2133
+ ```
2134
+
2135
+ **Summary**: Complete increments → commit code → maintainer decides when to bump version and publish.
2136
+
2137
+ ---
2138
+
2139
+ ### NPM Publishing
2140
+
1436
2141
  **NPM Publishing**:
1437
2142
  ```bash
1438
- # 1. Update version
2143
+ # 1. Update version (ONLY when maintainer requests)
1439
2144
  npm version patch|minor|major
1440
2145
 
1441
2146
  # 2. Update CHANGELOG.md
@@ -1469,8 +2174,7 @@ git push origin develop --tags
1469
2174
 
1470
2175
  **Legacy Multi-Tool Support** (may be removed):
1471
2176
  - ⚠️ Cursor (via `.cursorrules` + AGENTS.md compilation)
1472
- - ⚠️ GitHub Copilot (via `.github/copilot/instructions.md`)
1473
- - ⚠️ Generic (Markdown-only, for ChatGPT/Gemini/etc.)
2177
+ - ⚠️ Generic (via AGENTS.md, for Copilot/ChatGPT/Gemini/etc.)
1474
2178
 
1475
2179
  **Why Claude-First?**
1476
2180
  The adapter system was originally designed to support multiple tools, but this added significant complexity without meaningful benefit. Claude Code provides:
@@ -1497,7 +2201,7 @@ Other tools simply can't match these capabilities. The adapters remain in the co
1497
2201
  - **Plugin components**: `plugins/specweave-{name}/{skills|agents|commands}/`
1498
2202
  - **Tests**: `tests/integration/{component-name}/` or `tests/unit/`
1499
2203
 
1500
- **For detailed instructions**: See "Adding a New Plugin (Contributors)" section above (line ~1250)
2204
+ **For detailed instructions**: See "Adding a New Plugin (Contributors)" section above
1501
2205
 
1502
2206
  ### Update Documentation
1503
2207
 
@@ -1513,21 +2217,106 @@ vim docs-site/docs/guides/getting-started.md
1513
2217
  cd docs-site && npm run build
1514
2218
  ```
1515
2219
 
2220
+ ### Translation Workflow (Multilingual Support)
2221
+
2222
+ **SpecWeave supports multilingual development** via post-generation translation (Increment 0006).
2223
+
2224
+ **Key Concept**: Users work in their native language (great UX), system auto-translates to English (maintainable docs).
2225
+
2226
+ **Workflow**:
2227
+
2228
+ ```bash
2229
+ # 1. User creates increment in Russian
2230
+ /specweave:increment "Добавить пользовательскую аутентификацию"
2231
+
2232
+ # 2. PM agent generates spec.md in Russian (natural, user-friendly)
2233
+
2234
+ # 3. post-increment-planning hook fires automatically
2235
+ # - Detects Russian content
2236
+ # - Translates spec.md, plan.md, tasks.md to English (~$0.01 cost)
2237
+ # - Files now in English (maintainable)
2238
+
2239
+ # User sees:
2240
+ # ✅ Increment created
2241
+ # 🌐 Detected Russian content. Translating to English...
2242
+ # 📄 spec.md... ✅
2243
+ # 📄 plan.md... ✅
2244
+ # 📄 tasks.md... ✅
2245
+ # ✅ Translation complete! Cost: ~$0.01
2246
+ ```
2247
+
2248
+ **Configuration** (`.specweave/config.json`):
2249
+
2250
+ ```json
2251
+ {
2252
+ "language": "ru",
2253
+ "translation": {
2254
+ "enabled": true,
2255
+ "autoTranslateInternalDocs": true,
2256
+ "autoTranslateLivingDocs": false,
2257
+ "keepFrameworkTerms": true,
2258
+ "keepTechnicalTerms": true,
2259
+ "translationModel": "haiku"
2260
+ }
2261
+ }
2262
+ ```
2263
+
2264
+ **Key Settings**:
2265
+ - `language`: Primary language (en, ru, es, zh, de, fr, ja, ko, pt)
2266
+ - `autoTranslateInternalDocs`: Auto-translate spec/plan/tasks to English (default: true)
2267
+ - `autoTranslateLivingDocs`: Auto-translate ADRs/HLDs after task completion (default: false)
2268
+ - `translationModel`: Model to use (haiku/sonnet/opus, default: haiku)
2269
+
2270
+ **Supported Languages**:
2271
+ - English (en)
2272
+ - Russian (ru)
2273
+ - Spanish (es)
2274
+ - Chinese (zh)
2275
+ - German (de)
2276
+ - French (fr)
2277
+ - Japanese (ja)
2278
+ - Korean (ko)
2279
+ - Portuguese (pt)
2280
+
2281
+ **Cost**: ~$0.01 per increment (3 files, Haiku model)
2282
+
2283
+ **Implementation Details**:
2284
+ - Language detection: Heuristic-based (<1ms, zero cost)
2285
+ - Code preservation: Never translates code blocks, inline code, or links
2286
+ - Validation: Checks heading count, code block count, link count, YAML structure
2287
+ - See: `.specweave/increments/0006-llm-native-i18n/reports/IMPLEMENTATION-COMPLETE.md`
2288
+
2289
+ **Testing Translation Utilities**:
2290
+
2291
+ ```bash
2292
+ # Run translation unit tests
2293
+ npm test -- tests/unit/i18n/translation.test.ts
2294
+
2295
+ # Test result: 67/67 passing (100%)
2296
+ ```
2297
+
2298
+ **Files**:
2299
+ - Utilities: `src/utils/translation.ts` (673 lines, 11 languages)
2300
+ - CLI Script: `src/hooks/lib/translate-file.ts` (398 lines)
2301
+ - Hook: `plugins/specweave/hooks/post-increment-planning.sh` (307 lines)
2302
+ - Tests: `tests/unit/i18n/translation.test.ts` (705 lines, 67 tests)
2303
+ - Schema: `src/core/schemas/specweave-config.schema.json`
2304
+
1516
2305
  ---
1517
2306
 
1518
2307
  ## Troubleshooting
1519
2308
 
1520
2309
  **Skills not activating?**
1521
- 1. Check YAML frontmatter in `SKILL.md`
1522
- 2. Verify installation: `ls ~/.claude/skills/skill-name/`
2310
+ 1. Check plugin is installed: `/plugin list --installed`
2311
+ 2. Verify YAML frontmatter in `plugins/{plugin}/skills/{skill}/SKILL.md`
1523
2312
  3. Restart Claude Code
1524
2313
  4. Check description has clear trigger keywords
1525
2314
 
1526
2315
  **Commands not working?**
1527
- 1. Verify file in `.claude/commands/`
1528
- 2. Check YAML frontmatter
1529
- 3. Restart Claude Code
1530
- 4. Check command name matches file name
2316
+ 1. Check plugin is installed: `/plugin list --installed`
2317
+ 2. Verify command exists: `plugins/{plugin}/commands/{command}.md`
2318
+ 3. Check YAML frontmatter
2319
+ 4. Restart Claude Code
1531
2320
 
1532
2321
  **Tests failing?**
1533
2322
  1. Run `npm run build` first
@@ -1563,27 +2352,51 @@ cd docs-site && npm run build
1563
2352
  ## Quick Reference
1564
2353
 
1565
2354
  **Commands (for SpecWeave development)**:
1566
- - `/specweave:inc "feature"` - Plan new increment
2355
+
2356
+ **IMPORTANT**: All commands MUST use the `/specweave:*` namespace prefix to avoid conflicts with Claude Code's native commands.
2357
+
2358
+ *Primary commands*:
2359
+ - `/specweave:increment "feature"` - Plan new increment
1567
2360
  - `/specweave:do` - Execute tasks (smart resume)
1568
- - `/specweave:progress` - Check status
1569
- - `/specweave:validate 0002` - Validate increment
1570
2361
  - `/specweave:done 0002` - Close increment
1571
- - `/specweave:sync-docs update` - Sync living docs
2362
+ - `/specweave:validate 0002` - Validate increment
2363
+ - `/specweave:qa 0002` - Quality assessment with risk scoring
2364
+ - `/specweave:status` - Show increment status overview
2365
+ - `/specweave:progress` - Check current increment progress
2366
+ - `/specweave:check-tests` - Validate test coverage (NEW format)
2367
+
2368
+ *State management (mostly automatic)*:
2369
+ - `/specweave:pause 0002 --reason="..."` - Pause active increment
2370
+ - `/specweave:resume 0002` - Resume paused increment
2371
+ - `/specweave:abandon 0002 --reason="..."` - Abandon increment
2372
+
2373
+ *Documentation sync*:
2374
+ - `/specweave:sync-docs update` - Sync living docs after implementation
2375
+ - `/specweave:sync-tasks` - Sync tasks with completion status
2376
+
2377
+ *Other commands*:
2378
+ - `/specweave:costs` - Show AI cost dashboard
2379
+ - `/specweave:translate` - Translate content
2380
+ - `/specweave:update-scope` - Log scope changes
2381
+ - `/specweave:next` - Smart increment transition
2382
+
2383
+ **NO SHORTCUTS**: Do NOT use shortcuts like `/inc`, `/do`, `/pause`, `/resume` etc. They conflict with Claude Code's native commands and will break functionality.
2384
+
2385
+ **File naming**: All commands are `specweave-{name}.md` (e.g., `specweave-increment.md`)
1572
2386
 
1573
2387
  **Build & Test**:
1574
2388
  - `npm run build` - Compile TypeScript
1575
- - `npm test` - Run all unit tests
2389
+ - `npm test` - Run unit tests (includes skill tests in `tests/unit/`, `tests/integration/`)
1576
2390
  - `npm run test:e2e` - Run Playwright E2E tests
1577
2391
  - `npm run test:integration` - Run integration tests
1578
- - `npm run install:all` - Sync src/ to .claude/
1579
2392
 
1580
2393
  **File Structure**:
1581
- - Source of truth: `src/`
1582
- - Installed: `.claude/`
2394
+ - Source of truth: `src/` (TypeScript) and `plugins/` (skills/agents/commands)
2395
+ - Plugin settings: `.claude/settings.json` (marketplace references)
1583
2396
  - Increments: `.specweave/increments/`
1584
- - Internal Docs (strategy, architecture): `.specweave/docs/internal/`
1585
- - Public Docs (user guides): `.specweave/docs/public/` and `docs-site/`
1586
- - Tests: `tests/`
2397
+ - Internal Docs: `.specweave/docs/internal/` (strategy, architecture, ADRs)
2398
+ - Public Docs: `.specweave/docs/public/` and `docs-site/` (user guides, API docs)
2399
+ - Tests: `tests/` (unit, integration, E2E, skill tests)
1587
2400
 
1588
2401
  ---
1589
2402
 
@@ -1595,4 +2408,4 @@ cd docs-site && npm run build
1595
2408
  5. Follow increment-based workflow
1596
2409
 
1597
2410
  **SpecWeave Documentation**: https://spec-weave.com
1598
- **Last Updated**: 2025-10-28 (Increment 0002)
2411
+ **Last Updated**: 2025-11-04