specweave 0.1.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 (288) hide show
  1. package/INSTALL.md +848 -0
  2. package/LICENSE +21 -0
  3. package/README.md +675 -0
  4. package/SPECWEAVE.md +665 -0
  5. package/bin/install-agents.sh +57 -0
  6. package/bin/install-all.sh +49 -0
  7. package/bin/install-commands.sh +56 -0
  8. package/bin/install-skills.sh +57 -0
  9. package/bin/specweave.js +81 -0
  10. package/dist/adapters/adapter-base.d.ts +50 -0
  11. package/dist/adapters/adapter-base.d.ts.map +1 -0
  12. package/dist/adapters/adapter-base.js +146 -0
  13. package/dist/adapters/adapter-base.js.map +1 -0
  14. package/dist/adapters/adapter-interface.d.ts +108 -0
  15. package/dist/adapters/adapter-interface.d.ts.map +1 -0
  16. package/dist/adapters/adapter-interface.js +9 -0
  17. package/dist/adapters/adapter-interface.js.map +1 -0
  18. package/dist/adapters/claude/adapter.d.ts +54 -0
  19. package/dist/adapters/claude/adapter.d.ts.map +1 -0
  20. package/dist/adapters/claude/adapter.js +184 -0
  21. package/dist/adapters/claude/adapter.js.map +1 -0
  22. package/dist/adapters/copilot/adapter.d.ts +42 -0
  23. package/dist/adapters/copilot/adapter.d.ts.map +1 -0
  24. package/dist/adapters/copilot/adapter.js +239 -0
  25. package/dist/adapters/copilot/adapter.js.map +1 -0
  26. package/dist/adapters/cursor/adapter.d.ts +42 -0
  27. package/dist/adapters/cursor/adapter.d.ts.map +1 -0
  28. package/dist/adapters/cursor/adapter.js +297 -0
  29. package/dist/adapters/cursor/adapter.js.map +1 -0
  30. package/dist/adapters/generic/adapter.d.ts +40 -0
  31. package/dist/adapters/generic/adapter.d.ts.map +1 -0
  32. package/dist/adapters/generic/adapter.js +155 -0
  33. package/dist/adapters/generic/adapter.js.map +1 -0
  34. package/dist/cli/commands/init.d.ts +6 -0
  35. package/dist/cli/commands/init.d.ts.map +1 -0
  36. package/dist/cli/commands/init.js +247 -0
  37. package/dist/cli/commands/init.js.map +1 -0
  38. package/dist/cli/commands/install.d.ts +7 -0
  39. package/dist/cli/commands/install.d.ts.map +1 -0
  40. package/dist/cli/commands/install.js +160 -0
  41. package/dist/cli/commands/install.js.map +1 -0
  42. package/dist/cli/commands/list.d.ts +6 -0
  43. package/dist/cli/commands/list.d.ts.map +1 -0
  44. package/dist/cli/commands/list.js +154 -0
  45. package/dist/cli/commands/list.js.map +1 -0
  46. package/package.json +90 -0
  47. package/src/adapters/README.md +312 -0
  48. package/src/adapters/adapter-base.ts +146 -0
  49. package/src/adapters/adapter-interface.ts +120 -0
  50. package/src/adapters/claude/README.md +241 -0
  51. package/src/adapters/claude/adapter.ts +157 -0
  52. package/src/adapters/copilot/.github/copilot/instructions.md +376 -0
  53. package/src/adapters/copilot/README.md +200 -0
  54. package/src/adapters/copilot/adapter.ts +210 -0
  55. package/src/adapters/cursor/.cursor/context/docs-context.md +62 -0
  56. package/src/adapters/cursor/.cursor/context/increments-context.md +71 -0
  57. package/src/adapters/cursor/.cursor/context/strategy-context.md +73 -0
  58. package/src/adapters/cursor/.cursor/context/tests-context.md +89 -0
  59. package/src/adapters/cursor/.cursorrules +325 -0
  60. package/src/adapters/cursor/README.md +243 -0
  61. package/src/adapters/cursor/adapter.ts +268 -0
  62. package/src/adapters/generic/README.md +277 -0
  63. package/src/adapters/generic/SPECWEAVE-MANUAL.md +676 -0
  64. package/src/adapters/generic/adapter.ts +159 -0
  65. package/src/adapters/registry.yaml +126 -0
  66. package/src/agents/architect/AGENT.md +416 -0
  67. package/src/agents/devops/AGENT.md +1738 -0
  68. package/src/agents/docs-writer/AGENT.md +239 -0
  69. package/src/agents/performance/AGENT.md +228 -0
  70. package/src/agents/pm/AGENT.md +751 -0
  71. package/src/agents/qa-lead/AGENT.md +150 -0
  72. package/src/agents/security/AGENT.md +179 -0
  73. package/src/agents/sre/AGENT.md +582 -0
  74. package/src/agents/sre/modules/backend-diagnostics.md +481 -0
  75. package/src/agents/sre/modules/database-diagnostics.md +509 -0
  76. package/src/agents/sre/modules/infrastructure.md +561 -0
  77. package/src/agents/sre/modules/monitoring.md +439 -0
  78. package/src/agents/sre/modules/security-incidents.md +421 -0
  79. package/src/agents/sre/modules/ui-diagnostics.md +302 -0
  80. package/src/agents/sre/playbooks/01-high-cpu-usage.md +204 -0
  81. package/src/agents/sre/playbooks/02-database-deadlock.md +241 -0
  82. package/src/agents/sre/playbooks/03-memory-leak.md +252 -0
  83. package/src/agents/sre/playbooks/04-slow-api-response.md +269 -0
  84. package/src/agents/sre/playbooks/05-ddos-attack.md +293 -0
  85. package/src/agents/sre/playbooks/06-disk-full.md +314 -0
  86. package/src/agents/sre/playbooks/07-service-down.md +333 -0
  87. package/src/agents/sre/playbooks/08-data-corruption.md +337 -0
  88. package/src/agents/sre/playbooks/09-cascade-failure.md +430 -0
  89. package/src/agents/sre/playbooks/10-rate-limit-exceeded.md +464 -0
  90. package/src/agents/sre/scripts/health-check.sh +230 -0
  91. package/src/agents/sre/scripts/log-analyzer.py +213 -0
  92. package/src/agents/sre/scripts/metrics-collector.sh +294 -0
  93. package/src/agents/sre/scripts/trace-analyzer.js +257 -0
  94. package/src/agents/sre/templates/incident-report.md +249 -0
  95. package/src/agents/sre/templates/mitigation-plan.md +375 -0
  96. package/src/agents/sre/templates/post-mortem.md +418 -0
  97. package/src/agents/sre/templates/runbook-template.md +412 -0
  98. package/src/agents/tech-lead/AGENT.md +263 -0
  99. package/src/commands/add-tasks.md +176 -0
  100. package/src/commands/close-increment.md +347 -0
  101. package/src/commands/create-increment.md +223 -0
  102. package/src/commands/create-project.md +528 -0
  103. package/src/commands/generate-docs.md +623 -0
  104. package/src/commands/list-increments.md +180 -0
  105. package/src/commands/review-docs.md +331 -0
  106. package/src/commands/start-increment.md +139 -0
  107. package/src/commands/sync-github.md +115 -0
  108. package/src/commands/validate-increment.md +800 -0
  109. package/src/hooks/README.md +252 -0
  110. package/src/hooks/docs-changed.sh +59 -0
  111. package/src/hooks/human-input-required.sh +55 -0
  112. package/src/hooks/post-task-completion.sh +57 -0
  113. package/src/hooks/pre-implementation.sh +47 -0
  114. package/src/skills/ado-sync/README.md +449 -0
  115. package/src/skills/ado-sync/SKILL.md +245 -0
  116. package/src/skills/ado-sync/test-cases/test-1.yaml +9 -0
  117. package/src/skills/ado-sync/test-cases/test-2.yaml +8 -0
  118. package/src/skills/ado-sync/test-cases/test-3.yaml +9 -0
  119. package/src/skills/bmad-method-expert/SKILL.md +628 -0
  120. package/src/skills/bmad-method-expert/scripts/analyze-project.js +318 -0
  121. package/src/skills/bmad-method-expert/scripts/check-setup.js +208 -0
  122. package/src/skills/bmad-method-expert/scripts/generate-template.js +1149 -0
  123. package/src/skills/bmad-method-expert/scripts/validate-documents.js +340 -0
  124. package/src/skills/bmad-method-expert/test-cases/test-1-placeholder.yaml +12 -0
  125. package/src/skills/bmad-method-expert/test-cases/test-2-placeholder.yaml +12 -0
  126. package/src/skills/bmad-method-expert/test-cases/test-3-placeholder.yaml +12 -0
  127. package/src/skills/brownfield-analyzer/SKILL.md +523 -0
  128. package/src/skills/brownfield-analyzer/test-cases/test-1-basic-analysis.yaml +48 -0
  129. package/src/skills/brownfield-analyzer/test-cases/test-2-placeholder.yaml +12 -0
  130. package/src/skills/brownfield-analyzer/test-cases/test-3-placeholder.yaml +12 -0
  131. package/src/skills/brownfield-onboarder/SKILL.md +625 -0
  132. package/src/skills/brownfield-onboarder/test-cases/test-1-placeholder.yaml +12 -0
  133. package/src/skills/brownfield-onboarder/test-cases/test-2-placeholder.yaml +12 -0
  134. package/src/skills/brownfield-onboarder/test-cases/test-3-placeholder.yaml +12 -0
  135. package/src/skills/calendar-system/test-cases/test-1-placeholder.yaml +12 -0
  136. package/src/skills/calendar-system/test-cases/test-2-placeholder.yaml +12 -0
  137. package/src/skills/calendar-system/test-cases/test-3-placeholder.yaml +12 -0
  138. package/src/skills/context-loader/SKILL.md +734 -0
  139. package/src/skills/context-loader/test-cases/test-1-basic-loading.yaml +39 -0
  140. package/src/skills/context-loader/test-cases/test-2-token-budget-exceeded.yaml +44 -0
  141. package/src/skills/context-loader/test-cases/test-3-section-anchors.yaml +45 -0
  142. package/src/skills/context-optimizer/SKILL.md +618 -0
  143. package/src/skills/context-optimizer/test-cases/test-1-bug-fix-narrow.yaml +97 -0
  144. package/src/skills/context-optimizer/test-cases/test-2-feature-focused.yaml +109 -0
  145. package/src/skills/context-optimizer/test-cases/test-3-architecture-broad.yaml +98 -0
  146. package/src/skills/cost-optimizer/SKILL.md +190 -0
  147. package/src/skills/cost-optimizer/test-cases/test-1-basic-comparison.yaml +75 -0
  148. package/src/skills/cost-optimizer/test-cases/test-2-budget-constraint.yaml +52 -0
  149. package/src/skills/cost-optimizer/test-cases/test-3-scale-requirement.yaml +63 -0
  150. package/src/skills/cost-optimizer/test-results/README.md +46 -0
  151. package/src/skills/design-system-architect/SKILL.md +107 -0
  152. package/src/skills/design-system-architect/test-cases/test-1-token-structure.yaml +23 -0
  153. package/src/skills/design-system-architect/test-cases/test-2-component-hierarchy.yaml +24 -0
  154. package/src/skills/design-system-architect/test-cases/test-3-accessibility-checklist.yaml +23 -0
  155. package/src/skills/diagrams-architect/SKILL.md +763 -0
  156. package/src/skills/diagrams-generator/SKILL.md +25 -0
  157. package/src/skills/diagrams-generator/test-cases/test-1.yaml +9 -0
  158. package/src/skills/diagrams-generator/test-cases/test-2.yaml +9 -0
  159. package/src/skills/diagrams-generator/test-cases/test-3.yaml +8 -0
  160. package/src/skills/docs-updater/README.md +48 -0
  161. package/src/skills/docs-updater/test-cases/test-1-placeholder.yaml +12 -0
  162. package/src/skills/docs-updater/test-cases/test-2-placeholder.yaml +12 -0
  163. package/src/skills/docs-updater/test-cases/test-3-placeholder.yaml +12 -0
  164. package/src/skills/dotnet-backend/SKILL.md +250 -0
  165. package/src/skills/e2e-playwright/README.md +506 -0
  166. package/src/skills/e2e-playwright/SKILL.md +457 -0
  167. package/src/skills/e2e-playwright/execute.js +373 -0
  168. package/src/skills/e2e-playwright/lib/utils.js +514 -0
  169. package/src/skills/e2e-playwright/package.json +33 -0
  170. package/src/skills/e2e-playwright/test-cases/TC-001-basic-navigation.yaml +54 -0
  171. package/src/skills/e2e-playwright/test-cases/TC-002-form-interaction.yaml +64 -0
  172. package/src/skills/e2e-playwright/test-cases/TC-003-specweave-integration.yaml +74 -0
  173. package/src/skills/e2e-playwright/test-cases/TC-004-accessibility-check.yaml +98 -0
  174. package/src/skills/figma-designer/SKILL.md +149 -0
  175. package/src/skills/figma-implementer/SKILL.md +148 -0
  176. package/src/skills/figma-mcp-connector/SKILL.md +136 -0
  177. package/src/skills/figma-mcp-connector/test-cases/test-1-read-file-desktop.yaml +22 -0
  178. package/src/skills/figma-mcp-connector/test-cases/test-2-read-file-framelink.yaml +21 -0
  179. package/src/skills/figma-mcp-connector/test-cases/test-3-error-handling.yaml +18 -0
  180. package/src/skills/figma-to-code/SKILL.md +128 -0
  181. package/src/skills/figma-to-code/test-cases/test-1-token-generation.yaml +29 -0
  182. package/src/skills/figma-to-code/test-cases/test-2-component-generation.yaml +27 -0
  183. package/src/skills/figma-to-code/test-cases/test-3-typescript-generation.yaml +28 -0
  184. package/src/skills/frontend/SKILL.md +177 -0
  185. package/src/skills/github-sync/SKILL.md +252 -0
  186. package/src/skills/github-sync/test-cases/test-1-placeholder.yaml +12 -0
  187. package/src/skills/github-sync/test-cases/test-2-placeholder.yaml +12 -0
  188. package/src/skills/github-sync/test-cases/test-3-placeholder.yaml +12 -0
  189. package/src/skills/hetzner-provisioner/README.md +308 -0
  190. package/src/skills/hetzner-provisioner/SKILL.md +251 -0
  191. package/src/skills/hetzner-provisioner/test-cases/test-1-basic-provision.yaml +71 -0
  192. package/src/skills/hetzner-provisioner/test-cases/test-2-postgres-provision.yaml +85 -0
  193. package/src/skills/hetzner-provisioner/test-cases/test-3-ssl-config.yaml +126 -0
  194. package/src/skills/hetzner-provisioner/test-results/README.md +259 -0
  195. package/src/skills/increment-planner/SKILL.md +889 -0
  196. package/src/skills/increment-planner/scripts/feature-utils.js +250 -0
  197. package/src/skills/increment-planner/test-cases/test-1-basic-feature.yaml +27 -0
  198. package/src/skills/increment-planner/test-cases/test-2-complex-feature.yaml +30 -0
  199. package/src/skills/increment-planner/test-cases/test-3-auto-numbering.yaml +24 -0
  200. package/src/skills/increment-quality-judge/SKILL.md +566 -0
  201. package/src/skills/increment-quality-judge/test-cases/test-1-good-spec.yaml +95 -0
  202. package/src/skills/increment-quality-judge/test-cases/test-2-poor-spec.yaml +108 -0
  203. package/src/skills/increment-quality-judge/test-cases/test-3-export-suggestions.yaml +87 -0
  204. package/src/skills/jira-sync/README.md +328 -0
  205. package/src/skills/jira-sync/SKILL.md +209 -0
  206. package/src/skills/jira-sync/test-cases/test-1.yaml +9 -0
  207. package/src/skills/jira-sync/test-cases/test-2.yaml +9 -0
  208. package/src/skills/jira-sync/test-cases/test-3.yaml +10 -0
  209. package/src/skills/nextjs/SKILL.md +176 -0
  210. package/src/skills/nodejs-backend/SKILL.md +181 -0
  211. package/src/skills/notification-system/test-cases/test-1-placeholder.yaml +12 -0
  212. package/src/skills/notification-system/test-cases/test-2-placeholder.yaml +12 -0
  213. package/src/skills/notification-system/test-cases/test-3-placeholder.yaml +12 -0
  214. package/src/skills/python-backend/SKILL.md +226 -0
  215. package/src/skills/role-orchestrator/README.md +197 -0
  216. package/src/skills/role-orchestrator/SKILL.md +1184 -0
  217. package/src/skills/role-orchestrator/test-cases/test-1-simple-product.yaml +98 -0
  218. package/src/skills/role-orchestrator/test-cases/test-2-quality-gate-failure.yaml +73 -0
  219. package/src/skills/role-orchestrator/test-cases/test-3-security-workflow.yaml +121 -0
  220. package/src/skills/role-orchestrator/test-cases/test-4-parallel-execution.yaml +145 -0
  221. package/src/skills/role-orchestrator/test-cases/test-5-feedback-loops.yaml +149 -0
  222. package/src/skills/skill-creator/LICENSE.txt +202 -0
  223. package/src/skills/skill-creator/SKILL.md +209 -0
  224. package/src/skills/skill-creator/scripts/init_skill.py +303 -0
  225. package/src/skills/skill-creator/scripts/package_skill.py +110 -0
  226. package/src/skills/skill-creator/scripts/quick_validate.py +65 -0
  227. package/src/skills/skill-creator/test-cases/test-1-placeholder.yaml +12 -0
  228. package/src/skills/skill-creator/test-cases/test-2-placeholder.yaml +12 -0
  229. package/src/skills/skill-creator/test-cases/test-3-placeholder.yaml +12 -0
  230. package/src/skills/skill-router/SKILL.md +497 -0
  231. package/src/skills/skill-router/test-cases/test-1-basic-routing.yaml +33 -0
  232. package/src/skills/skill-router/test-cases/test-2-ambiguous-request.yaml +42 -0
  233. package/src/skills/skill-router/test-cases/test-3-nested-orchestration.yaml +50 -0
  234. package/src/skills/spec-driven-brainstorming/README.md +264 -0
  235. package/src/skills/spec-driven-brainstorming/SKILL.md +439 -0
  236. package/src/skills/spec-driven-brainstorming/test-cases/TC-001-simple-idea-to-design.yaml +148 -0
  237. package/src/skills/spec-driven-brainstorming/test-cases/TC-002-complex-ultrathink-design.yaml +190 -0
  238. package/src/skills/spec-driven-brainstorming/test-cases/TC-003-unclear-requirements-socratic.yaml +233 -0
  239. package/src/skills/spec-driven-debugging/README.md +479 -0
  240. package/src/skills/spec-driven-debugging/SKILL.md +652 -0
  241. package/src/skills/spec-driven-debugging/test-cases/TC-001-simple-auth-bug.yaml +212 -0
  242. package/src/skills/spec-driven-debugging/test-cases/TC-002-race-condition-ultrathink.yaml +461 -0
  243. package/src/skills/spec-driven-debugging/test-cases/TC-003-brownfield-missing-spec.yaml +366 -0
  244. package/src/skills/spec-kit-expert/SKILL.md +1012 -0
  245. package/src/skills/spec-kit-expert/test-cases/test-1-placeholder.yaml +12 -0
  246. package/src/skills/spec-kit-expert/test-cases/test-2-placeholder.yaml +12 -0
  247. package/src/skills/spec-kit-expert/test-cases/test-3-placeholder.yaml +12 -0
  248. package/src/skills/specweave-ado-mapper/SKILL.md +501 -0
  249. package/src/skills/specweave-detector/SKILL.md +420 -0
  250. package/src/skills/specweave-detector/test-cases/test-1-basic-detection.yaml +37 -0
  251. package/src/skills/specweave-detector/test-cases/test-2-missing-config.yaml +37 -0
  252. package/src/skills/specweave-detector/test-cases/test-3-non-specweave-project.yaml +34 -0
  253. package/src/skills/specweave-jira-mapper/SKILL.md +500 -0
  254. package/src/skills/stripe-integrator/test-cases/test-1-placeholder.yaml +12 -0
  255. package/src/skills/stripe-integrator/test-cases/test-2-placeholder.yaml +12 -0
  256. package/src/skills/stripe-integrator/test-cases/test-3-placeholder.yaml +12 -0
  257. package/src/skills/task-builder/README.md +90 -0
  258. package/src/skills/task-builder/test-cases/test-1-placeholder.yaml +12 -0
  259. package/src/skills/task-builder/test-cases/test-2-placeholder.yaml +12 -0
  260. package/src/skills/task-builder/test-cases/test-3-placeholder.yaml +12 -0
  261. package/src/templates/.env.example +144 -0
  262. package/src/templates/.gitignore.template +81 -0
  263. package/src/templates/CLAUDE.md.template +383 -0
  264. package/src/templates/README.md.template +240 -0
  265. package/src/templates/config.yaml +333 -0
  266. package/src/templates/docs/README.md +124 -0
  267. package/src/templates/docs/adr-template.md +118 -0
  268. package/src/templates/docs/hld-template.md +220 -0
  269. package/src/templates/docs/lld-template.md +580 -0
  270. package/src/templates/docs/prd-template.md +132 -0
  271. package/src/templates/docs/rfc-template.md +229 -0
  272. package/src/templates/docs/runbook-template.md +298 -0
  273. package/src/templates/environments/minimal/.env.production +16 -0
  274. package/src/templates/environments/minimal/README.md +54 -0
  275. package/src/templates/environments/minimal/deploy-production.yml +52 -0
  276. package/src/templates/environments/progressive/.env.qa +28 -0
  277. package/src/templates/environments/progressive/README.md +129 -0
  278. package/src/templates/environments/progressive/deploy-production.yml +93 -0
  279. package/src/templates/environments/progressive/deploy-qa.yml +62 -0
  280. package/src/templates/environments/progressive/deploy-staging.yml +67 -0
  281. package/src/templates/environments/standard/.env.development +20 -0
  282. package/src/templates/environments/standard/.env.production +30 -0
  283. package/src/templates/environments/standard/.env.staging +23 -0
  284. package/src/templates/environments/standard/README.md +97 -0
  285. package/src/templates/environments/standard/deploy-production.yml +68 -0
  286. package/src/templates/environments/standard/deploy-staging.yml +61 -0
  287. package/src/templates/environments/standard/docker-compose.yml +43 -0
  288. package/src/templates/increment-metadata-template.yaml +138 -0
package/SPECWEAVE.md ADDED
@@ -0,0 +1,665 @@
1
+ # SpecWeave - Spec-Driven Development Framework
2
+
3
+ **THIS FILE IS YOUR QUICK REFERENCE GUIDE**
4
+
5
+ **Note**: `CLAUDE.md` symlink exists for backward compatibility and points to this file.
6
+
7
+ This file contains quick reference for developing with SpecWeave:
8
+ - Core principles and project structure
9
+ - Quick reference tables (agents, skills, commands)
10
+ - Links to detailed guides (loaded on-demand by agents)
11
+
12
+ **For detailed workflows**: See `.specweave/docs/internal/delivery/guides/`
13
+
14
+ ---
15
+
16
+ ## SpecWeave Auto-Routing (CRITICAL)
17
+
18
+ **MANDATORY BEHAVIOR**: This project has SpecWeave installed (`.specweave/` directory exists).
19
+
20
+ ### Auto-Detection & Routing Rules
21
+
22
+ 1. **ALWAYS check for SpecWeave FIRST** before responding to ANY user request
23
+ 2. **ROUTE ALL development-related questions** through `specweave-detector` skill
24
+ 3. **EVEN GENERIC questions** may need SpecWeave context (e.g., "Analyze BTC/USD" → suggest creating trading analysis feature)
25
+
26
+ ### Detection Logic
27
+
28
+ ```javascript
29
+ if (directoryExists('.specweave/config.yaml')) {
30
+ // SpecWeave is installed
31
+ // Route through specweave-detector for ALL development requests
32
+ activateSpecWeaveMode();
33
+ }
34
+ ```
35
+
36
+ ### Routing Examples
37
+
38
+ | User Request | Detection | Action |
39
+ |-------------|-----------|--------|
40
+ | "Create authentication" | Development request | ✅ Route to `specweave-detector` → `increment-planner` |
41
+ | "Analyze BTC/USD prices" | Could be feature request | ✅ Route to `specweave-detector` → Suggest: "Create BTC analysis feature?" |
42
+ | "Add payment processing" | Development request | ✅ Route to `specweave-detector` → `increment-planner` |
43
+ | "Fix bug in login" | Development request | ✅ Route to `specweave-detector` → Load context → Implement |
44
+ | "What's for lunch?" | Non-development | ❌ Respond normally (out of domain) |
45
+
46
+ ### Activation Behavior
47
+
48
+ **When SpecWeave is detected**:
49
+ - ✅ Show indicator: `🔷 SpecWeave Active`
50
+ - ✅ Route development requests automatically
51
+ - ✅ Load context via `context-loader` when needed
52
+ - ✅ Use appropriate agents (PM, Architect, DevOps, etc.)
53
+ - ✅ Adapt to detected tech stack (TypeScript, Python, Go, etc.)
54
+
55
+ **Rule**: When in doubt, route through SpecWeave. Let `specweave-detector` decide if it's a valid development request.
56
+
57
+ ---
58
+
59
+ ## Project Philosophy
60
+
61
+ **SpecWeave** is a specification-first AI development framework where **specifications and documentation are the SOURCE OF TRUTH**. Code is the expression of these specifications in a particular language.
62
+
63
+ ### Core Principles
64
+
65
+ 1. **Specification Before Implementation** - Define WHAT and WHY before HOW
66
+ 2. **Living Documentation** - Specs evolve with code, never diverge
67
+ 3. **Regression Prevention** - Document existing code before modification
68
+ 4. **Test-Validated Features** - Every feature proven through automated tests
69
+ 5. **Scalable from Solo to Enterprise** - Modular structure that grows with project size
70
+ 6. **Context Precision** - Load only relevant specs (70%+ token reduction)
71
+ 7. **Auto-Role Routing** - Skills detect and route to appropriate expertise automatically
72
+ 8. **Closed-Loop Validation** - E2E tests must tell the truth (no false positives)
73
+ 9. **🔄 Meta-Capability** - Agents build agents, skills build skills, SpecWeave builds SpecWeave
74
+
75
+ **See**: [.specweave/docs/internal/architecture/meta-capability.md](.specweave/docs/internal/architecture/meta-capability.md) for complete meta-capability documentation
76
+
77
+ ---
78
+
79
+ ## Documentation Approaches
80
+
81
+ **SpecWeave supports TWO approaches**:
82
+
83
+ 1. **Comprehensive Upfront** (Enterprise/Production) - 500-600+ page specifications before coding
84
+ 2. **Incremental/Evolutionary** (Startup/Iterative) - Build documentation as you go
85
+
86
+ Both approaches use the same framework, tools, and 5-pillar documentation structure.
87
+
88
+ **See**: [.specweave/docs/internal/strategy/README.md](.specweave/docs/internal/strategy/README.md) for choosing your approach
89
+
90
+ ---
91
+
92
+ ## 🚨 CRITICAL: File Organization (Keep Root Clean!)
93
+
94
+ **MANDATORY**: ALL AI-generated supporting files MUST go into increment folders - NEVER in project root!
95
+
96
+ **✅ ALLOWED in Root**:
97
+ - `CLAUDE.md` (ONLY file SpecWeave adds to user's project)
98
+ - User's existing files (unchanged)
99
+
100
+ **❌ NEVER Create in Root**:
101
+ - Logs → `.specweave/increments/{id}/logs/`
102
+ - Scripts → `.specweave/increments/{id}/scripts/`
103
+ - Reports → `.specweave/increments/{id}/reports/`
104
+
105
+ **Example**:
106
+ ```
107
+ ❌ WRONG: ✅ CORRECT:
108
+ project-root/ .specweave/increments/0001-auth/
109
+ ├── analysis.md ├── reports/analysis.md
110
+ ├── script.py ├── scripts/script.py
111
+ └── errors.log └── logs/errors.log
112
+ ```
113
+
114
+ **Benefits**: Complete traceability, easy cleanup, clear context, no root clutter
115
+
116
+ ---
117
+
118
+ ## Quick Reference: Directory Structure
119
+
120
+ ```
121
+ your-project/
122
+ ├── .specweave/ # Framework internals
123
+ │ ├── config.yaml # Project configuration
124
+ │ ├── docs/ # 5-pillar documentation
125
+ │ │ ├── internal/
126
+ │ │ │ ├── strategy/ # Business specs (WHAT, WHY)
127
+ │ │ │ ├── architecture/ # Technical design (HOW)
128
+ │ │ │ ├── delivery/ # Roadmap, CI/CD, guides
129
+ │ │ │ ├── operations/ # Runbooks, SLOs
130
+ │ │ │ └── governance/ # Security, compliance
131
+ │ │ └── public/ # Published docs
132
+ │ ├── increments/ # Features (auto-numbered)
133
+ │ │ └── 0001-feature-name/
134
+ │ │ ├── spec.md # WHAT & WHY (< 250 lines)
135
+ │ │ ├── plan.md # HOW (< 500 lines)
136
+ │ │ ├── tasks.md # Implementation checklist
137
+ │ │ ├── tests.md # Test strategy
138
+ │ │ ├── context-manifest.yaml # What to load (70%+ token reduction)
139
+ │ │ ├── logs/ # ✅ Execution logs, errors, AI sessions
140
+ │ │ ├── scripts/ # ✅ Helper scripts (migration, setup, validation)
141
+ │ │ └── reports/ # ✅ Analysis, completion, performance reports
142
+ │ └── tests/ # Centralized test repository
143
+
144
+ ├── .claude/ # Installed components
145
+ │ ├── agents/ # Installed agents (selective)
146
+ │ ├── skills/ # Installed skills (selective)
147
+ │ └── commands/ # Slash commands
148
+
149
+ ├── CLAUDE.md # This file (ONLY file we add)
150
+ └── src/ # Your source code (unchanged)
151
+ ```
152
+
153
+ **See**: [.specweave/docs/internal/delivery/guides/development-workflow.md](.specweave/docs/internal/delivery/guides/development-workflow.md) for complete development workflow
154
+
155
+ ---
156
+
157
+ ## Installation
158
+
159
+ **Initialize New Project**:
160
+ ```bash
161
+ npx specweave init # Auto-detects tech stack
162
+ npx specweave init --type python # Specify tech stack
163
+ ```
164
+
165
+ **Selective Installation** (Recommended for user projects):
166
+ ```bash
167
+ npx specweave install --detect # Install only relevant agents/skills
168
+ npx specweave install pm --local # Install specific component
169
+ npx specweave list --installed # See what's installed
170
+ ```
171
+
172
+ **Token Savings**: 60-71% reduction vs installing all components!
173
+
174
+ **Required Model**: Claude Sonnet 4.5 (`claude-sonnet-4-5-20250929`)
175
+
176
+ **See**: [Installation Guide](#) for complete installation instructions
177
+
178
+ ---
179
+
180
+ ## Quick Reference: Slash Commands
181
+
182
+ | Command | Purpose | Example |
183
+ |---------|---------|---------|
184
+ | `/create-project` | Bootstrap new SpecWeave project | `/create-project --type python` |
185
+ | `/create-increment` | Create new feature/increment | `/create-increment "user auth"` |
186
+ | `/start-increment` | Start working on an increment | `/start-increment 0001` |
187
+ | `/add-tasks` | Add tasks to existing increment | `/add-tasks 0001 "implement login"` |
188
+ | `/validate-increment` | Validate with rule-based + optional AI quality | `/validate-increment 0001 --quality` |
189
+ | `/close-increment` | Close increment with leftover transfer | `/close-increment 0001` |
190
+ | `/list-increments` | List all increments with status | `/list-increments` |
191
+ | `/review-docs` | Review strategic docs vs code | `/review-docs --increment=0003` |
192
+ | `/generate-docs` | Generate documentation site | `/generate-docs` |
193
+ | `/sync-github` | Sync increment to GitHub issues | `/sync-github` |
194
+
195
+ **All commands are framework-agnostic** (adapt to detected tech stack)
196
+
197
+ **See**: [Command Reference](.claude/commands/) for all available commands
198
+
199
+ ---
200
+
201
+ ## Quick Reference: Core Agents
202
+
203
+ **Core Agents** (Complex workflows, separate context):
204
+
205
+ | Agent | Purpose | Activates When |
206
+ |-------|---------|----------------|
207
+ | `pm` | Product requirements, user stories | Planning features, requirements analysis |
208
+ | `architect` | System design, ADRs, architecture | Technical design, architecture decisions |
209
+ | `security` | Threat modeling, security review | Security concerns, vulnerability assessment |
210
+ | `qa-lead` | Test strategy, test cases | Testing, quality assurance |
211
+ | `devops` | Infrastructure, deployment | Deployment, CI/CD, infrastructure |
212
+ | `sre` | Incident response, troubleshooting | Production incidents, debugging |
213
+ | `tech-lead` | Code review, best practices | Code review, refactoring |
214
+ | `docs-writer` | Documentation creation | Writing docs, API documentation |
215
+ | `performance` | Performance optimization, profiling | Performance issues, optimization |
216
+
217
+ **Invoke via**: `Task` tool with `subagent_type` parameter
218
+
219
+ **See**: [src/agents/](src/agents/) for all available agents
220
+
221
+ ---
222
+
223
+ ## Quick Reference: Core Skills
224
+
225
+ **Framework Skills** (Core functionality):
226
+
227
+ | Skill | Purpose | Activates When |
228
+ |-------|---------|----------------|
229
+ | `specweave-detector` | Auto-detect SpecWeave projects | Any request in SpecWeave project |
230
+ | `increment-planner` | Plan features with context | Creating/planning features |
231
+ | `skill-router` | Route to appropriate skills | Ambiguous requests |
232
+ | `context-loader` | Load context selectively | Working on increments |
233
+
234
+ **Technology Skills** (Implementation knowledge):
235
+
236
+ | Skill | Purpose | Activates When |
237
+ |-------|---------|----------------|
238
+ | `nextjs` | Next.js App Router, Server Components | NextJS, Next.js, App Router |
239
+ | `nodejs-backend` | Node.js/Express/NestJS APIs | Node.js, Express, NestJS |
240
+ | `python-backend` | FastAPI/Django APIs | Python backend, FastAPI, Django |
241
+ | `dotnet-backend` | ASP.NET Core APIs | .NET, C#, ASP.NET Core |
242
+ | `frontend` | React/Vue/Angular frontend | React, Vue, Angular components |
243
+ | `figma-implementer` | Figma to code conversion | Figma to code, implement design |
244
+ | `figma-designer` | Figma design creation | Create Figma design, design system |
245
+ | `diagrams-architect` | Mermaid/C4 diagrams | Create diagram, architecture diagram |
246
+
247
+ **Integration Skills** (External tools):
248
+
249
+ | Skill | Purpose | Activates When |
250
+ |-------|---------|----------------|
251
+ | `jira-sync` | Sync with JIRA | JIRA integration |
252
+ | `ado-sync` | Sync with Azure DevOps | ADO integration |
253
+ | `github-sync` | Sync with GitHub | GitHub integration |
254
+ | `hetzner-provisioner` | Hetzner deployment | Deploying to Hetzner |
255
+ | `cost-optimizer` | Infrastructure cost analysis | Cloud provider selection |
256
+ | `specweave-jira-mapper` | SpecWeave ↔ JIRA mapping | JIRA sync, export to JIRA |
257
+ | `specweave-ado-mapper` | SpecWeave ↔ ADO mapping | ADO sync, export to ADO |
258
+
259
+ **Quality & Optimization Skills** (NEW):
260
+
261
+ | Skill | Purpose | Activates When |
262
+ |-------|---------|----------------|
263
+ | `increment-quality-judge` | AI-powered quality assessment (LLM-as-judge) | Validate quality, quality check, assess spec |
264
+ | `context-optimizer` | Second-pass context cleanup (80%+ reduction) | Optimize context, reduce tokens, smart context |
265
+
266
+ **Skills activate automatically** based on description matching
267
+
268
+ **See**: [src/skills/](src/skills/) for all available skills
269
+
270
+ ---
271
+
272
+ ## Quick Reference: Increment Lifecycle
273
+
274
+ **Status Progression**:
275
+ ```
276
+ backlog → planned → in-progress → completed → closed
277
+ ```
278
+
279
+ **WIP Limits**:
280
+ - Framework development: 2-3 in progress
281
+ - User projects (solo): 1-2 in progress
282
+ - User projects (team): 3-5 in progress
283
+
284
+ **Naming Convention**: 4-digit format (0001-9999), e.g., `0001-feature-name`, `0042-user-auth`, `0123-payment-flow`
285
+
286
+ **Commands**:
287
+ ```bash
288
+ /create-increment "feature name" # Create new increment (auto-numbered, e.g., 0003-feature-name)
289
+ /add-tasks 0001 "task description" # Add tasks to existing
290
+ /close-increment 0001 # Close with leftover transfer
291
+ ```
292
+
293
+ **See**: [Increment Lifecycle Guide](.specweave/docs/internal/delivery/guides/increment-lifecycle.md) for complete lifecycle management
294
+
295
+ ---
296
+
297
+ ## Quick Reference: Testing
298
+
299
+ **Four Levels of Test Cases**:
300
+
301
+ 1. **Specification** (`.specweave/docs/internal/strategy/`) - TC-0001 acceptance criteria
302
+ 2. **Feature** (`.specweave/increments/0001-feature-name/tests.md`) - Test coverage matrix
303
+ 3. **Skill** (`src/skills/{name}/test-cases/`) - 3+ YAML test cases (MANDATORY)
304
+ 4. **Code** (`tests/`) - Automated tests (Unit, Integration, E2E)
305
+
306
+ **Requirements**:
307
+ - ✅ Minimum 3 test cases per skill
308
+ - ✅ E2E tests (Playwright) when UI exists
309
+ - ✅ >80% coverage for critical paths
310
+ - ✅ Tests MUST tell the truth (no false positives)
311
+
312
+ **See**: [Testing Strategy Guide](.specweave/docs/internal/delivery/guides/testing-strategy.md) for complete testing philosophy
313
+
314
+ ---
315
+
316
+ ## Quick Reference: Deployment
317
+
318
+ **Deployment Target Detection**:
319
+
320
+ Agents ask about deployment ONLY when:
321
+ - User mentions "deploy", "production", "hosting"
322
+ - DevOps agent is invoked
323
+ - Infrastructure code is needed
324
+
325
+ **Supported Targets**:
326
+ - Local (Docker Compose)
327
+ - Hetzner Cloud (cheapest)
328
+ - Railway (easiest)
329
+ - Vercel (best for Next.js)
330
+ - AWS/Azure/GCP (enterprise)
331
+
332
+ **Configuration**: `.specweave/config.yaml`
333
+
334
+ **See**: [Deployment Intelligence Guide](.specweave/docs/internal/delivery/guides/deployment-intelligence.md) for complete deployment workflow
335
+
336
+ ---
337
+
338
+ ## Quick Reference: C4 Diagrams
339
+
340
+ **C4 Model Levels**:
341
+
342
+ | Level | SpecWeave Equivalent | Location |
343
+ |-------|----------------------|----------|
344
+ | C4-1: Context | HLD Context Diagram | `.specweave/docs/internal/architecture/diagrams/` |
345
+ | C4-2: Container | HLD Component Diagram | `.specweave/docs/internal/architecture/diagrams/` |
346
+ | C4-3: Component | LLD Component Diagram | `.specweave/docs/internal/architecture/diagrams/{module}/` |
347
+ | C4-4: Code | Source code + UML | Code comments or separate docs |
348
+
349
+ **CRITICAL**: C4 diagrams start DIRECTLY with `C4Context` (NO `mermaid` keyword!)
350
+
351
+ **See**: [Diagram Conventions Guide](.specweave/docs/internal/delivery/guides/diagram-conventions.md) for complete diagram rules
352
+
353
+ ---
354
+
355
+ ## Quick Reference: Validation
356
+
357
+ **Increment Validation** runs automatically on document save:
358
+
359
+ **120 validation rules** across 4 categories:
360
+ 1. **Consistency** (47 rules) - Spec ↔ Plan ↔ Tasks alignment
361
+ 2. **Completeness** (23 rules) - All required sections present
362
+ 3. **Quality** (31 rules) - Technology-agnostic, testable criteria
363
+ 4. **Traceability** (19 rules) - TC-0001 → tests.md coverage
364
+
365
+ **Validation happens automatically** when documents are saved. For manual quality assessment, ask Claude to "validate quality of increment 0001" to invoke the `increment-quality-judge` skill.
366
+
367
+ **See**: [Increment Validation Guide](.specweave/docs/internal/delivery/guides/increment-validation.md) for complete validation workflow
368
+
369
+ ---
370
+
371
+ ## Detailed Guides (On-Demand Loading)
372
+
373
+ **For complete details, agents load guides from** `.specweave/docs/internal/delivery/guides/`:
374
+
375
+ | Guide | Purpose | Loaded By |
376
+ |-------|---------|-----------|
377
+ | [increment-lifecycle.md](. specweave/docs/internal/delivery/guides/increment-lifecycle.md) | Complete increment lifecycle management | `increment-planner` |
378
+ | [increment-validation.md](.specweave/docs/internal/delivery/guides/increment-validation.md) | Validation workflow and rules | `increment-validator` |
379
+ | [development-workflow.md](.specweave/docs/internal/delivery/guides/development-workflow.md) | Greenfield and brownfield workflows | When starting development |
380
+ | [deployment-intelligence.md](.specweave/docs/internal/delivery/guides/deployment-intelligence.md) | Deployment target detection and infrastructure | `devops` agent |
381
+ | [testing-strategy.md](.specweave/docs/internal/delivery/guides/testing-strategy.md) | Complete testing philosophy (4 levels) | `qa-lead` agent |
382
+ | [test-import.md](.specweave/docs/internal/delivery/guides/test-import.md) | Importing existing tests | `test-importer` skill |
383
+ | [diagram-conventions.md](.specweave/docs/internal/delivery/guides/diagram-conventions.md) | C4 diagrams and Mermaid syntax | `diagrams-architect` skill |
384
+ | [diagram-svg-generation.md](.specweave/docs/internal/delivery/guides/diagram-svg-generation.md) | SVG generation for production docs | When building docs site |
385
+
386
+ **Agents automatically load relevant guides when activated** - you don't need to manage this manually.
387
+
388
+ ---
389
+
390
+ ## Agents vs Skills: When to Use Which
391
+
392
+ | Create Agent When | Create Skill When |
393
+ |-------------------|-------------------|
394
+ | Complex, multi-step workflows | Simple, focused tasks |
395
+ | Needs separate context window | Can share main context |
396
+ | Distinct personality/role needed | Capability extension |
397
+ | Tool restrictions by role | All tools acceptable |
398
+ | Long-running tasks | Quick operations |
399
+ | **Example**: Security audit, PM planning | **Example**: Next.js knowledge, diagram creation |
400
+
401
+ **Agents** (9 total): PM, Architect, Security, QA Lead, DevOps, SRE, Tech Lead, Docs Writer, Performance
402
+ **Skills** (30+ total): Technology stacks (Next.js, Node.js, Python, .NET, Frontend), Integrations (JIRA, ADO, GitHub), Utilities (diagrams, Figma, cost optimizer)
403
+
404
+ **Agents**: Invoked via `Task` tool with `subagent_type`
405
+ **Skills**: Activate automatically based on description
406
+
407
+ ---
408
+
409
+ ## Source of Truth: src/ Folder
410
+
411
+ **CRITICAL RULE**: All SpecWeave framework components (agents, skills, commands, hooks) MUST be created in `src/` folder first, then installed to `.claude/` via install script.
412
+
413
+ ```
414
+ src/
415
+ ├── agents/ # ✅ Source of truth for ALL agents
416
+ ├── skills/ # ✅ Source of truth for ALL skills
417
+ ├── commands/ # ✅ Source of truth for ALL slash commands
418
+ ├── hooks/ # ✅ Source of truth for ALL hooks
419
+ └── templates/ # ✅ ONLY files for user's project root
420
+ ```
421
+
422
+ **Installation Flow**:
423
+ 1. Create in `src/agents/{name}/` or `src/skills/{name}/`
424
+ 2. Run `npm run install:agents` or `npm run install:skills`
425
+ 3. Components copied to `.claude/`
426
+
427
+ **User Projects**: Can create custom agents/skills in `.claude/` or `~/.claude/`
428
+
429
+ ---
430
+
431
+ ## Naming Conventions
432
+
433
+ **Increments**: 4-digit format `0001-9999` (e.g., `0001-skills-framework`, `0042-user-auth`, `0123-payment-flow`)
434
+ - Always zero-padded to 4 digits
435
+ - Duplicate detection prevents conflicts
436
+ - Examples: `0001-core-framework`, `0002-multi-tool-support`, `0003-deployment-pipeline`
437
+ **Modules**: `lowercase-kebab-case` (e.g., `payments/stripe/`)
438
+ **ADRs**: 4-digit format `0001-decision-title.md` (e.g., `0001-tech-stack.md`, `0042-database-choice.md`)
439
+ **Test Cases**: `TC-0001`, `TC-0002` format for traceability
440
+
441
+ ---
442
+
443
+ ## Development Workflow Summary
444
+
445
+ ### Greenfield Projects
446
+
447
+ **Option A: Comprehensive Upfront** (Enterprise)
448
+ 1. Create 500-600+ page specifications (`.specweave/docs/internal/strategy/`)
449
+ 2. Design architecture (`.specweave/docs/internal/architecture/`)
450
+ 3. Plan features in increments
451
+ 4. Implement with context manifests
452
+
453
+ **Option B: Incremental** (Startup)
454
+ 1. Start with overview (10-20 pages)
455
+ 2. Build documentation as you go
456
+ 3. Add modules/specs as features are planned
457
+
458
+ **See**: [Development Workflow Guide](.specweave/docs/internal/delivery/guides/development-workflow.md) for complete workflow
459
+
460
+ ### Brownfield Projects
461
+
462
+ 1. **Analyze** existing code (`brownfield-analyzer` skill)
463
+ 2. **Document** current behavior (retroactive specs + ADRs)
464
+ 3. **Create tests** for current functionality (user reviews)
465
+ 4. **Plan modifications** (new increment)
466
+ 5. **Implement** with regression monitoring
467
+
468
+ **See**: [Development Workflow Guide](.specweave/docs/internal/delivery/guides/development-workflow.md) for brownfield details
469
+
470
+ ---
471
+
472
+ ## Git Workflow
473
+
474
+ **Branch naming**: `features/{increment-id}-{short-name}` (use 4-digit format without leading zeros in branch name for brevity)
475
+
476
+ **Workflow**:
477
+ 1. Create increment folder (`.specweave/increments/0002-name/`)
478
+ 2. Create feature branch (`git checkout -b features/002-name` or `features/0002-name`)
479
+ 3. Implement in src/ (agents, skills, etc.)
480
+ 4. Commit regularly
481
+ 5. Create PR when complete
482
+ 6. Merge to develop
483
+
484
+ **NEVER commit directly to `develop` or `main`**
485
+
486
+ **Note**: Branch names can use either `features/002-name` (3-digit for brevity) or `features/0002-name` (4-digit for consistency), but increment folders MUST always use 4-digit format.
487
+
488
+ ---
489
+
490
+ ## Context Precision (80%+ Token Reduction)
491
+
492
+ ### Pass 1: Context Loader (70% reduction)
493
+
494
+ **Context Manifests** (`.specweave/increments/0001-feature-name/context-manifest.yaml`):
495
+
496
+ ```yaml
497
+ spec_sections:
498
+ - .specweave/docs/internal/strategy/auth/spec.md
499
+ documentation:
500
+ - .specweave/docs/internal/architecture/auth-design.md
501
+ - .specweave/docs/internal/architecture/adr/0003-auth-method.md
502
+ max_context_tokens: 10000
503
+ ```
504
+
505
+ **Result**: 150k tokens → 45k tokens (70% reduction)
506
+
507
+ ### Pass 2: Context Optimizer (80%+ total reduction) 🆕
508
+
509
+ **Smart cleanup based on user intent**:
510
+
511
+ ```typescript
512
+ User: "Fix login bug in authentication"
513
+
514
+ Analyzer detects:
515
+ • Task: Bug fix (narrow scope)
516
+ • Domain: Authentication
517
+ • Scope: Single endpoint
518
+
519
+ Removes unneeded:
520
+ ❌ payment-spec.md (different domain)
521
+ ❌ PM agent (not needed for bug fix)
522
+ ❌ Frontend skills (backend task)
523
+
524
+ Keeps relevant:
525
+ ✅ auth-spec.md (core domain)
526
+ ✅ nodejs-backend skill
527
+ ✅ Tech Lead agent
528
+
529
+ Result: 45k → 27k tokens (additional 40% reduction)
530
+ Total: 150k → 27k (82% total reduction)
531
+ ```
532
+
533
+ **Benefits**:
534
+ - Two-pass optimization (manifest + intent)
535
+ - 80%+ total token reduction
536
+ - Scales to enterprise (500-1000+ page specs)
537
+ - Automatic, no manual intervention
538
+
539
+ **Loaded by**: `context-loader` (Pass 1) + `context-optimizer` (Pass 2)
540
+
541
+ ---
542
+
543
+ ## Quality Assurance (AI-Powered Quality Judge)
544
+
545
+ **Optional AI-powered quality assessment** beyond rule-based validation:
546
+
547
+ ### How to Use
548
+
549
+ **Activate the `increment-quality-judge` skill** by asking:
550
+ - "Validate quality of increment 0001"
551
+ - "Quality check for increment 0003"
552
+ - "Assess spec quality for authentication feature"
553
+ - "How good is the spec for increment 0002?"
554
+
555
+ The skill will evaluate:
556
+ - **Clarity**: Are requirements clear and unambiguous?
557
+ - **Testability**: Can acceptance criteria be tested?
558
+ - **Completeness**: Are edge cases covered?
559
+ - **Feasibility**: Is the plan technically sound?
560
+ - **Maintainability**: Is the design sustainable?
561
+ - **Architecture**: Are design decisions justified?
562
+
563
+ **Example Output**:
564
+ ```
565
+ 🔍 Quality Assessment: Increment 0002-user-authentication
566
+
567
+ Overall Score: 87/100 (GOOD)
568
+
569
+ Dimension Scores:
570
+ • Clarity: 92/100 ✓✓
571
+ • Testability: 78/100 ✓ (Needs improvement)
572
+ • Completeness: 90/100 ✓✓
573
+ • Feasibility: 88/100 ✓✓
574
+ • Maintainability: 85/100 ✓
575
+ • Edge Cases: 72/100 ⚠️ (Action needed)
576
+
577
+ Issues Found: 2 major, 1 minor
578
+ Suggestions: 3 high priority improvements
579
+ ```
580
+
581
+ **Features**:
582
+ - 6-dimension quality scoring
583
+ - Actionable suggestions with examples
584
+ - LLM-as-Judge pattern for nuanced assessment
585
+ - Complements rule-based validation
586
+
587
+ **Configuration**: `.specweave/config.yaml` → `validation.quality_judge`
588
+
589
+ **Provided by**: `increment-quality-judge` skill
590
+
591
+ ---
592
+
593
+ ## Auto-Refinement (Feedback Loops) 🆕
594
+
595
+ **Automatic quality improvement** through iterative refinement:
596
+
597
+ ### How It Works
598
+
599
+ ```
600
+ Agent generates output
601
+
602
+ Validate (rule-based + LLM-judge)
603
+
604
+ Score < threshold? ──No──→ ✅ Accept
605
+ ↓ Yes
606
+ Generate feedback with issues
607
+
608
+ Agent regenerates with feedback
609
+ ↓ (max 3 attempts)
610
+ Score improved? ──→ ✅ Accept best result
611
+ ```
612
+
613
+ ### Example: PM Agent with Auto-Refinement
614
+
615
+ ```markdown
616
+ Attempt 1/3: Generating requirements...
617
+ Validation: 0.72/1.00 ⚠️ (Below threshold)
618
+ Issues: Acceptance criteria not testable, missing rate limiting
619
+
620
+ Attempt 2/3: Refining with feedback...
621
+ Validation: 0.85/1.00 ✅ (Above threshold)
622
+ Improvements: Testable criteria added, rate limiting specified
623
+
624
+ ✅ Final Result: Requirements validated (0.85/1.00)
625
+ ```
626
+
627
+ **Features**:
628
+ - Max 3 refinement attempts per agent
629
+ - Stops when quality threshold met (0.80 default)
630
+ - Applies to PM, Architect, QA Lead agents
631
+ - Shows progress and improvements
632
+ - Optional (can disable per agent)
633
+
634
+ **Configuration**: `.specweave/config.yaml` → `role_orchestrator.feedback_loops`
635
+
636
+ **Provided by**: `role-orchestrator` skill
637
+
638
+ ---
639
+
640
+ ## Summary
641
+
642
+ **SpecWeave** replaces vibe coding with **Spec-Driven Development**:
643
+
644
+ 1. ✅ **Specifications are SOURCE OF TRUTH** - Code expresses specs
645
+ 2. ✅ **Framework-agnostic** - Works with ANY language/framework
646
+ 3. ✅ **Flexible documentation** - Comprehensive upfront OR incremental
647
+ 4. ✅ **Context precision** - 80%+ token reduction (two-pass optimization), scales 500-1000+ pages 🆕
648
+ 5. ✅ **Auto-role routing** - Skills detect expertise automatically
649
+ 6. ✅ **Deployment intelligence** - Asks about target before infrastructure
650
+ 7. ✅ **Test-validated** - 3+ tests per skill, E2E when UI exists
651
+ 8. ✅ **Living documentation** - Auto-update via Claude hooks
652
+ 9. ✅ **Brownfield-ready** - Analyze, document, then modify safely
653
+ 10. ✅ **Production-ready** - Supports enterprise scale
654
+ 11. ✅ **Quality assurance** - LLM-as-judge validation with 6-dimension scoring 🆕
655
+ 12. ✅ **Auto-refinement** - Feedback loops improve specs/designs automatically 🆕
656
+
657
+ **This framework enables building software at ANY scale, with ANY tech stack, with confidence, clarity, minimal context usage, and automatic quality improvement.**
658
+
659
+ ---
660
+
661
+ **Quick Start**: Run `/create-project` to initialize a new SpecWeave project
662
+
663
+ **Need help?**: Ask Claude to load the relevant guide from `.specweave/docs/internal/delivery/guides/`
664
+
665
+ **Last Updated**: Auto-updated via `post-task-completion` hook