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,546 @@
1
+ ---
2
+ name: check-tests
3
+ description: Validate test coverage for increment tasks, check AC-ID coverage, report test status, and verify coverage targets (NEW format with embedded tests in tasks.md)
4
+ ---
5
+
6
+ # Check Tests - Test Coverage Validation
7
+
8
+ **Purpose**: Validate test coverage from tasks.md (NEW format with embedded tests)
9
+
10
+ **Replaces**: `validate-coverage` (old command for tests.md format)
11
+
12
+ Shows:
13
+ - Task test coverage status (which tasks have tests)
14
+ - Test pass/fail status (if tests implemented)
15
+ - Coverage targets vs actual coverage
16
+ - AC-ID coverage (which acceptance criteria are tested)
17
+ - Missing tests or gaps in coverage
18
+
19
+ ---
20
+
21
+ ## Usage
22
+
23
+ ```bash
24
+ # Check tests for current increment
25
+ /check-tests
26
+
27
+ # Check tests for specific increment
28
+ /check-tests 0007
29
+
30
+ # Detailed report with test case breakdown
31
+ /check-tests 0007 --detailed
32
+
33
+ # AC-ID coverage report only
34
+ /check-tests 0007 --ac-coverage
35
+ ```
36
+
37
+ ---
38
+
39
+ ## What It Does
40
+
41
+ ### Architecture Change (v0.7.0)
42
+
43
+ **OLD Format** (pre-v0.7.0):
44
+ - Separate tests.md file with TC-IDs
45
+ - validate-coverage command parsed tests.md
46
+
47
+ **NEW Format** (v0.7.0+):
48
+ - Embedded tests in tasks.md
49
+ - check-tests command parses tasks.md for test plans
50
+
51
+ **Why the change?**
52
+ - Single source of truth (no sync issues)
53
+ - Simpler architecture
54
+ - Industry-aligned (BDD, Agile patterns)
55
+
56
+ ---
57
+
58
+ ## Output Example (NEW Format)
59
+
60
+ ```bash
61
+ /check-tests 0007
62
+
63
+ 📊 Test Status Report: 0007-smart-increment-discipline
64
+
65
+ ═══════════════════════════════════════════════════════════════
66
+
67
+ Task Coverage Analysis:
68
+
69
+ ✅ T-001: Update plan.md (N/A - documentation)
70
+ Validation: Manual review complete
71
+
72
+ ✅ T-003: Create test-aware-planner structure (2 test cases, 85% coverage)
73
+ - Manual: Directory structure verified ✅
74
+ - Integration: tests/integration/test-aware-planner/agent-invocation.test.ts
75
+ • testAgentCanBeInvoked() ✅ (passed)
76
+ • testAgentReadsSpecPlan() ✅ (passed)
77
+ Coverage: 87% (target: 85%) ✅
78
+
79
+ ⚠️ T-007: Create check-tests command (0 test cases, 0% coverage)
80
+ WARNING: No test plan defined!
81
+ Action: Add test cases to T-007 or mark as non-testable
82
+
83
+ ❌ T-008: Implement check-tests logic (3 test cases, 45% coverage)
84
+ - Unit: tests/unit/check-tests.test.ts
85
+ • testParseTasksMd() ❌ (failing: Expected 3 tasks, got 2)
86
+ • testExtractTestCases() ✅ (passed)
87
+ • testCalculateCoverage() ⏸️ (not implemented)
88
+ Coverage: 45% ❌ (target: 85%, below threshold!)
89
+ Action: Fix failing test, implement missing test
90
+
91
+ ═══════════════════════════════════════════════════════════════
92
+
93
+ Overall Coverage: 72% ⚠️ (target: 80-90%)
94
+
95
+ Breakdown:
96
+ - Testable tasks: 15/24 (62%)
97
+ - Non-testable tasks: 9/24 (38%) ✅
98
+ - Average coverage (testable): 78% ⚠️
99
+ - Tests passing: 12/18 (67%) ⚠️
100
+ - Tests failing: 3/18 (17%) ❌
101
+ - Tests not implemented: 3/18 (17%) ⏸️
102
+
103
+ ═══════════════════════════════════════════════════════════════
104
+
105
+ Acceptance Criteria Coverage:
106
+
107
+ ✅ AC-US1-01: Covered by T-001, T-003 (6 tests, 88% coverage)
108
+ ✅ AC-US1-02: Covered by T-002, T-004 (4 tests, 92% coverage)
109
+ ⚠️ AC-US2-01: Partially covered by T-007 (0 tests)
110
+ Missing: Unit tests for command logic
111
+ ❌ AC-US3-05: Not covered by any task
112
+ Action: Add task for AC-US3-05 or mark as won't-do
113
+
114
+ ═══════════════════════════════════════════════════════════════
115
+
116
+ 🎯 Recommendations:
117
+
118
+ Priority: P1 (blocking issues)
119
+ 1. Fix failing test in T-008: testParseTasksMd()
120
+ 2. Implement missing test in T-008: testCalculateCoverage()
121
+ 3. Add test plan to T-007 or mark as non-testable
122
+
123
+ Priority: P2 (coverage gaps)
124
+ 4. Increase coverage in T-008 to ≥85%
125
+ 5. Add unit tests for AC-US2-01
126
+ 6. Create task for uncovered AC-US3-05
127
+
128
+ ═══════════════════════════════════════════════════════════════
129
+
130
+ Summary:
131
+ - Status: ⚠️ NEEDS WORK (coverage below 80%, failing tests)
132
+ - Next: Fix failing tests, implement missing tests
133
+ - Run: npm test (to re-run all tests)
134
+ ```
135
+
136
+ ---
137
+
138
+ ## Detailed Report (--detailed flag)
139
+
140
+ ```bash
141
+ /check-tests 0007 --detailed
142
+
143
+ [Shows expanded report with:]
144
+ - Full test case breakdown per task
145
+ - Code coverage metrics per file
146
+ - Test execution times
147
+ - Test file paths and line numbers
148
+ - Suggestions for improving coverage
149
+ ```
150
+
151
+ ---
152
+
153
+ ## AC Coverage Report (--ac-coverage flag)
154
+
155
+ ```bash
156
+ /check-tests 0007 --ac-coverage
157
+
158
+ ═══════════════════════════════════════════════════════════════
159
+
160
+ Acceptance Criteria Coverage Report: 0007
161
+
162
+ ✅ AC-US1-01: User can login with email/password
163
+ Covered by: T-001, T-003
164
+ Test cases: 6 (unit: 3, integration: 2, E2E: 1)
165
+ Coverage: 88%
166
+ Status: ✅ PASSING
167
+
168
+ ✅ AC-US1-02: User can logout
169
+ Covered by: T-002, T-004
170
+ Test cases: 4 (unit: 2, integration: 2)
171
+ Coverage: 92%
172
+ Status: ✅ PASSING
173
+
174
+ ⚠️ AC-US2-01: Command validates test coverage
175
+ Covered by: T-007, T-008
176
+ Test cases: 3 (unit: 3)
177
+ Coverage: 45% ⚠️
178
+ Status: ⚠️ PARTIAL (1 failing, 1 not implemented)
179
+
180
+ ❌ AC-US3-05: Documentation is complete
181
+ Covered by: NONE
182
+ Test cases: 0
183
+ Coverage: 0%
184
+ Status: ❌ NOT COVERED
185
+
186
+ ═══════════════════════════════════════════════════════════════
187
+
188
+ Summary:
189
+ - Total AC-IDs: 4
190
+ - Fully covered: 2 (50%)
191
+ - Partially covered: 1 (25%)
192
+ - Not covered: 1 (25%)
193
+ - Overall AC coverage: 75% ⚠️
194
+ ```
195
+
196
+ ---
197
+
198
+ ## What It Checks
199
+
200
+ ### 1. Task Test Coverage
201
+
202
+ For each task in tasks.md:
203
+
204
+ **Testable tasks**:
205
+ - Parses "Test Plan" section (Given/When/Then)
206
+ - Extracts "Test Cases" (unit/integration/E2E)
207
+ - Checks if test files exist
208
+ - Runs tests (if implemented)
209
+ - Compares actual vs target coverage
210
+
211
+ **Non-testable tasks**:
212
+ - Verifies "Test Plan: N/A" is set
213
+ - Checks "Validation" section exists
214
+ - Reports validation methods
215
+
216
+ ### 2. Test Execution Status
217
+
218
+ - ✅ Passing tests (green)
219
+ - ❌ Failing tests (red, shows error)
220
+ - ⏸️ Not implemented (gray, needs implementation)
221
+ - 🚫 Test file missing (needs creation)
222
+
223
+ ### 3. Coverage Metrics
224
+
225
+ - Per-task coverage (from task definition)
226
+ - Per-test-level coverage (unit/int/E2E)
227
+ - Overall increment coverage
228
+ - Comparison to target (80-90%)
229
+
230
+ ### 4. AC-ID Coverage
231
+
232
+ - Maps AC-IDs from spec.md → tasks in tasks.md
233
+ - Checks which AC-IDs have test coverage
234
+ - Identifies untested acceptance criteria
235
+ - Reports partial vs full coverage
236
+
237
+ ### 5. Recommendations
238
+
239
+ Priority-based action items:
240
+ - **P1 (blocking)**: Failing tests, missing critical tests
241
+ - **P2 (important)**: Coverage gaps, untested AC-IDs
242
+ - **P3 (nice-to-have)**: Minor coverage improvements
243
+
244
+ ---
245
+
246
+ ## How It Works (NEW Format)
247
+
248
+ ### Step 1: Parse tasks.md
249
+
250
+ ```typescript
251
+ // Pseudo-code for check-tests logic
252
+
253
+ const tasks = parseTasksMd('.specweave/increments/0007/tasks.md');
254
+
255
+ for (const task of tasks) {
256
+ if (task.testPlan === 'N/A') {
257
+ // Non-testable task
258
+ reportValidation(task);
259
+ } else {
260
+ // Testable task
261
+ const testCases = extractTestCases(task);
262
+ const results = runTests(testCases);
263
+ const coverage = calculateCoverage(results);
264
+
265
+ reportTestStatus(task, testCases, results, coverage);
266
+ }
267
+ }
268
+ ```
269
+
270
+ ### Step 2: Extract Test Cases
271
+
272
+ From each task's "Test Cases" section:
273
+
274
+ ```markdown
275
+ **Test Cases**:
276
+ 1. **Unit**: `tests/unit/auth.test.ts`
277
+ - testValidLogin(): ...
278
+ - testInvalidLogin(): ...
279
+ ```
280
+
281
+ Extracts:
282
+ - Test level (Unit, Integration, E2E)
283
+ - Test file path
284
+ - Test function names
285
+ - Coverage target
286
+
287
+ ### Step 3: Run Tests (if implemented)
288
+
289
+ ```bash
290
+ # For each test file, run:
291
+ npm test tests/unit/auth.test.ts
292
+
293
+ # Capture:
294
+ # - Pass/fail status
295
+ # - Error messages
296
+ # - Code coverage %
297
+ ```
298
+
299
+ ### Step 4: Compare Coverage
300
+
301
+ ```
302
+ Actual coverage: 87%
303
+ Target coverage: 85%
304
+ Status: ✅ PASSING (actual ≥ target)
305
+ ```
306
+
307
+ ### Step 5: Check AC-ID Coverage
308
+
309
+ ```markdown
310
+ # From spec.md:
311
+ AC-US1-01: User can login
312
+
313
+ # From tasks.md:
314
+ T-001: Implement login
315
+ Acceptance Criteria: AC-US1-01
316
+
317
+ # Result:
318
+ AC-US1-01 → Covered by T-001 ✅
319
+ ```
320
+
321
+ ---
322
+
323
+ ## Backward Compatibility (OLD Format)
324
+
325
+ **If increment has tests.md** (pre-v0.7.0):
326
+
327
+ ```bash
328
+ /check-tests 0003 # Old format increment
329
+
330
+ ⚠️ OLD FORMAT DETECTED: tests.md exists
331
+
332
+ This increment uses the old format (separate tests.md).
333
+ The check-tests command supports both formats.
334
+
335
+ [Parses tests.md with TC-IDs instead of tasks.md]
336
+
337
+ 📊 Test Status Report: 0003 (OLD FORMAT)
338
+
339
+ Test Case Coverage:
340
+ ✅ TC-001: User can login (3 tests, 90% coverage)
341
+ ...
342
+ ```
343
+
344
+ **Detection logic**:
345
+
346
+ ```typescript
347
+ const hasTestsMd = fs.existsSync('.specweave/increments/0003/tests.md');
348
+
349
+ if (hasTestsMd) {
350
+ // OLD FORMAT: Parse tests.md for TC-IDs
351
+ return checkTestsOldFormat(incrementId);
352
+ } else {
353
+ // NEW FORMAT: Parse tasks.md for embedded tests
354
+ return checkTestsNewFormat(incrementId);
355
+ }
356
+ ```
357
+
358
+ ---
359
+
360
+ ## Integration with Workflow
361
+
362
+ **When to run check-tests**:
363
+
364
+ 1. **During development**: After implementing tasks
365
+ ```bash
366
+ # Implement T-001
367
+ # Write tests
368
+ /check-tests # Verify tests pass
369
+ ```
370
+
371
+ 2. **Before PR**: Ensure coverage meets targets
372
+ ```bash
373
+ /check-tests 0007
374
+ # Fix any failing tests
375
+ # Commit and push
376
+ ```
377
+
378
+ 3. **In CI/CD**: Automated test validation
379
+ ```bash
380
+ # In .github/workflows/test.yml
381
+ - name: Check test coverage
382
+ run: npx specweave check-tests $INCREMENT_ID
383
+ ```
384
+
385
+ 4. **PM Gate 2**: Part of increment closure
386
+ ```bash
387
+ /done 0007
388
+ # PM Agent runs /check-tests automatically
389
+ # Verifies >80% coverage before closure
390
+ ```
391
+
392
+ ---
393
+
394
+ ## Exit Codes
395
+
396
+ For CI/CD integration:
397
+
398
+ ```bash
399
+ /check-tests 0007
400
+ echo $? # Exit code
401
+
402
+ # Exit codes:
403
+ # 0 = All tests passing, coverage ≥80%
404
+ # 1 = Tests failing
405
+ # 2 = Coverage <80%
406
+ # 3 = AC-IDs not covered
407
+ # 4 = Command error (invalid increment, etc.)
408
+ ```
409
+
410
+ ---
411
+
412
+ ## Files Read
413
+
414
+ The command reads:
415
+ - `.specweave/increments/{id}/tasks.md` (NEW format)
416
+ - `.specweave/increments/{id}/tests.md` (OLD format, if exists)
417
+ - `.specweave/increments/{id}/spec.md` (for AC-IDs)
418
+ - Test files (to check existence)
419
+ - Coverage reports (if generated)
420
+
421
+ ---
422
+
423
+ ## Related Commands
424
+
425
+ - `/validate 0007` - Full increment validation (tasks, tests, docs)
426
+ - `/progress` - Current increment progress with test status
427
+ - `/done 0007` - Close increment (runs check-tests automatically)
428
+
429
+ ---
430
+
431
+ ## Comparison: OLD vs NEW Command
432
+
433
+ | Aspect | OLD (validate-coverage) | NEW (check-tests) |
434
+ |--------|------------------------|-------------------|
435
+ | **Reads** | tests.md | tasks.md |
436
+ | **Test IDs** | TC-001, TC-002 | Function names |
437
+ | **Format** | Separate file | Embedded in tasks |
438
+ | **BDD** | No | Yes (Given/When/Then) |
439
+ | **AC Traceability** | Manual | Automatic (AC-IDs) |
440
+ | **Sync Issues** | tasks ↔ tests | None (single file) |
441
+ | **Coverage Target** | Per test case | Per task + overall |
442
+ | **Status** | Deprecated (v0.7+) | Current |
443
+
444
+ ---
445
+
446
+ ## Technical Implementation Notes
447
+
448
+ For developers working on check-tests logic (T-008):
449
+
450
+ ### Input: tasks.md (NEW format)
451
+
452
+ ```markdown
453
+ ### T-001: Implement Feature
454
+
455
+ **Test Plan**:
456
+ - **Given** precondition
457
+ - **When** action
458
+ - **Then** outcome
459
+
460
+ **Test Cases**:
461
+ 1. **Unit**: `tests/unit/feature.test.ts`
462
+ - testFeatureSuccess(): ...
463
+ - **Coverage Target**: 90%
464
+ **Overall Coverage Target**: 85%
465
+ ```
466
+
467
+ ### Parsing Logic
468
+
469
+ ```typescript
470
+ interface TaskTest {
471
+ taskId: string;
472
+ testPlan: TestPlan | 'N/A';
473
+ testCases: TestCase[];
474
+ overallTarget: number;
475
+ }
476
+
477
+ interface TestPlan {
478
+ given: string;
479
+ when: string;
480
+ then: string;
481
+ and?: string;
482
+ }
483
+
484
+ interface TestCase {
485
+ level: 'Unit' | 'Integration' | 'E2E';
486
+ filePath: string;
487
+ functions: string[];
488
+ target: number;
489
+ }
490
+ ```
491
+
492
+ ### Test Execution
493
+
494
+ ```typescript
495
+ async function runTest(testCase: TestCase): Promise<TestResult> {
496
+ // Run: npm test {filePath}
497
+ // Parse output for pass/fail
498
+ // Extract coverage %
499
+ return {
500
+ passed: boolean,
501
+ coverage: number,
502
+ errors: string[]
503
+ };
504
+ }
505
+ ```
506
+
507
+ ### Report Generation
508
+
509
+ ```typescript
510
+ function generateReport(results: TaskTest[]): Report {
511
+ return {
512
+ taskCoverage: calculateTaskCoverage(results),
513
+ acCoverage: calculateACCoverage(results, specMd),
514
+ recommendations: generateRecommendations(results),
515
+ overallStatus: determineStatus(results)
516
+ };
517
+ }
518
+ ```
519
+
520
+ ---
521
+
522
+ ## Future Enhancements (Post-v0.7.0)
523
+
524
+ - **Visual coverage reports**: HTML report generation
525
+ - **Trend tracking**: Coverage over time (per increment)
526
+ - **Auto-fix suggestions**: "Run this command to fix coverage"
527
+ - **Integration with IDEs**: VS Code extension
528
+ - **Parallel test execution**: Speed up large test suites
529
+
530
+ ---
531
+
532
+ ## Summary
533
+
534
+ **check-tests** is the NEW command (v0.7.0+) for validating test coverage from tasks.md with embedded test plans.
535
+
536
+ **Key Features**:
537
+ - ✅ Parses tasks.md (NEW format)
538
+ - ✅ Checks AC-ID coverage
539
+ - ✅ Reports test pass/fail status
540
+ - ✅ Validates coverage targets (80-90%)
541
+ - ✅ Backward compatible (supports old tests.md format)
542
+ - ✅ Generates actionable recommendations
543
+
544
+ **Replaces**: validate-coverage (deprecated)
545
+
546
+ **See also**: ARCHITECTURE-PIVOT.md (rationale for NEW format)
@@ -5,8 +5,6 @@ description: Execute increment implementation following spec and plan - hooks ru
5
5
 
6
6
  # Do Increment
7
7
 
8
- **⚡ Convenient Short Form**: Use `/do` for quick access, or `/specweave:do` for explicit namespace.
9
-
10
8
  **Implementation Execution**: Following spec.md and plan.md to execute the increment work.
11
9
 
12
10
  You are helping the user implement a SpecWeave increment by executing tasks from tasks.md with automatic documentation updates after EVERY task completion.
@@ -15,15 +13,15 @@ You are helping the user implement a SpecWeave increment by executing tasks from
15
13
 
16
14
  ```bash
17
15
  # Auto-resumes from last incomplete task
18
- /do <increment-id>
16
+ /specweave:do <increment-id>
19
17
 
20
18
  # Or let it find active increment automatically
21
- /do
19
+ /specweave:do
22
20
 
23
21
  # Override model selection for all tasks (advanced)
24
- /do <increment-id> --model haiku
25
- /do <increment-id> --model sonnet
26
- /do <increment-id> --model opus
22
+ /specweave:do <increment-id> --model haiku
23
+ /specweave:do <increment-id> --model sonnet
24
+ /specweave:do <increment-id> --model opus
27
25
  ```
28
26
 
29
27
  ## Arguments