@paths.design/caws-cli 7.0.1 → 7.0.3

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 (121) hide show
  1. package/dist/budget-derivation.js +5 -4
  2. package/dist/commands/diagnose.js +26 -20
  3. package/dist/commands/init.js +72 -5
  4. package/dist/commands/specs.js +40 -1
  5. package/dist/commands/status.js +2 -2
  6. package/dist/commands/templates.js +10 -0
  7. package/dist/commands/tool.js +2 -3
  8. package/dist/commands/validate.js +12 -0
  9. package/dist/config/index.js +17 -8
  10. package/dist/generators/working-spec.js +42 -9
  11. package/dist/index.js +3 -1
  12. package/dist/scaffold/cursor-hooks.js +10 -2
  13. package/dist/scaffold/git-hooks.js +189 -32
  14. package/dist/scaffold/index.js +105 -17
  15. package/dist/templates/.caws/tools/README.md +20 -0
  16. package/dist/templates/.cursor/README.md +311 -0
  17. package/dist/templates/.cursor/hooks/audit.sh +55 -0
  18. package/dist/templates/.cursor/hooks/block-dangerous.sh +83 -0
  19. package/dist/templates/.cursor/hooks/caws-quality-check.sh +52 -0
  20. package/dist/templates/.cursor/hooks/caws-scope-guard.sh +130 -0
  21. package/dist/templates/.cursor/hooks/caws-tool-validation.sh +121 -0
  22. package/dist/templates/.cursor/hooks/format.sh +38 -0
  23. package/dist/templates/.cursor/hooks/naming-check.sh +64 -0
  24. package/dist/templates/.cursor/hooks/scan-secrets.sh +46 -0
  25. package/dist/templates/.cursor/hooks/scope-guard.sh +52 -0
  26. package/dist/templates/.cursor/hooks/validate-spec.sh +83 -0
  27. package/dist/templates/.cursor/hooks.json +59 -0
  28. package/dist/templates/.cursor/rules/00-claims-verification.mdc +144 -0
  29. package/dist/templates/.cursor/rules/01-working-style.mdc +50 -0
  30. package/dist/templates/.cursor/rules/02-quality-gates.mdc +370 -0
  31. package/dist/templates/.cursor/rules/03-naming-and-refactor.mdc +33 -0
  32. package/dist/templates/.cursor/rules/04-logging-language-style.mdc +23 -0
  33. package/dist/templates/.cursor/rules/05-safe-defaults-guards.mdc +23 -0
  34. package/dist/templates/.cursor/rules/06-typescript-conventions.mdc +36 -0
  35. package/dist/templates/.cursor/rules/07-process-ops.mdc +20 -0
  36. package/dist/templates/.cursor/rules/08-solid-and-architecture.mdc +16 -0
  37. package/dist/templates/.cursor/rules/09-docstrings.mdc +89 -0
  38. package/dist/templates/.cursor/rules/10-documentation-quality-standards.mdc +390 -0
  39. package/dist/templates/.cursor/rules/11-scope-management-waivers.mdc +385 -0
  40. package/dist/templates/.cursor/rules/12-implementation-completeness.mdc +516 -0
  41. package/dist/templates/.cursor/rules/13-language-agnostic-standards.mdc +588 -0
  42. package/dist/templates/.cursor/rules/README.md +148 -0
  43. package/dist/templates/.github/copilot/instructions.md +311 -0
  44. package/dist/templates/.idea/runConfigurations/CAWS_Evaluate.xml +5 -0
  45. package/dist/templates/.idea/runConfigurations/CAWS_Validate.xml +5 -0
  46. package/dist/templates/.vscode/launch.json +56 -0
  47. package/dist/templates/.vscode/settings.json +93 -0
  48. package/dist/templates/.windsurf/workflows/caws-guided-development.md +92 -0
  49. package/dist/templates/COMMIT_CONVENTIONS.md +86 -0
  50. package/dist/templates/OIDC_SETUP.md +300 -0
  51. package/dist/templates/agents.md +1047 -0
  52. package/dist/templates/codemod/README.md +1 -0
  53. package/dist/templates/codemod/test.js +93 -0
  54. package/dist/templates/docs/README.md +150 -0
  55. package/dist/templates/scripts/quality-gates/check-god-objects.js +146 -0
  56. package/dist/templates/scripts/quality-gates/run-quality-gates.js +50 -0
  57. package/dist/templates/scripts/v3/analysis/todo_analyzer.py +1997 -0
  58. package/dist/tool-loader.js +6 -1
  59. package/dist/tool-validator.js +8 -2
  60. package/dist/utils/detection.js +34 -6
  61. package/dist/utils/git-lock.js +118 -0
  62. package/dist/utils/gitignore-updater.js +148 -0
  63. package/dist/utils/quality-gates.js +47 -7
  64. package/dist/utils/spec-resolver.js +23 -3
  65. package/dist/utils/yaml-validation.js +155 -0
  66. package/dist/validation/spec-validation.js +105 -2
  67. package/package.json +2 -2
  68. package/templates/.caws/schemas/waivers.schema.json +30 -0
  69. package/templates/.caws/schemas/working-spec.schema.json +133 -0
  70. package/templates/.caws/templates/working-spec.template.yml +74 -0
  71. package/templates/.caws/tools/README.md +20 -0
  72. package/templates/.caws/tools/scope-guard.js +208 -0
  73. package/templates/.caws/tools-allow.json +331 -0
  74. package/templates/.caws/waivers.yml +19 -0
  75. package/templates/.cursor/hooks/scope-guard.sh +2 -2
  76. package/templates/.cursor/hooks/validate-spec.sh +42 -7
  77. package/templates/apps/tools/caws/COMPLETION_REPORT.md +0 -331
  78. package/templates/apps/tools/caws/MIGRATION_SUMMARY.md +0 -360
  79. package/templates/apps/tools/caws/README.md +0 -463
  80. package/templates/apps/tools/caws/TEST_STATUS.md +0 -365
  81. package/templates/apps/tools/caws/attest.js +0 -357
  82. package/templates/apps/tools/caws/ci-optimizer.js +0 -642
  83. package/templates/apps/tools/caws/config.ts +0 -245
  84. package/templates/apps/tools/caws/cross-functional.js +0 -876
  85. package/templates/apps/tools/caws/dashboard.js +0 -1112
  86. package/templates/apps/tools/caws/flake-detector.ts +0 -362
  87. package/templates/apps/tools/caws/gates.js +0 -198
  88. package/templates/apps/tools/caws/gates.ts +0 -271
  89. package/templates/apps/tools/caws/language-adapters.ts +0 -381
  90. package/templates/apps/tools/caws/language-support.d.ts +0 -367
  91. package/templates/apps/tools/caws/language-support.d.ts.map +0 -1
  92. package/templates/apps/tools/caws/language-support.js +0 -585
  93. package/templates/apps/tools/caws/legacy-assessment.ts +0 -408
  94. package/templates/apps/tools/caws/legacy-assessor.js +0 -764
  95. package/templates/apps/tools/caws/mutant-analyzer.js +0 -734
  96. package/templates/apps/tools/caws/perf-budgets.ts +0 -349
  97. package/templates/apps/tools/caws/prompt-lint.js.backup +0 -274
  98. package/templates/apps/tools/caws/property-testing.js +0 -707
  99. package/templates/apps/tools/caws/provenance.d.ts +0 -14
  100. package/templates/apps/tools/caws/provenance.d.ts.map +0 -1
  101. package/templates/apps/tools/caws/provenance.js +0 -132
  102. package/templates/apps/tools/caws/provenance.js.backup +0 -73
  103. package/templates/apps/tools/caws/provenance.ts +0 -211
  104. package/templates/apps/tools/caws/security-provenance.ts +0 -483
  105. package/templates/apps/tools/caws/shared/base-tool.ts +0 -281
  106. package/templates/apps/tools/caws/shared/config-manager.ts +0 -366
  107. package/templates/apps/tools/caws/shared/gate-checker.ts +0 -849
  108. package/templates/apps/tools/caws/shared/types.ts +0 -444
  109. package/templates/apps/tools/caws/shared/validator.ts +0 -305
  110. package/templates/apps/tools/caws/shared/waivers-manager.ts +0 -174
  111. package/templates/apps/tools/caws/spec-test-mapper.ts +0 -391
  112. package/templates/apps/tools/caws/test-quality.js +0 -578
  113. package/templates/apps/tools/caws/validate.js +0 -76
  114. package/templates/apps/tools/caws/validate.ts +0 -228
  115. package/templates/apps/tools/caws/waivers.js +0 -344
  116. /package/{templates/apps/tools/caws → dist/templates/.caws}/schemas/waivers.schema.json +0 -0
  117. /package/{templates/apps/tools/caws → dist/templates/.caws}/schemas/working-spec.schema.json +0 -0
  118. /package/{templates/apps/tools/caws → dist/templates/.caws}/templates/working-spec.template.yml +0 -0
  119. /package/{templates/apps/tools/caws → dist/templates/.caws/tools}/scope-guard.js +0 -0
  120. /package/{templates/apps/tools/caws → dist/templates/.caws}/tools-allow.json +0 -0
  121. /package/{templates/apps/tools/caws → dist/templates/.caws}/waivers.yml +0 -0
@@ -1,245 +0,0 @@
1
- #!/usr/bin/env tsx
2
-
3
- /**
4
- * CAWS Configuration Management CLI
5
- *
6
- * Provides command-line interface for managing CAWS configuration
7
- * with YAML import/export, section management, and feature flags
8
- *
9
- * @author @darianrosebrook
10
- */
11
-
12
- import * as path from 'path';
13
- import { fileURLToPath } from 'url';
14
- import { CawsConfigManager } from './shared/config-manager.js';
15
- import { CawsConfig } from './shared/types.js';
16
-
17
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
18
-
19
- // CLI interface
20
- if (import.meta.url === `file://${process.argv[1]}`) {
21
- const command = process.argv[2];
22
- const configManager = new CawsConfigManager();
23
- let section: keyof CawsConfig;
24
- let key: string;
25
- let value: string;
26
-
27
- switch (command) {
28
- case 'get': {
29
- section = process.argv[3] as keyof CawsConfig;
30
- if (!section) {
31
- console.log(JSON.stringify(configManager.getConfig(), null, 2));
32
- } else {
33
- const configSection = configManager.getSection(section);
34
- if (configSection) {
35
- console.log(JSON.stringify(configSection, null, 2));
36
- } else {
37
- console.error(`❌ Section '${section}' not found`);
38
- process.exit(1);
39
- }
40
- }
41
- break;
42
- }
43
-
44
- case 'set': {
45
- key = process.argv[3];
46
- value = process.argv[4];
47
-
48
- if (!key || !value) {
49
- console.error('Usage: config set <key> <value>');
50
- console.error('Example: config set gates.coverage.enabled false');
51
- process.exit(1);
52
- }
53
-
54
- // Parse the key path and value
55
- const keyParts = key.split('.');
56
- let parsedValue: any;
57
- try {
58
- parsedValue = JSON.parse(value);
59
- } catch {
60
- parsedValue = value; // Use as string if not valid JSON
61
- }
62
-
63
- // Build the update object
64
- const update: any = {};
65
- let current = update;
66
- for (let i = 0; i < keyParts.length - 1; i++) {
67
- current[keyParts[i]] = {};
68
- current = current[keyParts[i]];
69
- }
70
- current[keyParts[keyParts.length - 1]] = parsedValue;
71
-
72
- const result = configManager.updateConfig(update);
73
- if (result.success) {
74
- console.log('✅ Configuration updated successfully');
75
- } else {
76
- console.error(`❌ Failed to update configuration: ${result.message}`);
77
- if (result.errors) {
78
- result.errors.forEach((error) => console.error(` ${error}`));
79
- }
80
- process.exit(1);
81
- }
82
- break;
83
- }
84
-
85
- case 'reset': {
86
- const resetResult = configManager.resetConfig();
87
- if (resetResult.success) {
88
- console.log('✅ Configuration reset to defaults');
89
- } else {
90
- console.error(`❌ Failed to reset configuration: ${resetResult.message}`);
91
- process.exit(1);
92
- }
93
- break;
94
- }
95
-
96
- case 'export': {
97
- const yamlOutput = configManager.exportAsYaml();
98
- if (yamlOutput) {
99
- console.log(yamlOutput);
100
- } else {
101
- console.error('❌ Failed to export configuration');
102
- process.exit(1);
103
- }
104
- break;
105
- }
106
-
107
- case 'import': {
108
- const filePath = process.argv[3];
109
- if (!filePath) {
110
- console.error('Usage: config import <file-path>');
111
- process.exit(1);
112
- }
113
-
114
- // Read YAML from file
115
- try {
116
- const fs = await import('fs');
117
- const yamlContent = fs.readFileSync(filePath, 'utf-8');
118
- const importResult = configManager.importFromYaml(yamlContent);
119
-
120
- if (importResult.success) {
121
- console.log('✅ Configuration imported successfully');
122
- } else {
123
- console.error(`❌ Failed to import configuration: ${importResult.message}`);
124
- if (importResult.errors) {
125
- importResult.errors.forEach((error) => console.error(` ${error}`));
126
- }
127
- process.exit(1);
128
- }
129
- } catch (error) {
130
- console.error(`❌ Failed to read file: ${error}`);
131
- process.exit(1);
132
- }
133
- break;
134
- }
135
-
136
- case 'load': {
137
- const loadPath = process.argv[3];
138
- if (!loadPath) {
139
- console.error('Usage: config load <file-path>');
140
- process.exit(1);
141
- }
142
-
143
- const loadResult = configManager.loadConfigFromFile(loadPath);
144
- if (loadResult.success) {
145
- console.log('✅ Configuration loaded from file');
146
- } else {
147
- console.error(`❌ Failed to load configuration: ${loadResult.message}`);
148
- process.exit(1);
149
- }
150
- break;
151
- }
152
-
153
- case 'save': {
154
- const savePath = process.argv[3];
155
- if (!savePath) {
156
- console.error('Usage: config save <file-path>');
157
- process.exit(1);
158
- }
159
-
160
- const saveResult = configManager.saveConfigToFile(savePath);
161
- if (saveResult.success) {
162
- console.log(`✅ Configuration saved to ${savePath}`);
163
- } else {
164
- console.error(`❌ Failed to save configuration: ${saveResult.message}`);
165
- process.exit(1);
166
- }
167
- break;
168
- }
169
-
170
- case 'features': {
171
- const features = configManager.getSection('features');
172
- if (features) {
173
- console.log('Enabled features:');
174
- Object.entries(features).forEach(([key, feature]) => {
175
- const enabled = typeof feature === 'boolean' ? feature : feature.enabled;
176
- console.log(` ${key}: ${enabled ? '✅' : '❌'}`);
177
- });
178
- } else {
179
- console.error('❌ No features configuration found');
180
- }
181
- break;
182
- }
183
-
184
- case 'paths': {
185
- const paths = configManager.getSection('paths');
186
- if (paths) {
187
- console.log('Configured paths:');
188
- Object.entries(paths).forEach(([key, pathValue]) => {
189
- console.log(` ${key}: ${pathValue}`);
190
- });
191
- } else {
192
- console.error('❌ No paths configuration found');
193
- }
194
- break;
195
- }
196
-
197
- case 'gates': {
198
- const gates = configManager.getSection('gates');
199
- if (gates) {
200
- console.log('Gate configurations:');
201
- Object.entries(gates).forEach(([gateName, config]) => {
202
- console.log(` ${gateName}: ${JSON.stringify(config, null, 2)}`);
203
- });
204
- } else {
205
- console.error('❌ No gates configuration found');
206
- }
207
- break;
208
- }
209
-
210
- case 'tools': {
211
- const tools = configManager.getSection('tools');
212
- if (tools) {
213
- console.log('Tool configurations:');
214
- Object.entries(tools).forEach(([toolName, config]) => {
215
- console.log(` ${toolName}: ${JSON.stringify(config, null, 2)}`);
216
- });
217
- } else {
218
- console.error('❌ No tools configuration found');
219
- }
220
- break;
221
- }
222
-
223
- default:
224
- console.log('CAWS Configuration Manager');
225
- console.log('');
226
- console.log('Usage:');
227
- console.log(' config get [section] - Get current configuration or specific section');
228
- console.log(' config set <key> <value> - Set a configuration value');
229
- console.log(' config reset - Reset configuration to defaults');
230
- console.log(' config export - Export configuration as YAML');
231
- console.log(' config import <file> - Import configuration from YAML file');
232
- console.log(' config load <file> - Load configuration from JSON file');
233
- console.log(' config save <file> - Save configuration to JSON file');
234
- console.log(' config features - Show enabled features');
235
- console.log(' config paths - Show configured paths');
236
- console.log(' config gates - Show gate configurations');
237
- console.log(' config tools - Show tool configurations');
238
- console.log('');
239
- console.log('Examples:');
240
- console.log(' config get gates');
241
- console.log(' config set gates.coverage.enabled false');
242
- console.log(' config import my-config.yaml');
243
- break;
244
- }
245
- }