@paths.design/caws-cli 9.3.2 → 10.0.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 (273) hide show
  1. package/README.md +58 -27
  2. package/dist/commands/archive.js +67 -28
  3. package/dist/commands/burnup.js +20 -11
  4. package/dist/commands/diagnose.js +34 -22
  5. package/dist/commands/evaluate.js +27 -15
  6. package/dist/commands/gates.js +122 -0
  7. package/dist/commands/init.js +143 -15
  8. package/dist/commands/iterate.js +77 -4
  9. package/dist/commands/parallel.js +4 -0
  10. package/dist/commands/plan.js +9 -19
  11. package/dist/commands/provenance.js +53 -17
  12. package/dist/commands/quality-monitor.js +64 -45
  13. package/dist/commands/sidecar.js +71 -0
  14. package/dist/commands/specs.js +233 -44
  15. package/dist/commands/status.js +113 -9
  16. package/dist/commands/tutorial.js +10 -9
  17. package/dist/commands/validate.js +49 -6
  18. package/dist/commands/verify-acs.js +35 -78
  19. package/dist/commands/waivers.js +69 -12
  20. package/dist/commands/worktree.js +50 -25
  21. package/dist/error-handler.js +2 -13
  22. package/dist/gates/budget-limit.js +116 -0
  23. package/dist/gates/feedback.js +260 -0
  24. package/dist/gates/format.js +179 -0
  25. package/dist/gates/god-object.js +117 -0
  26. package/dist/gates/pipeline.js +167 -0
  27. package/dist/gates/scope-boundary.js +93 -0
  28. package/dist/gates/spec-completeness.js +102 -0
  29. package/dist/gates/todo-detection.js +205 -0
  30. package/dist/index.js +130 -151
  31. package/dist/parallel/parallel-manager.js +3 -3
  32. package/dist/policy/PolicyManager.js +42 -10
  33. package/dist/scaffold/claude-hooks.js +24 -1
  34. package/dist/scaffold/git-hooks.js +45 -102
  35. package/dist/scaffold/index.js +4 -3
  36. package/dist/session/session-manager.js +71 -14
  37. package/dist/sidecars/index.js +33 -0
  38. package/dist/sidecars/listeners.js +40 -0
  39. package/dist/sidecars/provenance-summary.js +238 -0
  40. package/dist/sidecars/quality-gaps.js +258 -0
  41. package/dist/sidecars/schema.js +149 -0
  42. package/dist/sidecars/spec-drift.js +151 -0
  43. package/dist/sidecars/waiver-draft.js +176 -0
  44. package/dist/templates/.caws/schemas/policy.schema.json +50 -0
  45. package/dist/templates/.caws/schemas/waivers.schema.json +30 -24
  46. package/dist/templates/.caws/schemas/working-spec.schema.json +51 -8
  47. package/dist/templates/.caws/schemas/worktrees.schema.json +3 -1
  48. package/dist/templates/.caws/templates/working-spec.template.yml +7 -3
  49. package/dist/templates/.claude/hooks/audit.sh +0 -0
  50. package/dist/templates/.claude/hooks/block-dangerous.sh +52 -11
  51. package/dist/templates/.claude/hooks/classify_command.py +592 -0
  52. package/dist/templates/.claude/hooks/doc-frontmatter-check.sh +173 -0
  53. package/dist/templates/.claude/hooks/quality-check.sh +23 -10
  54. package/dist/templates/.claude/hooks/scope-guard.sh +34 -32
  55. package/dist/templates/.claude/hooks/session-caws-status.sh +2 -2
  56. package/dist/templates/.claude/hooks/session-log.sh +76 -3
  57. package/dist/templates/.claude/hooks/stop-worktree-check.sh +1 -1
  58. package/dist/templates/.claude/hooks/test_classify_command.py +370 -0
  59. package/dist/templates/.claude/hooks/test_wrapper_smoke.sh +96 -0
  60. package/dist/templates/.claude/hooks/worktree-guard.sh +2 -2
  61. package/dist/templates/.claude/hooks/worktree-write-guard.sh +1 -1
  62. package/dist/templates/.claude/settings.json +26 -0
  63. package/dist/templates/.cursor/hooks/caws-quality-check.sh +4 -4
  64. package/dist/templates/.cursor/hooks/caws-scope-guard.sh +1 -1
  65. package/dist/templates/.cursor/hooks/session-log.sh +924 -0
  66. package/dist/templates/.cursor/hooks.json +25 -0
  67. package/dist/templates/.cursor/rules/02-quality-gates.mdc +3 -5
  68. package/dist/templates/.cursor/rules/10-documentation-quality-standards.mdc +6 -11
  69. package/dist/templates/.cursor/rules/11-scope-management-waivers.mdc +14 -18
  70. package/dist/templates/.cursor/rules/12-implementation-completeness.mdc +4 -4
  71. package/dist/templates/.cursor/rules/13-language-agnostic-standards.mdc +3 -13
  72. package/dist/templates/.github/copilot-instructions.md +5 -5
  73. package/dist/templates/.idea/runConfigurations/CAWS_Evaluate.xml +1 -1
  74. package/dist/templates/.junie/guidelines.md +2 -2
  75. package/dist/templates/.vscode/settings.json +3 -1
  76. package/dist/templates/.windsurf/rules/caws-quality-standards.md +2 -2
  77. package/dist/templates/.windsurf/workflows/caws-guided-development.md +3 -3
  78. package/dist/templates/CLAUDE.md +43 -8
  79. package/dist/templates/agents.md +29 -9
  80. package/dist/templates/docs/README.md +8 -7
  81. package/dist/templates/scripts/new_feature.sh +80 -0
  82. package/dist/test-analysis.js +43 -30
  83. package/dist/tool-loader.js +1 -1
  84. package/dist/utils/agent-session.js +202 -0
  85. package/dist/utils/detection.js +8 -2
  86. package/dist/utils/finalization.js +7 -6
  87. package/dist/utils/gitignore-updater.js +3 -0
  88. package/dist/utils/lifecycle-events.js +94 -0
  89. package/dist/utils/quality-gates-utils.js +29 -44
  90. package/dist/utils/schema-validator.js +42 -0
  91. package/dist/utils/spec-resolver.js +93 -21
  92. package/dist/utils/working-state.js +505 -0
  93. package/dist/validation/spec-validation.js +92 -22
  94. package/dist/waivers-manager.js +60 -6
  95. package/dist/worktree/worktree-manager.js +390 -93
  96. package/package.json +6 -6
  97. package/templates/.caws/schemas/policy.schema.json +50 -0
  98. package/templates/.caws/schemas/waivers.schema.json +30 -24
  99. package/templates/.caws/schemas/working-spec.schema.json +51 -8
  100. package/templates/.caws/schemas/worktrees.schema.json +3 -1
  101. package/templates/.caws/templates/working-spec.template.yml +7 -3
  102. package/templates/.claude/hooks/block-dangerous.sh +52 -11
  103. package/templates/.claude/hooks/classify_command.py +592 -0
  104. package/templates/.claude/hooks/doc-frontmatter-check.sh +173 -0
  105. package/templates/.claude/hooks/quality-check.sh +23 -10
  106. package/templates/.claude/hooks/scope-guard.sh +34 -32
  107. package/templates/.claude/hooks/session-caws-status.sh +2 -2
  108. package/templates/.claude/hooks/session-log.sh +76 -3
  109. package/templates/.claude/hooks/stop-worktree-check.sh +1 -1
  110. package/templates/.claude/hooks/test_classify_command.py +370 -0
  111. package/templates/.claude/hooks/test_wrapper_smoke.sh +96 -0
  112. package/templates/.claude/hooks/worktree-guard.sh +2 -2
  113. package/templates/.claude/hooks/worktree-write-guard.sh +1 -1
  114. package/templates/.claude/settings.json +26 -0
  115. package/templates/.cursor/hooks/caws-quality-check.sh +4 -4
  116. package/templates/.cursor/hooks/caws-scope-guard.sh +1 -1
  117. package/templates/.cursor/hooks/session-log.sh +924 -0
  118. package/templates/.cursor/hooks.json +25 -0
  119. package/templates/.cursor/rules/02-quality-gates.mdc +3 -5
  120. package/templates/.cursor/rules/10-documentation-quality-standards.mdc +6 -11
  121. package/templates/.cursor/rules/11-scope-management-waivers.mdc +14 -18
  122. package/templates/.cursor/rules/12-implementation-completeness.mdc +4 -4
  123. package/templates/.cursor/rules/13-language-agnostic-standards.mdc +3 -13
  124. package/templates/.github/copilot-instructions.md +5 -5
  125. package/templates/.idea/runConfigurations/CAWS_Evaluate.xml +1 -1
  126. package/templates/.junie/guidelines.md +2 -2
  127. package/templates/.vscode/settings.json +3 -1
  128. package/templates/.windsurf/rules/caws-quality-standards.md +2 -2
  129. package/templates/.windsurf/workflows/caws-guided-development.md +3 -3
  130. package/templates/CLAUDE.md +43 -8
  131. package/templates/{AGENTS.md → agents.md} +29 -9
  132. package/templates/docs/README.md +8 -7
  133. package/templates/scripts/new_feature.sh +80 -0
  134. package/dist/budget-derivation.d.ts +0 -74
  135. package/dist/budget-derivation.d.ts.map +0 -1
  136. package/dist/cicd-optimizer.d.ts +0 -142
  137. package/dist/cicd-optimizer.d.ts.map +0 -1
  138. package/dist/commands/archive.d.ts +0 -51
  139. package/dist/commands/archive.d.ts.map +0 -1
  140. package/dist/commands/burnup.d.ts +0 -6
  141. package/dist/commands/burnup.d.ts.map +0 -1
  142. package/dist/commands/diagnose.d.ts +0 -52
  143. package/dist/commands/diagnose.d.ts.map +0 -1
  144. package/dist/commands/evaluate.d.ts +0 -8
  145. package/dist/commands/evaluate.d.ts.map +0 -1
  146. package/dist/commands/init.d.ts +0 -5
  147. package/dist/commands/init.d.ts.map +0 -1
  148. package/dist/commands/iterate.d.ts +0 -8
  149. package/dist/commands/iterate.d.ts.map +0 -1
  150. package/dist/commands/mode.d.ts +0 -25
  151. package/dist/commands/mode.d.ts.map +0 -1
  152. package/dist/commands/parallel.d.ts +0 -7
  153. package/dist/commands/parallel.d.ts.map +0 -1
  154. package/dist/commands/plan.d.ts +0 -49
  155. package/dist/commands/plan.d.ts.map +0 -1
  156. package/dist/commands/provenance.d.ts +0 -32
  157. package/dist/commands/provenance.d.ts.map +0 -1
  158. package/dist/commands/quality-gates.d.ts +0 -6
  159. package/dist/commands/quality-gates.d.ts.map +0 -1
  160. package/dist/commands/quality-gates.js +0 -444
  161. package/dist/commands/quality-monitor.d.ts +0 -17
  162. package/dist/commands/quality-monitor.d.ts.map +0 -1
  163. package/dist/commands/session.d.ts +0 -7
  164. package/dist/commands/session.d.ts.map +0 -1
  165. package/dist/commands/specs.d.ts +0 -77
  166. package/dist/commands/specs.d.ts.map +0 -1
  167. package/dist/commands/status.d.ts +0 -44
  168. package/dist/commands/status.d.ts.map +0 -1
  169. package/dist/commands/templates.d.ts +0 -74
  170. package/dist/commands/templates.d.ts.map +0 -1
  171. package/dist/commands/tool.d.ts +0 -13
  172. package/dist/commands/tool.d.ts.map +0 -1
  173. package/dist/commands/troubleshoot.d.ts +0 -8
  174. package/dist/commands/troubleshoot.d.ts.map +0 -1
  175. package/dist/commands/troubleshoot.js +0 -104
  176. package/dist/commands/tutorial.d.ts +0 -55
  177. package/dist/commands/tutorial.d.ts.map +0 -1
  178. package/dist/commands/validate.d.ts +0 -15
  179. package/dist/commands/validate.d.ts.map +0 -1
  180. package/dist/commands/waivers.d.ts +0 -8
  181. package/dist/commands/waivers.d.ts.map +0 -1
  182. package/dist/commands/workflow.d.ts +0 -85
  183. package/dist/commands/workflow.d.ts.map +0 -1
  184. package/dist/commands/worktree.d.ts +0 -7
  185. package/dist/commands/worktree.d.ts.map +0 -1
  186. package/dist/config/index.d.ts +0 -29
  187. package/dist/config/index.d.ts.map +0 -1
  188. package/dist/config/lite-scope.d.ts +0 -33
  189. package/dist/config/lite-scope.d.ts.map +0 -1
  190. package/dist/config/modes.d.ts +0 -264
  191. package/dist/config/modes.d.ts.map +0 -1
  192. package/dist/constants/spec-types.d.ts +0 -93
  193. package/dist/constants/spec-types.d.ts.map +0 -1
  194. package/dist/error-handler.d.ts +0 -151
  195. package/dist/error-handler.d.ts.map +0 -1
  196. package/dist/generators/jest-config-generator.d.ts +0 -32
  197. package/dist/generators/jest-config-generator.d.ts.map +0 -1
  198. package/dist/generators/jest-config.d.ts +0 -32
  199. package/dist/generators/jest-config.d.ts.map +0 -1
  200. package/dist/generators/jest-config.js +0 -242
  201. package/dist/generators/working-spec.d.ts +0 -13
  202. package/dist/generators/working-spec.d.ts.map +0 -1
  203. package/dist/index-new.d.ts +0 -5
  204. package/dist/index-new.d.ts.map +0 -1
  205. package/dist/index-new.js +0 -317
  206. package/dist/index.d.ts +0 -5
  207. package/dist/index.d.ts.map +0 -1
  208. package/dist/index.js.backup +0 -4711
  209. package/dist/minimal-cli.d.ts +0 -3
  210. package/dist/minimal-cli.d.ts.map +0 -1
  211. package/dist/parallel/parallel-manager.d.ts +0 -67
  212. package/dist/parallel/parallel-manager.d.ts.map +0 -1
  213. package/dist/policy/PolicyManager.d.ts +0 -104
  214. package/dist/policy/PolicyManager.d.ts.map +0 -1
  215. package/dist/scaffold/claude-hooks.d.ts +0 -28
  216. package/dist/scaffold/claude-hooks.d.ts.map +0 -1
  217. package/dist/scaffold/cursor-hooks.d.ts +0 -7
  218. package/dist/scaffold/cursor-hooks.d.ts.map +0 -1
  219. package/dist/scaffold/git-hooks.d.ts +0 -38
  220. package/dist/scaffold/git-hooks.d.ts.map +0 -1
  221. package/dist/scaffold/index.d.ts +0 -17
  222. package/dist/scaffold/index.d.ts.map +0 -1
  223. package/dist/session/session-manager.d.ts +0 -94
  224. package/dist/session/session-manager.d.ts.map +0 -1
  225. package/dist/spec/SpecFileManager.d.ts +0 -146
  226. package/dist/spec/SpecFileManager.d.ts.map +0 -1
  227. package/dist/templates/.cursor/hooks/caws-tool-validation.sh +0 -121
  228. package/dist/templates/.github/copilot/instructions.md +0 -311
  229. package/dist/test-analysis.d.ts +0 -231
  230. package/dist/test-analysis.d.ts.map +0 -1
  231. package/dist/tool-interface.d.ts +0 -236
  232. package/dist/tool-interface.d.ts.map +0 -1
  233. package/dist/tool-loader.d.ts +0 -77
  234. package/dist/tool-loader.d.ts.map +0 -1
  235. package/dist/tool-validator.d.ts +0 -72
  236. package/dist/tool-validator.d.ts.map +0 -1
  237. package/dist/utils/async-utils.d.ts +0 -73
  238. package/dist/utils/async-utils.d.ts.map +0 -1
  239. package/dist/utils/command-wrapper.d.ts +0 -66
  240. package/dist/utils/command-wrapper.d.ts.map +0 -1
  241. package/dist/utils/detection.d.ts +0 -14
  242. package/dist/utils/detection.d.ts.map +0 -1
  243. package/dist/utils/error-categories.d.ts +0 -52
  244. package/dist/utils/error-categories.d.ts.map +0 -1
  245. package/dist/utils/finalization.d.ts +0 -17
  246. package/dist/utils/finalization.d.ts.map +0 -1
  247. package/dist/utils/git-lock.d.ts +0 -13
  248. package/dist/utils/git-lock.d.ts.map +0 -1
  249. package/dist/utils/gitignore-updater.d.ts +0 -39
  250. package/dist/utils/gitignore-updater.d.ts.map +0 -1
  251. package/dist/utils/ide-detection.d.ts +0 -89
  252. package/dist/utils/ide-detection.d.ts.map +0 -1
  253. package/dist/utils/project-analysis.d.ts +0 -34
  254. package/dist/utils/project-analysis.d.ts.map +0 -1
  255. package/dist/utils/promise-utils.d.ts +0 -30
  256. package/dist/utils/promise-utils.d.ts.map +0 -1
  257. package/dist/utils/quality-gates-utils.d.ts +0 -49
  258. package/dist/utils/quality-gates-utils.d.ts.map +0 -1
  259. package/dist/utils/quality-gates.d.ts +0 -49
  260. package/dist/utils/quality-gates.d.ts.map +0 -1
  261. package/dist/utils/quality-gates.js +0 -402
  262. package/dist/utils/spec-resolver.d.ts +0 -80
  263. package/dist/utils/spec-resolver.d.ts.map +0 -1
  264. package/dist/utils/typescript-detector.d.ts +0 -66
  265. package/dist/utils/typescript-detector.d.ts.map +0 -1
  266. package/dist/utils/yaml-validation.d.ts +0 -32
  267. package/dist/utils/yaml-validation.d.ts.map +0 -1
  268. package/dist/validation/spec-validation.d.ts +0 -43
  269. package/dist/validation/spec-validation.d.ts.map +0 -1
  270. package/dist/waivers-manager.d.ts +0 -167
  271. package/dist/waivers-manager.d.ts.map +0 -1
  272. package/dist/worktree/worktree-manager.d.ts +0 -54
  273. package/dist/worktree/worktree-manager.d.ts.map +0 -1
@@ -5,6 +5,9 @@
5
5
  {
6
6
  "command": "./.cursor/hooks/block-dangerous.sh"
7
7
  },
8
+ {
9
+ "command": "./.cursor/hooks/session-log.sh"
10
+ },
8
11
  {
9
12
  "command": "./.cursor/hooks/audit.sh"
10
13
  }
@@ -15,6 +18,9 @@
15
18
  },
16
19
  {
17
20
  "command": "./.cursor/hooks/caws-scope-guard.sh"
21
+ },
22
+ {
23
+ "command": "./.cursor/hooks/session-log.sh"
18
24
  }
19
25
  ],
20
26
  "afterFileEdit": [
@@ -30,6 +36,9 @@
30
36
  {
31
37
  "command": "./.cursor/hooks/caws-quality-check.sh"
32
38
  },
39
+ {
40
+ "command": "./.cursor/hooks/session-log.sh"
41
+ },
33
42
  {
34
43
  "command": "./.cursor/hooks/audit.sh"
35
44
  }
@@ -38,11 +47,27 @@
38
47
  {
39
48
  "command": "./.cursor/hooks/caws-scope-guard.sh"
40
49
  },
50
+ {
51
+ "command": "./.cursor/hooks/session-log.sh"
52
+ },
41
53
  {
42
54
  "command": "./.cursor/hooks/audit.sh"
43
55
  }
44
56
  ],
57
+ "afterAgentResponse": [
58
+ {
59
+ "command": "./.cursor/hooks/session-log.sh"
60
+ }
61
+ ],
62
+ "afterAgentThought": [
63
+ {
64
+ "command": "./.cursor/hooks/session-log.sh"
65
+ }
66
+ ],
45
67
  "stop": [
68
+ {
69
+ "command": "./.cursor/hooks/session-log.sh"
70
+ },
46
71
  {
47
72
  "command": "./.cursor/hooks/audit.sh"
48
73
  }
@@ -342,12 +342,10 @@ Tag placeholders explicitly in code:
342
342
  # Run comprehensive test suite
343
343
  caws quality-gates --test-coverage --mutation-testing
344
344
 
345
- # Check test quality metrics
346
- caws metrics track --metric="test_coverage" --value=85
347
- caws metrics track --metric="mutation_score" --value=70
345
+ # Metrics are tracked automatically via working state
348
346
 
349
- # Update progress with test completion
350
- caws progress update --criterion-id="TEST-001" --status="completed" --tests-passing=25
347
+ # Verify acceptance criteria for test completion
348
+ caws verify-acs --spec-id <id>
351
349
  ```
352
350
 
353
351
  ### Test Analysis
@@ -337,11 +337,10 @@ caws validate --check-documentation-quality
337
337
  # Generate documentation quality report
338
338
  caws docs quality-report --include-marketing-check --include-status-verification
339
339
 
340
- # Track documentation quality metrics
341
- caws metrics track --metric="documentation_quality_score" --value=95
340
+ # Metrics are tracked automatically via working state
342
341
 
343
- # Update progress with documentation quality
344
- caws progress update --criterion-id="DOCS-001" --status="completed"
342
+ # Verify acceptance criteria for documentation quality
343
+ caws verify-acs --spec-id <id>
345
344
  ```
346
345
 
347
346
  ## Continuous Improvement
@@ -377,14 +376,10 @@ caws progress update --criterion-id="DOCS-001" --status="completed"
377
376
  ### CAWS Integration Points
378
377
 
379
378
  ```bash
380
- # Track documentation quality trends
381
- caws metrics trends --metric="documentation_quality_score" --period="30d"
379
+ # Metrics are tracked automatically via working state
382
380
 
383
- # Export documentation quality metrics
384
- caws metrics export --format=json --include-documentation-quality
385
-
386
- # Archive documentation with quality verification
387
- caws archive DOCS-001 --verify-documentation-quality
381
+ # Archive documentation
382
+ caws archive DOCS-001
388
383
  ```
389
384
 
390
385
  This rule ensures documentation maintains engineering-grade quality and prevents the accumulation of problematic content that requires manual cleanup, fully integrated with CAWS workflow and quality gates.
@@ -246,7 +246,7 @@ check-change-budget() {
246
246
  # GitHub Actions example
247
247
  - name: Check Scope Compliance
248
248
  run: |
249
- if ! caws validate --scope-check; then
249
+ if ! caws gates run; then
250
250
  echo "❌ Scope violation detected"
251
251
  exit 1
252
252
  fi
@@ -317,11 +317,8 @@ risk_tier: 'T2' # T1, T2, or T3
317
317
  ### CAWS Commands
318
318
 
319
319
  ```bash
320
- # Validate scope compliance
321
- caws validate --scope-check
322
-
323
- # Check change budget
324
- caws validate --budget-check
320
+ # Run quality gates (includes scope and budget checks)
321
+ caws gates run
325
322
 
326
323
  # Create emergency waiver
327
324
  caws waivers create \
@@ -343,14 +340,14 @@ caws waivers status --waiver-id="AUTH-FIX-001"
343
340
  ### Quality Gate Integration
344
341
 
345
342
  ```bash
346
- # Run quality gates with tier-specific requirements
347
- caws quality-gates --tier=T2
343
+ # Run quality gates (tier is determined from spec)
344
+ caws gates run
348
345
 
349
- # Check if waiver is required
350
- caws quality-gates --check-waiver-required
346
+ # List active waivers
347
+ caws waivers list
351
348
 
352
- # Apply waiver to quality gates
353
- caws quality-gates --apply-waiver=AUTH-FIX-001
349
+ # Create a waiver for quality gates
350
+ caws waivers create
354
351
  ```
355
352
 
356
353
  ## Continuous Improvement
@@ -372,14 +369,13 @@ caws quality-gates --apply-waiver=AUTH-FIX-001
372
369
  ### CAWS Integration Points
373
370
 
374
371
  ```bash
375
- # Track scope compliance in CAWS metrics
376
- caws metrics track --metric="scope_violations" --value=0
372
+ # Metrics are tracked automatically via working state
377
373
 
378
- # Update progress with scope compliance
379
- caws progress update --criterion-id="SCOPE-001" --status="completed"
374
+ # Verify acceptance criteria for scope compliance
375
+ caws verify-acs --spec-id <id>
380
376
 
381
- # Archive changes with scope compliance verification
382
- caws archive FEAT-001 --verify-scope-compliance
377
+ # Archive changes
378
+ caws archive FEAT-001
383
379
  ```
384
380
 
385
381
  This rule ensures proper scope management while providing structured escape hatches for critical situations that require immediate attention, fully integrated with CAWS workflow and quality gates.
@@ -484,11 +484,11 @@ def calculate_completeness_score(analysis_results):
484
484
  ### CAWS Quality Monitoring
485
485
 
486
486
  ```bash
487
- # Use CAWS quality monitoring
488
- caws quality-monitor --action=code_edited --files="$(git diff --name-only)"
487
+ # Run quality gates after code changes
488
+ caws gates run
489
489
 
490
- # Track TODO resolution progress
491
- caws progress-update --criterion-id="TODO-001" --status="completed" --tests-passing=1
490
+ # Verify acceptance criteria for TODO resolution
491
+ caws verify-acs --spec-id <id>
492
492
  ```
493
493
 
494
494
  ### Continuous Improvement
@@ -485,24 +485,14 @@ caws quality-gates --check-universal-standards
485
485
  ### Metrics Tracking
486
486
 
487
487
  ```bash
488
- # Track complexity metrics
489
- caws metrics track --metric="cyclomatic_complexity" --value=8
490
-
491
- # Track maintainability metrics
492
- caws metrics track --metric="function_size" --value=25
493
-
494
- # Track architectural compliance
495
- caws metrics track --metric="dependency_injection" --value=1
488
+ # Metrics are tracked automatically via working state
496
489
  ```
497
490
 
498
491
  ### Progress Tracking
499
492
 
500
493
  ```bash
501
- # Update progress with complexity compliance
502
- caws progress update --criterion-id="COMPLEXITY-001" --status="completed"
503
-
504
- # Track architectural pattern implementation
505
- caws progress update --criterion-id="ARCHITECTURE-001" --status="in_progress"
494
+ # Verify acceptance criteria for complexity compliance
495
+ caws verify-acs --spec-id <id>
506
496
  ```
507
497
 
508
498
  ## Enforcement Mechanisms
@@ -30,9 +30,9 @@ Always validate working specs: `caws validate`
30
30
 
31
31
  ## Quality Workflow
32
32
 
33
- 1. **Before implementation**: `caws agent iterate --current-state "describe what you're about to do"`
34
- 2. **During implementation**: `caws agent evaluate --quiet`
35
- 3. **Before commit**: `caws validate && caws agent evaluate`
33
+ 1. **Before implementation**: `caws iterate --current-state "describe what you're about to do"`
34
+ 2. **During implementation**: `caws evaluate --quiet`
35
+ 3. **Before commit**: `caws validate && caws evaluate`
36
36
 
37
37
  ## Quality Gates by Risk Tier
38
38
 
@@ -65,8 +65,8 @@ Valid reasons: `emergency_hotfix`, `legacy_integration`, `experimental_feature`,
65
65
 
66
66
  ### Feature Development
67
67
  1. Validate working spec: `caws validate`
68
- 2. Get implementation guidance: `caws agent iterate`
69
- 3. Implement with quality checks: `caws agent evaluate --quiet`
68
+ 2. Get implementation guidance: `caws iterate`
69
+ 3. Implement with quality checks: `caws evaluate --quiet`
70
70
  4. Run full validation: `caws validate && npm test`
71
71
 
72
72
  ### Bug Fixes
@@ -1,5 +1,5 @@
1
1
  <component name="ProjectRunConfigurationManager">
2
- <configuration default="false" name="CAWS: Evaluate Quality" type="NodeJSConfigurationType" factoryName="Node.js" path-to-js-file="$PROJECT_DIR$/packages/caws-cli/dist/index.js" working-dir="$PROJECT_DIR$" application-parameters="agent evaluate .caws/working-spec.yaml">
2
+ <configuration default="false" name="CAWS: Evaluate Quality" type="NodeJSConfigurationType" factoryName="Node.js" path-to-js-file="$PROJECT_DIR$/packages/caws-cli/dist/index.js" working-dir="$PROJECT_DIR$" application-parameters="evaluate">
3
3
  <method v="2" />
4
4
  </configuration>
5
5
  </component>
@@ -15,8 +15,8 @@ Before making changes, read `.caws/working-spec.yaml`. It defines:
15
15
 
16
16
  ```bash
17
17
  caws validate # Validate the working spec
18
- caws agent iterate # Get implementation guidance
19
- caws agent evaluate # Evaluate quality compliance
18
+ caws iterate # Get implementation guidance
19
+ caws evaluate # Evaluate quality compliance
20
20
  caws waivers create --reason ... # Create waiver for justified exceptions
21
21
  ```
22
22
 
@@ -22,12 +22,14 @@
22
22
  // Exclude CAWS-generated files from search and navigation
23
23
  "files.exclude": {
24
24
  ".caws/cache/": true,
25
+ ".caws/state/": true,
25
26
  ".caws/waivers/review-*.md": true
26
27
  },
27
28
 
28
29
  // Search excludes for CAWS artifacts
29
30
  "search.exclude": {
30
31
  ".caws/cache/**": true,
32
+ ".caws/state/**": true,
31
33
  "packages/*/dist/**": true,
32
34
  "packages/*/node_modules/**": true
33
35
  },
@@ -57,7 +59,7 @@
57
59
  "label": "CAWS: Evaluate Quality",
58
60
  "type": "shell",
59
61
  "command": "caws",
60
- "args": ["agent", "evaluate", ".caws/working-spec.yaml"],
62
+ "args": ["evaluate"],
61
63
  "group": "test",
62
64
  "presentation": {
63
65
  "echo": true,
@@ -29,8 +29,8 @@ Always check `.caws/working-spec.yaml` before making changes. It defines:
29
29
 
30
30
  ```bash
31
31
  caws validate # Validate working spec
32
- caws agent iterate # Get implementation guidance
33
- caws agent evaluate # Evaluate quality compliance
32
+ caws iterate # Get implementation guidance
33
+ caws evaluate # Evaluate quality compliance
34
34
  caws waivers create --reason ... # Create waiver for justified exceptions
35
35
  ```
36
36
 
@@ -20,7 +20,7 @@ caws init feature-name --interactive
20
20
  ### 2. Plan Implementation Strategy
21
21
  ```
22
22
  # Get CAWS guidance for implementation approach
23
- caws agent iterate --current-state "Planning phase complete, need implementation strategy"
23
+ caws iterate --current-state "Planning phase complete, need implementation strategy"
24
24
 
25
25
  # CAWS will suggest:
26
26
  # - Implementation steps
@@ -35,7 +35,7 @@ caws agent iterate --current-state "Planning phase complete, need implementation
35
35
  # Real-time feedback via CAWS tools
36
36
 
37
37
  # Regular quality checks
38
- caws agent evaluate --quiet
38
+ caws evaluate --quiet
39
39
  ```
40
40
 
41
41
  ### 4. Quality Assurance Integration
@@ -63,7 +63,7 @@ npm run test:contract
63
63
  ### 6. Final Quality Review
64
64
  ```
65
65
  # Complete CAWS evaluation
66
- caws agent evaluate
66
+ caws evaluate
67
67
 
68
68
  # Generate provenance report
69
69
  caws provenance generate
@@ -23,27 +23,56 @@ caws validate
23
23
 
24
24
  ## CAWS Workflow
25
25
 
26
- Before writing code, check the working spec:
26
+ Before writing code, check the canonical spec for the current feature:
27
27
 
28
28
  ```bash
29
- # Validate the working spec
30
- caws validate
29
+ # Create a feature spec for isolated work
30
+ caws specs create FEAT-001 --type feature --title "description"
31
+
32
+ # Validate the feature spec
33
+ caws validate --spec-id FEAT-001
34
+
35
+ # Run quality gates v2 pipeline
36
+ caws gates run
31
37
 
32
38
  # Get iteration guidance
33
- caws agent iterate --current-state "describe what you're about to do"
39
+ caws iterate --current-state "describe what you're about to do"
34
40
 
35
41
  # After implementation, evaluate quality
36
- caws agent evaluate
42
+ caws evaluate
43
+
44
+ # Verify acceptance criteria have evidence
45
+ caws verify-acs --spec-id FEAT-001
46
+
47
+ # Check budget burn-up
48
+ caws burnup --spec-id FEAT-001
49
+
50
+ # Check status for the same feature
51
+ caws status --spec-id FEAT-001
52
+ ```
53
+
54
+ ### Advisory Sidecars
55
+
56
+ Sidecar commands are diagnostic analysis tools. They don't enforce anything -- they help you understand what's happening and what to do next.
57
+
58
+ ```bash
59
+ caws sidecar drift # Compare spec intent vs current implementation
60
+ caws sidecar gaps # Diagnose quality gaps blocking gate passage
61
+ caws sidecar waiver-draft # Generate pre-filled waiver template for a failing gate
62
+ caws sidecar provenance # Summarize work history for merge readiness review
37
63
  ```
38
64
 
39
65
  ### Working Spec
40
66
 
41
- The project spec lives at `.caws/working-spec.yaml`. Feature specs live at `.caws/specs/<ID>.yaml`. It defines:
67
+ Canonical feature specs live at `.caws/specs/<ID>.yaml` (create with `caws specs create <id> --type feature --title "description"`). `.caws/working-spec.yaml` is a compatibility mirror for older tooling and legacy single-spec flows. The active spec defines:
42
68
 
43
69
  - **Risk tier**: Quality requirements (T1: critical, T2: standard, T3: low risk)
70
+ - **Mode**: The type of change (`feature`, `refactor`, `fix`, `doc`, `chore`) -- required
71
+ - **Blast radius**: Which modules are affected (`blast_radius.modules`) -- required
72
+ - **Operational rollback SLO**: Time target for rollback (e.g. `"30m"`) -- required
44
73
  - **Scope**: Which files you can edit (`scope.in`) and which are off-limits (`scope.out`)
45
74
  - **Change budget**: Max files and lines of code per change (see note below)
46
- - **Acceptance criteria**: What "done" means IDs must match `^A\d+$` (e.g. `A1`, `A12`)
75
+ - **Acceptance criteria**: What "done" means -- IDs must match `^A\d+$` (e.g. `A1`, `A12`)
47
76
 
48
77
  Always stay within scope boundaries and change budgets.
49
78
 
@@ -89,11 +118,17 @@ Valid reasons: `emergency_hotfix`, `legacy_integration`, `experimental_feature`,
89
118
 
90
119
  ```
91
120
  .caws/
92
- working-spec.yaml # Project spec (risk tier, scope, acceptance criteria)
121
+ working-spec.yaml # Compatibility mirror for legacy commands
122
+ specs/ # Canonical feature specs
93
123
  policy.yaml # Quality policy overrides (optional)
94
124
  waivers.yml # Active waivers
125
+ state/ # Runtime working state (auto-managed)
95
126
  ```
96
127
 
128
+ > **Working state**: `.caws/state/<spec-id>.json` tracks runtime progress -- current phase,
129
+ > validation/evaluation results, gate history, and files touched. This is maintained
130
+ > automatically by CAWS commands. Agents don't need to manage it directly.
131
+
97
132
  ## Hooks
98
133
 
99
134
  This project has Claude Code hooks configured in `.claude/settings.json`:
@@ -9,27 +9,35 @@ npm install # Install dependencies
9
9
  npm test # Run tests
10
10
  npm run lint # Lint code
11
11
  npm run typecheck # Type check (if TypeScript)
12
- caws validate # Validate CAWS working spec
12
+ caws validate # Validate the current CAWS spec
13
13
  ```
14
14
 
15
15
  ## Project Structure
16
16
 
17
17
  ```
18
18
  .caws/
19
- working-spec.yaml # Project spec (risk tier, scope, acceptance criteria)
19
+ working-spec.yaml # Compatibility mirror for legacy paths
20
+ specs/ # Canonical feature specs
20
21
  policy.yaml # Quality policy overrides (optional)
21
22
  waivers.yml # Active waivers (optional)
22
23
  ```
23
24
 
24
25
  ## CAWS Workflow
25
26
 
26
- 1. **Read the working spec**: Check `.caws/working-spec.yaml` for scope, risk tier, and acceptance criteria
27
- 2. **Validate**: Run `caws validate` to ensure the spec is valid
28
- 3. **Plan**: Run `caws agent iterate` for implementation guidance
27
+ 1. **Read the canonical spec**: Use `.caws/specs/<spec-id>.yaml` when feature specs exist
28
+ 2. **Validate**: Run `caws validate --spec-id <spec-id>` for feature work
29
+ 3. **Plan**: Run `caws iterate` for implementation guidance
29
30
  4. **Implement**: Write tests first, then implementation. Stay within scope boundaries.
30
- 5. **Verify**: Run `caws agent evaluate` to check quality compliance
31
+ 5. **Verify**: Run `caws evaluate` to check quality compliance
31
32
  6. **Commit**: Use conventional commits (`feat:`, `fix:`, `refactor:`, `docs:`, `chore:`)
32
33
 
34
+ For a new feature in a multi-agent project:
35
+
36
+ ```bash
37
+ caws specs create my-feature --type feature --title "My Feature"
38
+ caws validate --spec-id my-feature
39
+ ```
40
+
33
41
  ## Key Rules
34
42
 
35
43
  1. **Stay in scope** -- only edit files listed in `scope.in`, never touch `scope.out`
@@ -44,7 +52,7 @@ caws validate # Validate CAWS working spec
44
52
 
45
53
  ## Quality Gates
46
54
 
47
- Requirements are tiered based on the `risk_tier` in the working spec:
55
+ Requirements are tiered based on the `risk_tier` in the active spec:
48
56
 
49
57
  | Gate | T1 (Critical) | T2 (Standard) | T3 (Low Risk) |
50
58
  |------|---------------|----------------|----------------|
@@ -94,11 +102,23 @@ Valid reasons: `emergency_hotfix`, `legacy_integration`, `experimental_feature`,
94
102
 
95
103
  ## Pre-Submit Checklist
96
104
 
97
- - [ ] Working spec exists and validates (`caws validate`)
105
+ - [ ] Canonical spec exists and validates (`caws validate --spec-id <spec-id>` when applicable)
98
106
  - [ ] All tests pass (`npm test`)
99
107
  - [ ] Coverage meets tier requirements
100
108
  - [ ] Lints pass (`npm run lint`)
101
109
  - [ ] Types check (`npm run typecheck`)
102
110
  - [ ] No scope violations
103
- - [ ] Change budget not exceeded
111
+ - [ ] Change budget not exceeded (`caws burnup --spec-id <spec-id>` shows budget consumption)
112
+ - [ ] Acceptance criteria proven (`caws verify-acs --spec-id <spec-id>` checks evidence exists)
104
113
  - [ ] Conventional commit message
114
+
115
+ ### Optional: Self-Diagnosis with Sidecars
116
+
117
+ If a gate blocks you, use sidecar commands to understand why before retrying:
118
+
119
+ ```bash
120
+ caws sidecar gaps # What's missing? Which gates are failing and why?
121
+ caws sidecar drift # Has implementation drifted from the spec intent?
122
+ caws sidecar waiver-draft # Generate a pre-filled waiver if the gap is acceptable
123
+ caws sidecar provenance # Summarize work history for merge readiness
124
+ ```
@@ -14,12 +14,13 @@ This project is built with the **Coding Agent Workflow System (CAWS)** - an engi
14
14
 
15
15
  ### 1. Project Setup
16
16
  The project is already scaffolded with CAWS. Review and customize:
17
- - `.caws/working-spec.yaml` - Project specification and requirements
18
- - `.caws/policy/tier-policy.json` - Risk tier definitions
17
+ - `.caws/specs/<spec-id>.yaml` - Canonical feature specification and requirements
18
+ - `.caws/working-spec.yaml` - Compatibility mirror for legacy paths
19
+ - `.caws/policy.yaml` - Risk tier definitions
19
20
  - `.github/workflows/caws.yml` - CI/CD quality gates
20
21
 
21
22
  ### 2. Development Workflow
22
- 1. **Plan**: Update working spec with requirements and scope
23
+ 1. **Plan**: Update the active feature spec with requirements and scope
23
24
  2. **Implement**: Follow agent conduct rules and mode constraints
24
25
  3. **Verify**: Run tests and quality gates locally
25
26
  4. **Document**: Update documentation and generate provenance
@@ -111,7 +112,7 @@ The project includes automated quality gates:
111
112
 
112
113
  ### Common Issues
113
114
  1. **Trust Score Low**: Check test coverage and quality gates
114
- 2. **Scope Violations**: Ensure changes align with working spec
115
+ 2. **Scope Violations**: Ensure changes align with the active spec
115
116
  3. **Budget Exceeded**: Review change size and complexity
116
117
  4. **Flaky Tests**: Use property testing and proper mocking
117
118
 
@@ -124,14 +125,14 @@ The project includes automated quality gates:
124
125
  ## Contributing
125
126
 
126
127
  ### Development Process
127
- 1. Update working specification
128
+ 1. Update the active feature specification
128
129
  2. Create comprehensive tests
129
130
  3. Implement with quality gates
130
131
  4. Generate provenance artifacts
131
132
  5. Document changes thoroughly
132
133
 
133
134
  ### Code Review
134
- - Review against working specification
135
+ - Review against the active feature spec
135
136
  - Check trust score and quality gates
136
137
  - Validate observability and rollback
137
138
  - Ensure documentation completeness
@@ -139,7 +140,7 @@ The project includes automated quality gates:
139
140
  ## Resources
140
141
 
141
142
  - **[CAWS Framework](agents.md)**: Complete system documentation
142
- - **[Working Specification](.caws/working-spec.yaml)**: Project requirements
143
+ - **[Canonical Specs](.caws/specs/)**: Project requirements
143
144
  - **[Quality Gates](.github/workflows/caws.yml)**: CI/CD pipeline
144
145
  - **[Tools](apps/tools/caws/)**: Development utilities
145
146
 
@@ -0,0 +1,80 @@
1
+ #!/bin/bash
2
+ # Create a new CAWS feature spec + optional worktree
3
+ #
4
+ # Usage:
5
+ # scripts/new_feature.sh FEAT-001 "Feature description"
6
+ # scripts/new_feature.sh FEAT-001 "Feature description" --worktree
7
+ #
8
+ # This script:
9
+ # 1. Creates a feature spec in .caws/specs/<ID>.yaml
10
+ # 2. Optionally creates a git worktree for isolated development
11
+
12
+ set -euo pipefail
13
+
14
+ if [ $# -lt 2 ]; then
15
+ echo "usage: scripts/new_feature.sh <SPEC-ID> <title> [--worktree]" >&2
16
+ echo " example: scripts/new_feature.sh FEAT-001 'Add user authentication'" >&2
17
+ exit 1
18
+ fi
19
+
20
+ SPEC_ID="$1"
21
+ TITLE="$2"
22
+ USE_WORKTREE="${3:-}"
23
+
24
+ # Validate spec ID format (PREFIX-NUMBER, e.g., FEAT-001, AUTH-042)
25
+ if ! echo "$SPEC_ID" | grep -qE '^[A-Z]+-[0-9]+$'; then
26
+ echo "error: spec ID must be in format PREFIX-NUMBER (e.g., FEAT-001, AUTH-042)" >&2
27
+ exit 1
28
+ fi
29
+
30
+ SPEC_FILE=".caws/specs/${SPEC_ID}.yaml"
31
+
32
+ # Check if spec already exists
33
+ if [ -f "$SPEC_FILE" ]; then
34
+ echo "error: spec $SPEC_ID already exists at $SPEC_FILE" >&2
35
+ exit 1
36
+ fi
37
+
38
+ # Create spec directory if needed
39
+ mkdir -p .caws/specs
40
+
41
+ # Generate spec scaffold
42
+ TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
43
+ cat > "$SPEC_FILE" << EOF
44
+ id: ${SPEC_ID}
45
+ type: feature
46
+ title: "${TITLE}"
47
+ status: draft
48
+ risk_tier: 2
49
+ mode: development
50
+ created_at: "${TIMESTAMP}"
51
+ updated_at: "${TIMESTAMP}"
52
+ blast_radius:
53
+ modules: []
54
+ data_migration: false
55
+ operational_rollback_slo: 5m
56
+ scope:
57
+ in: []
58
+ out:
59
+ - docs/reference/v1/
60
+ - .caws/
61
+ threats: []
62
+ invariants: []
63
+ acceptance: []
64
+ acceptance_criteria: []
65
+ milestones: []
66
+ EOF
67
+
68
+ echo "Created feature spec: $SPEC_FILE"
69
+
70
+ # Optionally create worktree
71
+ if [ "$USE_WORKTREE" = "--worktree" ]; then
72
+ BRANCH_NAME="feat/${SPEC_ID,,}" # lowercase
73
+ WORKTREE_DIR=".caws/worktrees/${SPEC_ID,,}"
74
+
75
+ git worktree add "$WORKTREE_DIR" -b "$BRANCH_NAME"
76
+ echo "Created worktree: $WORKTREE_DIR (branch: $BRANCH_NAME)"
77
+ echo ""
78
+ echo "To start working:"
79
+ echo " cd $WORKTREE_DIR"
80
+ fi