specweave 0.6.8 → 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 (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 +90 -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,499 @@
1
+ ---
2
+ name: increment-quality-judge-v2
3
+ description: Enhanced AI-powered quality assessment with RISK SCORING (BMAD pattern) and quality gate decisions. Evaluates specifications, plans, and tests for clarity, testability, completeness, feasibility, maintainability, edge cases, and RISKS. Provides PASS/CONCERNS/FAIL decisions. Activates for validate quality, quality check, assess spec, evaluate increment, spec review, quality score, risk assessment, qa check, quality gate, /qa command.
4
+ allowed-tools: Read, Grep, Glob
5
+ ---
6
+
7
+ # Increment Quality Judge v2.0
8
+
9
+ Risk Assessment + Quality Gate Decisions
10
+
11
+ AI-powered quality assessment with BMAD-pattern risk scoring and formal quality gate decisions (PASS/CONCERNS/FAIL).
12
+
13
+ ## What's New in v2.0
14
+
15
+ 1. **Risk Assessment Dimension** - Probability × Impact scoring (0-10 scale, BMAD pattern)
16
+ 2. **Quality Gate Decisions** - Formal PASS/CONCERNS/FAIL with thresholds
17
+ 3. **NFR Checking** - Non-functional requirements (performance, security, scalability)
18
+ 4. **Enhanced Output** - Blockers, concerns, recommendations with actionable mitigations
19
+ 5. **7 Dimensions** - Added "Risk" to the existing 6 dimensions
20
+
21
+ ## Purpose
22
+
23
+ Provide comprehensive quality assessment that goes beyond structural validation to evaluate:
24
+ - ✅ Specification quality (6 dimensions)
25
+ - ✅ **Risk levels (BMAD P×I scoring)** - NEW!
26
+ - ✅ **Quality gate readiness (PASS/CONCERNS/FAIL)** - NEW!
27
+
28
+ ## When to Use
29
+
30
+ **Auto-activates for**:
31
+ - `/qa {increment-id}` command
32
+ - `/qa {increment-id} --pre` (pre-implementation check)
33
+ - `/qa {increment-id} --gate` (quality gate check)
34
+ - Natural language: "assess quality of increment 0001"
35
+
36
+ **Keywords**:
37
+ - validate quality, quality check, assess spec
38
+ - evaluate increment, spec review, quality score
39
+ - risk assessment, qa check, quality gate
40
+ - PASS/CONCERNS/FAIL
41
+
42
+ ## Evaluation Dimensions (7 total, was 6)
43
+
44
+ ```yaml
45
+ dimensions:
46
+ clarity:
47
+ weight: 0.18 # was 0.20
48
+ criteria:
49
+ - "Is the problem statement clear?"
50
+ - "Are objectives well-defined?"
51
+ - "Is terminology consistent?"
52
+
53
+ testability:
54
+ weight: 0.22 # was 0.25
55
+ criteria:
56
+ - "Are acceptance criteria testable?"
57
+ - "Can success be measured objectively?"
58
+ - "Are edge cases identifiable?"
59
+
60
+ completeness:
61
+ weight: 0.18 # was 0.20
62
+ criteria:
63
+ - "Are all requirements addressed?"
64
+ - "Is error handling specified?"
65
+ - "Are non-functional requirements included?"
66
+
67
+ feasibility:
68
+ weight: 0.13 # was 0.15
69
+ criteria:
70
+ - "Is the architecture scalable?"
71
+ - "Are technical constraints realistic?"
72
+ - "Is timeline achievable?"
73
+
74
+ maintainability:
75
+ weight: 0.09 # was 0.10
76
+ criteria:
77
+ - "Is design modular?"
78
+ - "Are extension points identified?"
79
+ - "Is technical debt addressed?"
80
+
81
+ edge_cases:
82
+ weight: 0.09 # was 0.10
83
+ criteria:
84
+ - "Are failure scenarios covered?"
85
+ - "Are performance limits specified?"
86
+ - "Are security considerations included?"
87
+
88
+ # NEW: Risk Assessment (BMAD pattern)
89
+ risk:
90
+ weight: 0.11 # NEW!
91
+ criteria:
92
+ - "Are security risks identified and mitigated?"
93
+ - "Are technical risks (scalability, performance) addressed?"
94
+ - "Are implementation risks (complexity, dependencies) managed?"
95
+ - "Are operational risks (monitoring, support) considered?"
96
+ ```
97
+
98
+ ## Risk Assessment (BMAD Pattern) - NEW!
99
+
100
+ ### Risk Scoring Formula
101
+
102
+ ```
103
+ Risk Score = Probability × Impact
104
+
105
+ Probability (0.0-1.0):
106
+ - 0.0-0.3: Low (unlikely to occur)
107
+ - 0.4-0.6: Medium (may occur)
108
+ - 0.7-1.0: High (likely to occur)
109
+
110
+ Impact (1-10):
111
+ - 1-3: Minor (cosmetic, no user impact)
112
+ - 4-6: Moderate (some impact, workaround exists)
113
+ - 7-9: Major (significant impact, no workaround)
114
+ - 10: Critical (system failure, data loss, security breach)
115
+
116
+ Final Score (0.0-10.0):
117
+ - 9.0-10.0: CRITICAL risk (FAIL quality gate)
118
+ - 6.0-8.9: HIGH risk (CONCERNS quality gate)
119
+ - 3.0-5.9: MEDIUM risk (PASS with monitoring)
120
+ - 0.0-2.9: LOW risk (PASS)
121
+ ```
122
+
123
+ ### Risk Categories
124
+
125
+ 1. **Security Risks**
126
+ - OWASP Top 10 vulnerabilities
127
+ - Data exposure, authentication, authorization
128
+ - Cryptographic failures
129
+
130
+ 2. **Technical Risks**
131
+ - Architecture complexity, scalability bottlenecks
132
+ - Performance issues, technical debt
133
+
134
+ 3. **Implementation Risks**
135
+ - Tight timeline, external dependencies
136
+ - Technical complexity
137
+
138
+ 4. **Operational Risks**
139
+ - Lack of monitoring, difficult to maintain
140
+ - Poor documentation
141
+
142
+ ### Risk Assessment Prompt
143
+
144
+ ```markdown
145
+ You are evaluating SOFTWARE RISKS for an increment using BMAD's Probability × Impact scoring.
146
+
147
+ Read increment files:
148
+ - .specweave/increments/{id}/spec.md
149
+ - .specweave/increments/{id}/plan.md
150
+
151
+ For EACH risk you identify:
152
+
153
+ 1. **Calculate PROBABILITY** (0.0-1.0)
154
+ - Based on spec clarity, past experience, complexity
155
+ - Low: 0.2, Medium: 0.5, High: 0.8
156
+
157
+ 2. **Calculate IMPACT** (1-10)
158
+ - 10 = Critical (security breach, data loss, system failure)
159
+ - 7-9 = Major (significant user impact, no workaround)
160
+ - 4-6 = Moderate (some impact, workaround exists)
161
+ - 1-3 = Minor (cosmetic, no user impact)
162
+
163
+ 3. **Calculate RISK SCORE** = Probability × Impact
164
+
165
+ 4. **Provide MITIGATION** strategy
166
+
167
+ 5. **Link to ACCEPTANCE CRITERIA** (if applicable)
168
+
169
+ Output format (JSON):
170
+ {
171
+ "risks": [
172
+ {
173
+ "id": "RISK-001",
174
+ "category": "security",
175
+ "title": "Password storage not specified",
176
+ "description": "Spec doesn't mention password hashing algorithm",
177
+ "probability": 0.9,
178
+ "impact": 10,
179
+ "score": 9.0,
180
+ "severity": "CRITICAL",
181
+ "mitigation": "Use bcrypt or Argon2, never plain text",
182
+ "location": "spec.md, Authentication section",
183
+ "acceptance_criteria": "AC-US1-01"
184
+ }
185
+ ],
186
+ "overall_risk_score": 7.5,
187
+ "dimension_score": 0.35
188
+ }
189
+ ```
190
+
191
+ ## Quality Gate Decisions - NEW!
192
+
193
+ ### Decision Logic
194
+
195
+ ```typescript
196
+ enum QualityGateDecision {
197
+ PASS = "PASS", // Ready for production
198
+ CONCERNS = "CONCERNS", // Issues found, should address
199
+ FAIL = "FAIL" // Blockers, must fix
200
+ }
201
+
202
+ Thresholds (BMAD pattern):
203
+
204
+ FAIL if any:
205
+ - Risk score ≥ 9.0 (CRITICAL)
206
+ - Test coverage < 60%
207
+ - Spec quality < 50
208
+ - Critical security vulnerabilities ≥ 1
209
+
210
+ CONCERNS if any:
211
+ - Risk score 6.0-8.9 (HIGH)
212
+ - Test coverage < 80%
213
+ - Spec quality < 70
214
+ - High security vulnerabilities ≥ 1
215
+
216
+ PASS otherwise
217
+ ```
218
+
219
+ ### Output Example
220
+
221
+ ```bash
222
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
223
+ QA ASSESSMENT: Increment 0008-user-authentication
224
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
225
+
226
+ Overall Score: 82/100 (GOOD) ✓
227
+
228
+ Dimension Scores:
229
+ Clarity: 90/100 ✓✓
230
+ Testability: 75/100 ⚠️
231
+ Completeness: 88/100 ✓
232
+ Feasibility: 85/100 ✓
233
+ Maintainability: 80/100 ✓
234
+ Edge Cases: 70/100 ⚠️
235
+ Risk Assessment: 65/100 ⚠️ (7.2/10 risk score)
236
+
237
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
238
+ RISKS IDENTIFIED (3)
239
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
240
+
241
+ 🔴 RISK-001: CRITICAL (9.0/10)
242
+ Category: Security
243
+ Title: Password storage implementation
244
+ Description: Spec doesn't specify password hashing
245
+ Probability: 0.9 (High) × Impact: 10 (Critical)
246
+ Location: spec.md, Authentication section
247
+ Mitigation: Use bcrypt/Argon2, never plain text
248
+ AC: AC-US1-01
249
+
250
+ 🟡 RISK-002: HIGH (6.0/10)
251
+ Category: Security
252
+ Title: Rate limiting not specified
253
+ Description: No brute-force protection mentioned
254
+ Probability: 0.6 (Medium) × Impact: 10 (Critical)
255
+ Location: spec.md, Security section
256
+ Mitigation: Add 5 failed attempts → 15 min lockout
257
+ AC: AC-US1-03
258
+
259
+ 🟢 RISK-003: LOW (2.4/10)
260
+ Category: Technical
261
+ Title: Session storage scalability
262
+ Description: Plan uses in-memory sessions
263
+ Probability: 0.4 (Medium) × Impact: 6 (Moderate)
264
+ Location: plan.md, Architecture section
265
+ Mitigation: Use Redis for session store
266
+
267
+ Overall Risk Score: 7.2/10 (MEDIUM-HIGH)
268
+
269
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
270
+ QUALITY GATE DECISION
271
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
272
+
273
+ 🟡 CONCERNS (Not Ready for Production)
274
+
275
+ Blockers (MUST FIX):
276
+ 1. 🔴 CRITICAL RISK: Password storage (Risk ≥9)
277
+ → Add task: "Implement bcrypt password hashing"
278
+
279
+ Concerns (SHOULD FIX):
280
+ 2. 🟡 HIGH RISK: Rate limiting not specified (Risk ≥6)
281
+ → Update spec.md: Add rate limiting section
282
+ → Add E2E test for rate limiting
283
+
284
+ 3. ⚠️ Testability: 75/100 (target: 80+)
285
+ → Make acceptance criteria more measurable
286
+
287
+ Recommendations (NICE TO FIX):
288
+ 4. Edge cases: 70/100
289
+ → Add error handling scenarios
290
+ 5. Session scalability
291
+ → Consider Redis for session store
292
+
293
+ Decision: Address 1 blocker before proceeding
294
+
295
+ Would you like to:
296
+ [E] Export blockers to tasks.md
297
+ [U] Update spec.md with fixes (experimental)
298
+ [C] Continue without changes
299
+ ```
300
+
301
+ ## Workflow Integration
302
+
303
+ ### Quick Mode (Default)
304
+
305
+ ```
306
+ User: /qa 0001
307
+
308
+ Step 1: Rule-based validation (120 checks) - FREE, FAST
309
+ ├── If FAILED → Stop, show errors
310
+ └── If PASSED → Continue
311
+
312
+ Step 2: AI Quality Assessment (Quick)
313
+ ├── Spec quality (6 dimensions)
314
+ ├── Risk assessment (BMAD P×I)
315
+ └── Quality gate decision (PASS/CONCERNS/FAIL)
316
+
317
+ Output: Enhanced report with risks and gate decision
318
+ ```
319
+
320
+ ### Pre-Implementation Mode
321
+
322
+ ```
323
+ User: /qa 0001 --pre
324
+
325
+ Checks:
326
+ ✅ Spec quality (clarity, testability, completeness)
327
+ ✅ Risk assessment (identify issues early)
328
+ ✅ Architecture review (plan.md soundness)
329
+ ✅ Test strategy (test plan in tasks.md)
330
+
331
+ Gate decision before implementation starts
332
+ ```
333
+
334
+ ### Quality Gate Mode
335
+
336
+ ```
337
+ User: /qa 0001 --gate
338
+
339
+ Comprehensive checks:
340
+ ✅ All pre-implementation checks
341
+ ✅ Test coverage (AC-ID coverage, gaps)
342
+ ✅ E2E test coverage
343
+ ✅ Documentation completeness
344
+
345
+ Final gate decision before closing increment
346
+ ```
347
+
348
+ ## Enhanced Scoring Algorithm
349
+
350
+ ### Step 1: Dimension Evaluation (7 dimensions)
351
+
352
+ For each dimension (including NEW risk dimension), use Chain-of-Thought prompting:
353
+
354
+ ```markdown
355
+ <thinking>
356
+ 1. Read spec.md thoroughly
357
+ 2. For risk dimension specifically:
358
+ - Identify all risks (security, technical, implementation, operational)
359
+ - For each risk: calculate P, I, Score
360
+ - Group by category
361
+ - Calculate overall risk score
362
+ 3. For other dimensions: evaluate criteria as before
363
+ 4. Score 0.00-1.00
364
+ 5. Identify issues
365
+ 6. Provide suggestions
366
+ </thinking>
367
+
368
+ Score: 0.XX
369
+ ```
370
+
371
+ ### Step 2: Weighted Overall Score (NEW weights)
372
+
373
+ ```typescript
374
+ overall_score =
375
+ (clarity * 0.18) +
376
+ (testability * 0.22) +
377
+ (completeness * 0.18) +
378
+ (feasibility * 0.13) +
379
+ (maintainability * 0.09) +
380
+ (edge_cases * 0.09) +
381
+ (risk * 0.11) // NEW!
382
+ ```
383
+
384
+ ### Step 3: Quality Gate Decision
385
+
386
+ ```typescript
387
+ gate_decision = decide({
388
+ spec_quality: overall_score,
389
+ risk_score: risk_assessment.overall_risk_score,
390
+ test_coverage: test_coverage.percentage, // if available
391
+ security_audit: security_audit // if available
392
+ })
393
+ ```
394
+
395
+ ## Token Usage
396
+
397
+ **Estimated per increment** (Quick mode):
398
+ - Small spec (<100 lines): ~2,500 tokens (~$0.025)
399
+ - Medium spec (100-250 lines): ~3,500 tokens (~$0.035)
400
+ - Large spec (>250 lines): ~5,000 tokens (~$0.050)
401
+
402
+ **Cost increase from v1.0**: +25% (added risk assessment dimension)
403
+
404
+ **Optimization**:
405
+ - Only evaluate spec.md + plan.md for risks
406
+ - Cache risk patterns for 5 min
407
+ - Skip risk assessment if spec < 50 lines (too small to assess)
408
+
409
+ ## Configuration
410
+
411
+ ```json
412
+ {
413
+ "qa": {
414
+ "qualityGateThresholds": {
415
+ "fail": {
416
+ "riskScore": 9.0,
417
+ "testCoverage": 60,
418
+ "specQuality": 50,
419
+ "criticalVulnerabilities": 1
420
+ },
421
+ "concerns": {
422
+ "riskScore": 6.0,
423
+ "testCoverage": 80,
424
+ "specQuality": 70,
425
+ "highVulnerabilities": 1
426
+ }
427
+ },
428
+ "dimensions": {
429
+ "risk": {
430
+ "enabled": true,
431
+ "weight": 0.11
432
+ }
433
+ }
434
+ }
435
+ }
436
+ ```
437
+
438
+ ## Migration from v1.0
439
+
440
+ **v1.0 (6 dimensions)**:
441
+ - Clarity, Testability, Completeness, Feasibility, Maintainability, Edge Cases
442
+
443
+ **v2.0 (7 dimensions, NEW: Risk)**:
444
+ - All v1.0 dimensions + Risk Assessment
445
+ - Weights adjusted to accommodate new dimension
446
+ - Quality gate decisions added
447
+ - BMAD risk scoring added
448
+
449
+ **Backward Compatibility**:
450
+ - v1.0 skills still work (auto-upgrade to v2.0 if risk assessment enabled)
451
+ - Existing scores rescaled to new weights automatically
452
+ - Can disable risk assessment in config to revert to v1.0 behavior
453
+
454
+ ## Best Practices
455
+
456
+ 1. **Run early and often**: Use `--pre` mode before implementation
457
+ 2. **Fix blockers immediately**: Don't proceed if FAIL
458
+ 3. **Address concerns before release**: CONCERNS = should fix
459
+ 4. **Use risk scores to prioritize**: Fix CRITICAL risks first
460
+ 5. **Export to tasks.md**: Convert blockers/concerns to actionable tasks
461
+
462
+ ## Limitations
463
+
464
+ **What quality-judge v2.0 CAN'T do**:
465
+ - ❌ Understand domain-specific compliance (HIPAA, PCI-DSS)
466
+ - ❌ Verify technical feasibility with actual codebase
467
+ - ❌ Replace human expertise and security audits
468
+ - ❌ Predict actual probability without historical data
469
+
470
+ **What quality-judge v2.0 CAN do**:
471
+ - ✅ Catch vague or ambiguous language
472
+ - ✅ Identify missing security considerations (OWASP-based)
473
+ - ✅ Spot untestable acceptance criteria
474
+ - ✅ Suggest industry best practices
475
+ - ✅ Flag missing edge cases
476
+ - ✅ **Assess risks systematically (BMAD pattern)** - NEW!
477
+ - ✅ **Provide formal quality gate decisions** - NEW!
478
+
479
+ ## Summary
480
+
481
+ **increment-quality-judge v2.0** adds comprehensive risk assessment and quality gate decisions:
482
+
483
+ ✅ **Risk assessment** (BMAD P×I scoring, 0-10 scale)
484
+ ✅ **Quality gate decisions** (PASS/CONCERNS/FAIL with thresholds)
485
+ ✅ **7 dimensions** (added "Risk" to existing 6)
486
+ ✅ **NFR checking** (performance, security, scalability)
487
+ ✅ **Enhanced output** (blockers, concerns, recommendations)
488
+ ✅ **Chain-of-thought** (LLM-as-Judge 2025 best practices)
489
+ ✅ **Backward compatible** (can disable risk assessment)
490
+
491
+ **Use it when**: You want comprehensive quality assessment with risk scoring and formal gate decisions before implementation or release.
492
+
493
+ **Skip it when**: Quick iteration, tight token budget, or simple features where rule-based validation suffices.
494
+
495
+ ---
496
+
497
+ **Version**: 2.0.0
498
+ **Since**: v0.8.0
499
+ **Related**: /qa command, QAOrchestrator agent (v0.9.0)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: plugin-detector
3
- description: Detects when SpecWeave plugins are needed and guides installation. Activates for GitHub sync, Kubernetes deployment, Figma integration, ML pipelines, payment processing, React/frontend development, backend APIs, and other domain-specific features requiring plugins.
3
+ description: Detects when SpecWeave plugins are needed based on tech stack mentions. Activates for frontend (Next.js, React, Vue), backend (.NET, Node.js, Python), infrastructure (Docker, K8s), external tools (GitHub, JIRA), payments (Stripe), ML (TensorFlow), testing (Playwright), and design (Figma).
4
4
  ---
5
5
 
6
6
  # SpecWeave Plugin Detector
@@ -33,6 +33,41 @@ When you mention capabilities that require specific SpecWeave plugins:
33
33
 
34
34
  ## How I Help
35
35
 
36
+ ### Mode 1: Passive Tech Stack Detection (NEW!)
37
+
38
+ When users mention tech stacks in ANY question (not just increments), I automatically:
39
+
40
+ 1. **Scan project structure** using `src/utils/plugin-detection.ts`:
41
+ - Check package.json dependencies
42
+ - Detect .NET (*.csproj), Python (requirements.txt), etc.
43
+ - Find Docker, Kubernetes, infrastructure files
44
+ - Identify framework-specific patterns
45
+
46
+ 2. **Detect missing plugins**:
47
+ - Compare detected tech stack vs installed plugins
48
+ - Group by confidence (high/medium/low)
49
+
50
+ 3. **Suggest proactively** (non-blocking):
51
+ ```
52
+ 🔌 Plugin Recommendations
53
+
54
+ Based on your tech stack (Next.js + .NET + Docker), these plugins would help:
55
+
56
+ Recommended (high confidence):
57
+ • specweave-frontend - Next.js, React support
58
+ • specweave-backend - .NET 8 API patterns
59
+ • specweave-infrastructure - Docker, PostgreSQL
60
+
61
+ Install: /plugin install specweave-frontend@specweave
62
+ (or continue without - you can add later)
63
+ ```
64
+
65
+ 4. **Continue with user's request**: Don't block workflow!
66
+
67
+ ### Mode 2: Explicit Feature Requests (Original)
68
+
69
+ When users explicitly request plugin features:
70
+
36
71
  1. **Detect missing plugin**: Check if the required plugin is installed
37
72
  2. **Provide installation command**: Give exact `/plugin install` command
38
73
  3. **Explain benefits**: List what the plugin provides (skills, agents, commands)
@@ -40,6 +75,45 @@ When you mention capabilities that require specific SpecWeave plugins:
40
75
 
41
76
  ## Plugin Detection Logic
42
77
 
78
+ ### Automatic Scanning (NEW!)
79
+
80
+ Use the plugin detection utility to scan project structure:
81
+
82
+ **Step 1: Scan project** (TypeScript example, adapt to Claude's capabilities):
83
+ ```typescript
84
+ import { scanProjectStructure, detectPlugins } from '../../../../../src/utils/plugin-detection';
85
+
86
+ // Scan current directory
87
+ const cwd = process.cwd();
88
+ const signals = await scanProjectStructure(cwd);
89
+ const detected = detectPlugins(signals);
90
+
91
+ // Group by confidence
92
+ const highConfidence = detected.filter(p => p.confidence === 'high');
93
+ const mediumConfidence = detected.filter(p => p.confidence === 'medium');
94
+ ```
95
+
96
+ **Step 2: Check installed plugins**:
97
+ ```bash
98
+ # Use Claude's plugin list
99
+ /plugin list --installed
100
+ ```
101
+
102
+ **Step 3: Find missing plugins**:
103
+ - Compare detected plugins vs installed
104
+ - Only suggest high/medium confidence
105
+ - Skip if already installed
106
+
107
+ **Step 4: Format suggestions**:
108
+ ```typescript
109
+ import { formatDetectedPlugins, generateInstallCommands } from '../../../../../src/utils/plugin-detection';
110
+
111
+ const output = formatDetectedPlugins(detected);
112
+ const commands = generateInstallCommands(detected);
113
+ ```
114
+
115
+ ### Manual Detection (Original)
116
+
43
117
  I check for plugin installation by:
44
118
  - Looking for plugin-specific commands (e.g., `/specweave-github:sync`)
45
119
  - Checking if plugin files exist in `.claude/` directory
@@ -63,6 +137,45 @@ Would you like me to guide you through the installation?
63
137
 
64
138
  ## Example Flows
65
139
 
140
+ ### Example 0: Passive Tech Stack Detection (NEW!)
141
+
142
+ **User**: "Design a spec-driven blueprint for a simple task-tracking web app. Tech stack: Next.js + .NET 8 (Web API) + PostgreSQL + Prisma ORM."
143
+
144
+ **Me (plugin-detector activates automatically)**:
145
+ ```
146
+ 🔍 Scanning your project for tech stack...
147
+
148
+ 📦 Plugin Recommendations
149
+
150
+ Based on your tech stack (Next.js + .NET 8 + PostgreSQL + Docker), these plugins would help:
151
+
152
+ Recommended (high confidence):
153
+ • specweave-frontend - Next.js + React patterns, component architecture
154
+ Signals: Next.js mentioned
155
+ Install: /plugin install specweave-frontend@specweave
156
+
157
+ • specweave-backend - .NET 8 Web API patterns, Entity Framework, REST APIs
158
+ Signals: .NET 8 Web API mentioned
159
+ Install: /plugin install specweave-backend@specweave
160
+
161
+ • specweave-infrastructure - Docker Compose, PostgreSQL schema, container orchestration
162
+ Signals: PostgreSQL, Docker mentioned (if docker-compose.yml exists)
163
+ Install: /plugin install specweave-infrastructure@specweave
164
+
165
+ 💡 Quick install all:
166
+ /plugin install specweave-frontend@specweave
167
+ /plugin install specweave-backend@specweave
168
+ /plugin install specweave-infrastructure@specweave
169
+
170
+ 📖 Or I can continue with the core plugin only (you can add plugins later)
171
+
172
+ Would you like to:
173
+ 1️⃣ Install these plugins now (recommended for better architecture patterns)
174
+ 2️⃣ Continue without plugins (I'll do my best with core plugin only)
175
+ ```
176
+
177
+ *User installs plugins, then I continue with their task using plugin-specific knowledge*
178
+
66
179
  ### Example 1: GitHub Integration
67
180
 
68
181
  **User**: "Let's sync this increment to GitHub Issues"