@paths.design/caws-cli 8.1.0 โ†’ 8.2.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 (79) hide show
  1. package/README.md +5 -6
  2. package/dist/commands/archive.d.ts +1 -1
  3. package/dist/commands/archive.d.ts.map +1 -1
  4. package/dist/commands/init.d.ts.map +1 -1
  5. package/dist/commands/init.js +185 -39
  6. package/dist/commands/mode.d.ts +2 -1
  7. package/dist/commands/mode.d.ts.map +1 -1
  8. package/dist/commands/provenance.d.ts.map +1 -1
  9. package/dist/commands/quality-gates.js +1 -1
  10. package/dist/commands/specs.d.ts.map +1 -1
  11. package/dist/commands/worktree.d.ts +7 -0
  12. package/dist/commands/worktree.d.ts.map +1 -0
  13. package/dist/commands/worktree.js +136 -0
  14. package/dist/config/lite-scope.d.ts +33 -0
  15. package/dist/config/lite-scope.d.ts.map +1 -0
  16. package/dist/config/lite-scope.js +158 -0
  17. package/dist/config/modes.d.ts +90 -51
  18. package/dist/config/modes.d.ts.map +1 -1
  19. package/dist/config/modes.js +26 -0
  20. package/dist/error-handler.d.ts +3 -16
  21. package/dist/error-handler.d.ts.map +1 -1
  22. package/dist/generators/jest-config-generator.d.ts +32 -0
  23. package/dist/generators/jest-config-generator.d.ts.map +1 -0
  24. package/dist/index.js +36 -0
  25. package/dist/scaffold/claude-hooks.d.ts +28 -0
  26. package/dist/scaffold/claude-hooks.d.ts.map +1 -0
  27. package/dist/scaffold/claude-hooks.js +28 -0
  28. package/dist/scaffold/index.d.ts +2 -0
  29. package/dist/scaffold/index.d.ts.map +1 -1
  30. package/dist/scaffold/index.js +90 -88
  31. package/dist/templates/.caws/schemas/scope.schema.json +52 -0
  32. package/dist/templates/.caws/schemas/working-spec.schema.json +1 -1
  33. package/dist/templates/.caws/schemas/worktrees.schema.json +36 -0
  34. package/dist/templates/.claude/hooks/block-dangerous.sh +33 -0
  35. package/dist/templates/.claude/hooks/lite-sprawl-check.sh +117 -0
  36. package/dist/templates/.claude/hooks/scope-guard.sh +93 -6
  37. package/dist/templates/.claude/hooks/simplification-guard.sh +92 -0
  38. package/dist/templates/.cursor/README.md +0 -3
  39. package/dist/templates/.github/copilot-instructions.md +82 -0
  40. package/dist/templates/.junie/guidelines.md +73 -0
  41. package/dist/templates/.vscode/launch.json +0 -27
  42. package/dist/templates/.windsurf/rules/caws-quality-standards.md +54 -0
  43. package/dist/templates/CLAUDE.md +101 -0
  44. package/dist/templates/agents.md +73 -1016
  45. package/dist/templates/docs/README.md +5 -5
  46. package/dist/test-analysis.d.ts +50 -1
  47. package/dist/test-analysis.d.ts.map +1 -1
  48. package/dist/utils/error-categories.d.ts +52 -0
  49. package/dist/utils/error-categories.d.ts.map +1 -0
  50. package/dist/utils/gitignore-updater.d.ts +1 -1
  51. package/dist/utils/gitignore-updater.d.ts.map +1 -1
  52. package/dist/utils/gitignore-updater.js +4 -0
  53. package/dist/utils/ide-detection.js +133 -0
  54. package/dist/utils/quality-gates-utils.d.ts +49 -0
  55. package/dist/utils/quality-gates-utils.d.ts.map +1 -0
  56. package/dist/utils/typescript-detector.d.ts +8 -5
  57. package/dist/utils/typescript-detector.d.ts.map +1 -1
  58. package/dist/validation/spec-validation.d.ts.map +1 -1
  59. package/dist/worktree/worktree-manager.d.ts +54 -0
  60. package/dist/worktree/worktree-manager.d.ts.map +1 -0
  61. package/dist/worktree/worktree-manager.js +378 -0
  62. package/package.json +5 -1
  63. package/templates/.caws/schemas/scope.schema.json +52 -0
  64. package/templates/.caws/schemas/working-spec.schema.json +1 -1
  65. package/templates/.caws/schemas/worktrees.schema.json +36 -0
  66. package/templates/.claude/hooks/block-dangerous.sh +33 -0
  67. package/templates/.claude/hooks/lite-sprawl-check.sh +117 -0
  68. package/templates/.claude/hooks/scope-guard.sh +93 -6
  69. package/templates/.claude/hooks/simplification-guard.sh +92 -0
  70. package/templates/.cursor/README.md +0 -3
  71. package/templates/.github/copilot-instructions.md +82 -0
  72. package/templates/.junie/guidelines.md +73 -0
  73. package/templates/.vscode/launch.json +0 -27
  74. package/templates/.windsurf/rules/caws-quality-standards.md +54 -0
  75. package/templates/AGENTS.md +104 -0
  76. package/templates/CLAUDE.md +101 -0
  77. package/templates/docs/README.md +5 -5
  78. package/templates/.github/copilot/instructions.md +0 -311
  79. package/templates/agents.md +0 -1047
@@ -4,11 +4,11 @@
4
4
  This project is built with the **Coding Agent Workflow System (CAWS)** - an engineering-grade framework that ensures quality, reliability, and maintainability in AI-assisted development.
5
5
 
6
6
  ## Key Features
7
- - ๐Ÿ”’ **Quality Gates**: Automated validation of scope, budget, and standards
8
- - ๐Ÿงช **Comprehensive Testing**: Unit, contract, integration, and mutation testing
9
- - ๐Ÿ“Š **Observability**: Structured logging, metrics, and tracing
10
- - ๐Ÿ”„ **Rollback Ready**: Feature flags and migration support
11
- - ๐Ÿ“ฆ **Provenance Tracking**: SBOM and SLSA attestation generation
7
+ - **Quality Gates**: Automated validation of scope, budget, and standards
8
+ - **Comprehensive Testing**: Unit, contract, integration, and mutation testing
9
+ - **Observability**: Structured logging, metrics, and tracing
10
+ - **Rollback Ready**: Feature flags and migration support
11
+ - **Provenance Tracking**: SBOM and SLSA attestation generation
12
12
 
13
13
  ## Getting Started
14
14
 
@@ -1,311 +0,0 @@
1
- # CAWS Integration Instructions for GitHub Copilot
2
-
3
- These instructions help Copilot understand and work with CAWS (Coding Agent Workflow System) quality assurance processes.
4
-
5
- ## Overview
6
-
7
- CAWS provides structured quality assurance for AI-assisted development. When working on CAWS-enabled projects, follow these guidelines to maintain quality standards and leverage CAWS tools effectively.
8
-
9
- ## CAWS Project Detection
10
-
11
- **Check if current project uses CAWS:**
12
- - Look for `.caws/working-spec.yaml` file
13
- - Check for `caws` commands in package.json scripts
14
- - Verify CAWS CLI availability: `caws --version`
15
-
16
- ## Working with CAWS Working Specifications
17
-
18
- **Working specs define project requirements and constraints:**
19
-
20
- ```yaml
21
- id: PROJ-001
22
- title: "Feature implementation"
23
- risk_tier: 2 # 1=Critical, 2=Standard, 3=Low risk
24
- mode: feature # feature|refactor|fix|chore
25
- change_budget:
26
- max_files: 25
27
- max_loc: 1000
28
- scope:
29
- in: ["src/", "tests/"]
30
- out: ["node_modules/", "dist/"]
31
- ```
32
-
33
- **Always validate working specs:**
34
- ```bash
35
- caws validate .caws/working-spec.yaml
36
- ```
37
-
38
- ## Quality Assurance Workflow
39
-
40
- ### 1. Pre-Implementation
41
- ```
42
- # Get CAWS guidance before starting
43
- caws agent iterate --current-state "About to implement X"
44
-
45
- # CAWS will provide:
46
- # - Implementation suggestions
47
- # - Quality requirements
48
- # - Risk considerations
49
- ```
50
-
51
- ### 2. During Implementation
52
- ```
53
- # Regular quality checks
54
- caws agent evaluate --quiet
55
-
56
- # Address any issues immediately
57
- # Create waivers only when justified
58
- caws waivers create --reason emergency_hotfix --gates coverage_threshold
59
- ```
60
-
61
- ### 3. Pre-Commit Validation
62
- ```
63
- # Comprehensive validation before commits
64
- caws validate
65
- caws agent evaluate
66
-
67
- # Fix any quality gate failures
68
- ```
69
-
70
- ## CAWS Quality Gates
71
-
72
- ### Code Quality Gates
73
- - **Linting**: ESLint, Prettier formatting
74
- - **Type Checking**: TypeScript strict mode
75
- - **Security**: Dependency scanning, secret detection
76
- - **Performance**: Bundle size, runtime budgets
77
-
78
- ### Testing Gates
79
- - **Unit Tests**: Individual component testing
80
- - **Integration Tests**: Component interaction
81
- - **Contract Tests**: API contract validation
82
- - **E2E Tests**: Full workflow testing
83
- - **Mutation Tests**: Test effectiveness validation
84
-
85
- ### Analysis Gates
86
- - **Accessibility**: WCAG 2.1 AA compliance
87
- - **Complexity**: Maintainability metrics
88
- - **Coverage**: Test coverage thresholds
89
-
90
- ## Waiver Management
91
-
92
- **Create waivers only for justified exceptions:**
93
-
94
- ```bash
95
- # Example: Emergency security fix
96
- caws waivers create \
97
- --title "Critical security vulnerability fix" \
98
- --reason emergency_hotfix \
99
- --gates coverage_threshold,contract_tests \
100
- --expires-at "2025-11-01T00:00:00Z" \
101
- --approved-by "security-team" \
102
- --impact-level critical \
103
- --mitigation-plan "Manual testing completed, security review passed"
104
- ```
105
-
106
- **Waiver reasons:**
107
- - `emergency_hotfix` - Critical production issues
108
- - `legacy_integration` - Third-party compatibility
109
- - `experimental_feature` - Sandbox/prototype code
110
- - `performance_critical` - Hot path optimizations
111
- - `infrastructure_limitation` - Platform constraints
112
-
113
- ## Scope Management
114
-
115
- **Respect CAWS-defined scope boundaries:**
116
-
117
- - **In scope**: Files listed in `scope.in` - full quality requirements apply
118
- - **Out of scope**: Files in `scope.out` - no CAWS restrictions
119
- - **Scope warnings**: Files outside primary scope but allowed
120
-
121
- **Check scope compliance:**
122
- ```bash
123
- caws validate --scope-check path/to/file.js
124
- ```
125
-
126
- ## Risk Tier Considerations
127
-
128
- ### Tier 1 (Critical) - Highest Quality Standards
129
- - 90%+ test coverage
130
- - All security scans pass
131
- - Performance budgets strictly enforced
132
- - Manual review required
133
- - Zero waivers allowed for core gates
134
-
135
- ### Tier 2 (Standard) - Balanced Quality
136
- - 80%+ test coverage
137
- - Security scans pass
138
- - Performance budgets monitored
139
- - Peer review recommended
140
- - Limited waivers allowed
141
-
142
- ### Tier 3 (Low Risk) - Flexible Development
143
- - 70%+ test coverage
144
- - Basic security checks
145
- - Relaxed performance budgets
146
- - Self-review acceptable
147
- - Waivers freely allowed
148
-
149
- ## Common Patterns
150
-
151
- ### Feature Development
152
- 1. Update working spec with feature requirements
153
- 2. Get CAWS implementation guidance
154
- 3. Implement with regular quality checks
155
- 4. Create comprehensive tests
156
- 5. Validate all quality gates pass
157
- 6. Generate provenance report
158
-
159
- ### Bug Fixes
160
- 1. Assess risk tier and impact
161
- 2. Create minimal reproduction
162
- 3. Implement fix with tests
163
- 4. Run quality validation
164
- 5. Create waiver if emergency fix
165
- 6. Update working spec if scope changes
166
-
167
- ### Refactoring
168
- 1. Establish baseline quality metrics
169
- 2. Create refactoring plan
170
- 3. Implement changes incrementally
171
- 4. Maintain test suite passing
172
- 5. Run comprehensive validation
173
- 6. Update documentation
174
-
175
- ## Error Handling
176
-
177
- ### Quality Gate Failures
178
- ```
179
- โŒ CAWS validation failed
180
- โœ… Solution: Run caws validate --suggestions
181
- โœ… Fix identified issues
182
- โœ… Re-run validation
183
- ```
184
-
185
- ### Scope Violations
186
- ```
187
- โŒ File outside CAWS scope
188
- โœ… Solution: Update .caws/working-spec.yaml scope
189
- โœ… Or create waiver if justified
190
- ```
191
-
192
- ### Waiver Required
193
- ```
194
- โš ๏ธ High-risk change detected
195
- โœ… Solution: caws waivers create with justification
196
- โœ… Include mitigation plan
197
- โœ… Get appropriate approval
198
- ```
199
-
200
- ## Best Practices
201
-
202
- ### Code Quality
203
- - Follow established patterns and conventions
204
- - Write comprehensive tests with new code
205
- - Maintain existing test coverage
206
- - Address linting issues immediately
207
-
208
- ### Documentation
209
- - Update working specs when requirements change
210
- - Document waiver justifications thoroughly
211
- - Keep provenance records current
212
- - Update API documentation for public interfaces
213
-
214
- ### Collaboration
215
- - Communicate waiver needs early
216
- - Share quality gate results with team
217
- - Review high-risk changes together
218
- - Maintain collective code ownership
219
-
220
- ### Performance
221
- - Monitor performance budgets during development
222
- - Optimize hot paths identified by CAWS
223
- - Address performance regressions immediately
224
- - Include performance tests for critical paths
225
-
226
- ## Emergency Procedures
227
-
228
- ### Production Hotfix
229
- 1. Assess severity and business impact
230
- 2. Create emergency waiver immediately
231
- 3. Implement minimal fix with safety measures
232
- 4. Add comprehensive tests post-fix
233
- 5. Schedule follow-up quality improvements
234
-
235
- ### Security Vulnerability
236
- 1. Create critical waiver with security approval
237
- 2. Implement minimal security fix
238
- 3. Add security tests and monitoring
239
- 4. Conduct security review
240
- 5. Plan comprehensive fix for next release
241
-
242
- ## Integration with Other Tools
243
-
244
- ### Git Workflow
245
- - Pre-commit hooks run fast CAWS checks
246
- - Pre-push hooks run comprehensive validation
247
- - Post-commit hooks update provenance
248
- - Branch protection requires CAWS validation
249
-
250
- ### CI/CD Pipeline
251
- - Automated CAWS quality gates
252
- - Tier-based conditional execution
253
- - Waiver validation and auditing
254
- - Provenance report generation
255
-
256
- ### IDE Integration
257
- - Real-time quality feedback
258
- - Scope boundary enforcement
259
- - Automatic waiver suggestions
260
- - Quality dashboard visualization
261
-
262
- ## Troubleshooting
263
-
264
- ### CAWS CLI Issues
265
- ```bash
266
- # Check installation
267
- caws --version
268
-
269
- # Update to latest version
270
- npm install -g @caws/cli@latest
271
-
272
- # Check working spec syntax
273
- caws validate --suggestions
274
- ```
275
-
276
- ### Quality Gate Failures
277
- ```bash
278
- # Get detailed feedback
279
- caws agent evaluate
280
-
281
- # Check specific gate
282
- caws validate --gate linting
283
-
284
- # View waiver options
285
- caws waivers list --expiring-soon
286
- ```
287
-
288
- ### Performance Issues
289
- ```bash
290
- # Skip heavy checks for urgent fixes
291
- caws validate --skip performance,mutation
292
-
293
- # Run fast checks only
294
- caws agent evaluate --quick
295
- ```
296
-
297
- ## Support
298
-
299
- ### Getting Help
300
- - Run `caws --help` for command reference
301
- - Check `caws validate --suggestions` for specific issues
302
- - Review working spec documentation
303
- - Consult team CAWS guidelines
304
-
305
- ### Common Issues
306
- - **Working spec invalid**: Fix YAML syntax and required fields
307
- - **Scope violations**: Update scope or create waiver
308
- - **Quality gate failures**: Address root cause, don't just waive
309
- - **Performance regressions**: Optimize or adjust budgets
310
-
311
- Remember: CAWS is designed to maintain quality while enabling development velocity. Use waivers judiciously and always prioritize code quality and security.