@paths.design/caws-cli 7.0.3 → 8.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 (59) hide show
  1. package/dist/budget-derivation.d.ts.map +1 -1
  2. package/dist/commands/diagnose.d.ts.map +1 -1
  3. package/dist/commands/init.d.ts.map +1 -1
  4. package/dist/commands/provenance.d.ts +1 -1
  5. package/dist/commands/provenance.d.ts.map +1 -1
  6. package/dist/commands/quality-gates.d.ts +0 -46
  7. package/dist/commands/quality-gates.d.ts.map +1 -1
  8. package/dist/commands/quality-gates.js +226 -11
  9. package/dist/commands/specs.d.ts.map +1 -1
  10. package/dist/commands/specs.js +108 -13
  11. package/dist/commands/status.d.ts.map +1 -1
  12. package/dist/commands/templates.d.ts.map +1 -1
  13. package/dist/commands/tool.d.ts +1 -1
  14. package/dist/commands/tool.d.ts.map +1 -1
  15. package/dist/commands/tool.js +0 -1
  16. package/dist/commands/validate.d.ts.map +1 -1
  17. package/dist/commands/waivers.d.ts +1 -1
  18. package/dist/commands/waivers.d.ts.map +1 -1
  19. package/dist/config/index.d.ts.map +1 -1
  20. package/dist/generators/working-spec.d.ts.map +1 -1
  21. package/dist/index.js +10 -0
  22. package/dist/policy/PolicyManager.d.ts.map +1 -1
  23. package/dist/scaffold/cursor-hooks.d.ts.map +1 -1
  24. package/dist/scaffold/git-hooks.d.ts +18 -0
  25. package/dist/scaffold/git-hooks.d.ts.map +1 -1
  26. package/dist/scaffold/git-hooks.js +159 -58
  27. package/dist/scaffold/index.d.ts +1 -6
  28. package/dist/scaffold/index.d.ts.map +1 -1
  29. package/dist/scaffold/index.js +1 -1
  30. package/dist/templates/.caws/tools/README.md +1 -0
  31. package/dist/tool-loader.d.ts.map +1 -1
  32. package/dist/tool-validator.d.ts.map +1 -1
  33. package/dist/utils/async-utils.d.ts +73 -0
  34. package/dist/utils/async-utils.d.ts.map +1 -0
  35. package/dist/utils/command-wrapper.d.ts +66 -0
  36. package/dist/utils/command-wrapper.d.ts.map +1 -0
  37. package/dist/utils/detection.d.ts +7 -0
  38. package/dist/utils/detection.d.ts.map +1 -1
  39. package/dist/utils/git-lock.d.ts +13 -0
  40. package/dist/utils/git-lock.d.ts.map +1 -0
  41. package/dist/utils/git-lock.js +1 -0
  42. package/dist/utils/gitignore-updater.d.ts +39 -0
  43. package/dist/utils/gitignore-updater.d.ts.map +1 -0
  44. package/dist/utils/project-analysis.d.ts +20 -0
  45. package/dist/utils/project-analysis.d.ts.map +1 -1
  46. package/dist/utils/project-analysis.js +176 -16
  47. package/dist/utils/promise-utils.d.ts +30 -0
  48. package/dist/utils/promise-utils.d.ts.map +1 -0
  49. package/dist/utils/quality-gates.d.ts.map +1 -1
  50. package/dist/utils/quality-gates.js +7 -6
  51. package/dist/utils/spec-resolver.d.ts +1 -9
  52. package/dist/utils/spec-resolver.d.ts.map +1 -1
  53. package/dist/utils/spec-resolver.js +4 -0
  54. package/dist/utils/yaml-validation.d.ts +32 -0
  55. package/dist/utils/yaml-validation.d.ts.map +1 -0
  56. package/dist/utils/yaml-validation.js +1 -0
  57. package/dist/validation/spec-validation.d.ts.map +1 -1
  58. package/package.json +1 -1
  59. package/templates/.caws/tools/README.md +1 -0
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Update .gitignore to include CAWS runtime file exclusions
3
+ * @param {string} projectRoot - Project root directory
4
+ * @param {Object} options - Options
5
+ * @param {boolean} options.force - Force update even if entries exist
6
+ * @returns {Promise<boolean>} Whether .gitignore was updated
7
+ */
8
+ export function updateGitignore(projectRoot: string, options?: {
9
+ force: boolean;
10
+ }): Promise<boolean>;
11
+ /**
12
+ * Verify .gitignore has proper CAWS entries
13
+ * @param {string} projectRoot - Project root directory
14
+ * @returns {Promise<boolean>} Whether .gitignore has CAWS entries
15
+ */
16
+ export function verifyGitignore(projectRoot: string): Promise<boolean>;
17
+ /**
18
+ * CAWS .gitignore entries
19
+ *
20
+ * Strategy: Track shared/collaborative files, ignore local-only runtime data
21
+ *
22
+ * TRACKED (shared with team):
23
+ * - .caws/working-spec.yaml (main spec)
24
+ * - .caws/specs/*.yaml (feature specs)
25
+ * - .caws/policy.yaml (team policy)
26
+ * - .caws/waivers/*.yaml (project-wide waivers)
27
+ * - .caws/provenance/ (audit trails for compliance)
28
+ * - .caws/changes/ (change tracking for team visibility)
29
+ * - .caws/archive/ (archived changes for history)
30
+ * - .caws/plans/*.md (implementation plans)
31
+ *
32
+ * IGNORED (local-only):
33
+ * - .agent/ (agent runtime tracking, local to each developer)
34
+ * - Temporary files (*.tmp, *.bak)
35
+ * - Logs (caws.log, debug logs)
36
+ * - Local overrides (caws.local.*)
37
+ */
38
+ export const CAWS_GITIGNORE_ENTRIES: "\n# CAWS Local Runtime Data (developer-specific, should not be tracked)\n# ====================================================================\n# Note: Specs, policy, waivers, provenance, and plans ARE tracked for team collaboration\n# Only local agent tracking, generated tools, and temporary files are ignored\n\n# Agent runtime tracking (local to each developer)\n.agent/\n\n# CAWS tools (now in .caws/tools/)\n.caws/tools/\n# Legacy location (for backward compatibility)\napps/tools/caws/\n\n# Temporary CAWS files\n**/*.caws.tmp\n**/*.working-spec.bak\n.caws/*.tmp\n.caws/*.bak\n\n# CAWS logs (local debugging)\ncaws-debug.log*\n**/caws.log\n.caws/*.log\n\n# Local development overrides (developer-specific)\ncaws.local.*\n.caws/local.*\n";
39
+ //# sourceMappingURL=gitignore-updater.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitignore-updater.d.ts","sourceRoot":"","sources":["../../src/utils/gitignore-updater.js"],"names":[],"mappings":"AA6DA;;;;;;GAMG;AACH,6CALW,MAAM,YAEd;IAAyB,KAAK,EAAtB,OAAO;CACf,GAAU,OAAO,CAAC,OAAO,CAAC,CA2D5B;AAED;;;;GAIG;AACH,6CAHW,MAAM,GACJ,OAAO,CAAC,OAAO,CAAC,CAW5B;AAnID;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,gxBA4BE"}
@@ -11,4 +11,24 @@ export function detectProjectType(cwd?: string): string;
11
11
  * @returns {boolean} Whether to init in current directory
12
12
  */
13
13
  export function shouldInitInCurrentDirectory(projectName: string, currentDir: string): boolean;
14
+ /**
15
+ * Detect if project publishes packages to registries
16
+ * Checks for publishing configuration in package.json, pyproject.toml, etc.
17
+ * @param {string} cwd - Current working directory
18
+ * @returns {boolean} Whether project appears to publish packages
19
+ */
20
+ export function detectsPublishing(cwd?: string): boolean;
21
+ /**
22
+ * Detect primary programming language(s) used in project
23
+ * @param {string} cwd - Current working directory
24
+ * @returns {Object} Language detection result with primary language and indicators
25
+ */
26
+ export function detectProjectLanguage(cwd?: string): any;
27
+ /**
28
+ * Get language-agnostic suggestion for TODO analyzer installation
29
+ * Focuses on runtime availability (Node.js/npx) rather than project language
30
+ * @param {string} cwd - Current working directory
31
+ * @returns {string} Installation suggestion message
32
+ */
33
+ export function getTodoAnalyzerSuggestion(cwd?: string): string;
14
34
  //# sourceMappingURL=project-analysis.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"project-analysis.d.ts","sourceRoot":"","sources":["../../src/utils/project-analysis.js"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wCAHW,MAAM,GACJ,MAAM,CAmDlB;AAED;;;;;GAKG;AACH,0DAJW,MAAM,cACN,MAAM,GACJ,OAAO,CA8BnB"}
1
+ {"version":3,"file":"project-analysis.d.ts","sourceRoot":"","sources":["../../src/utils/project-analysis.js"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wCAHW,MAAM,GACJ,MAAM,CAmDlB;AAED;;;;;GAKG;AACH,0DAJW,MAAM,cACN,MAAM,GACJ,OAAO,CA8BnB;AAED;;;;;GAKG;AACH,wCAHW,MAAM,GACJ,OAAO,CAsFnB;AAED;;;;GAIG;AACH,4CAHW,MAAM,OAiHhB;AAED;;;;;GAKG;AACH,gDAHW,MAAM,GACJ,MAAM,CA6ClB"}
@@ -111,9 +111,7 @@ function detectsPublishing(cwd = process.cwd()) {
111
111
  // Check package.json for npm publishing
112
112
  if (files.includes('package.json')) {
113
113
  try {
114
- const packageJson = JSON.parse(
115
- fs.readFileSync(path.join(cwd, 'package.json'), 'utf8')
116
- );
114
+ const packageJson = JSON.parse(fs.readFileSync(path.join(cwd, 'package.json'), 'utf8'));
117
115
 
118
116
  // Indicators of publishing:
119
117
  // - Has publishConfig
@@ -123,9 +121,7 @@ function detectsPublishing(cwd = process.cwd()) {
123
121
  const hasPublishConfig = packageJson.publishConfig;
124
122
  const hasPublishScript =
125
123
  packageJson.scripts &&
126
- Object.keys(packageJson.scripts).some((key) =>
127
- key.toLowerCase().includes('publish')
128
- );
124
+ Object.keys(packageJson.scripts).some((key) => key.toLowerCase().includes('publish'));
129
125
  const hasScopedName = packageJson.name && packageJson.name.startsWith('@');
130
126
  const hasRepository = packageJson.repository;
131
127
 
@@ -140,16 +136,13 @@ function detectsPublishing(cwd = process.cwd()) {
140
136
  // Check pyproject.toml for PyPI publishing
141
137
  if (files.includes('pyproject.toml')) {
142
138
  try {
143
- const pyprojectContent = fs.readFileSync(
144
- path.join(cwd, 'pyproject.toml'),
145
- 'utf8'
146
- );
139
+ const pyprojectContent = fs.readFileSync(path.join(cwd, 'pyproject.toml'), 'utf8');
147
140
 
148
141
  // Check for build system and project metadata (indicates publishable package)
149
142
  const hasBuildSystem = pyprojectContent.includes('[build-system]');
150
143
  const hasProjectMetadata = pyprojectContent.includes('[project]');
151
- const hasToolPublish = pyprojectContent.includes('[tool.publish]') ||
152
- pyprojectContent.includes('[tool.twine]');
144
+ const hasToolPublish =
145
+ pyprojectContent.includes('[tool.publish]') || pyprojectContent.includes('[tool.twine]');
153
146
 
154
147
  if ((hasBuildSystem && hasProjectMetadata) || hasToolPublish) {
155
148
  return true;
@@ -177,10 +170,7 @@ function detectsPublishing(cwd = process.cwd()) {
177
170
  const workflowFiles = fs.readdirSync(workflowsPath);
178
171
  for (const workflowFile of workflowFiles) {
179
172
  if (workflowFile.endsWith('.yml') || workflowFile.endsWith('.yaml')) {
180
- const workflowContent = fs.readFileSync(
181
- path.join(workflowsPath, workflowFile),
182
- 'utf8'
183
- );
173
+ const workflowContent = fs.readFileSync(path.join(workflowsPath, workflowFile), 'utf8');
184
174
  // Check for common publishing actions/commands
185
175
  if (
186
176
  workflowContent.includes('npm publish') ||
@@ -201,8 +191,178 @@ function detectsPublishing(cwd = process.cwd()) {
201
191
  return false;
202
192
  }
203
193
 
194
+ /**
195
+ * Detect primary programming language(s) used in project
196
+ * @param {string} cwd - Current working directory
197
+ * @returns {Object} Language detection result with primary language and indicators
198
+ */
199
+ function detectProjectLanguage(cwd = process.cwd()) {
200
+ const files = fs.readdirSync(cwd);
201
+ const indicators = {
202
+ javascript: false,
203
+ typescript: false,
204
+ python: false,
205
+ rust: false,
206
+ go: false,
207
+ java: false,
208
+ csharp: false,
209
+ php: false,
210
+ };
211
+
212
+ // JavaScript/TypeScript indicators
213
+ if (files.includes('package.json')) {
214
+ indicators.javascript = true;
215
+ try {
216
+ const packageJson = JSON.parse(fs.readFileSync(path.join(cwd, 'package.json'), 'utf8'));
217
+ const allDeps = {
218
+ ...(packageJson.dependencies || {}),
219
+ ...(packageJson.devDependencies || {}),
220
+ };
221
+ if ('typescript' in allDeps || files.includes('tsconfig.json')) {
222
+ indicators.typescript = true;
223
+ indicators.javascript = false; // TypeScript supersedes JavaScript
224
+ }
225
+ } catch (e) {
226
+ // Ignore parse errors
227
+ }
228
+ }
229
+
230
+ // Python indicators
231
+ if (
232
+ files.includes('requirements.txt') ||
233
+ files.includes('pyproject.toml') ||
234
+ files.includes('setup.py') ||
235
+ files.includes('Pipfile') ||
236
+ files.includes('poetry.lock') ||
237
+ files.some((f) => f.endsWith('.py'))
238
+ ) {
239
+ indicators.python = true;
240
+ }
241
+
242
+ // Rust indicators
243
+ if (files.includes('Cargo.toml') || files.some((f) => f.endsWith('.rs'))) {
244
+ indicators.rust = true;
245
+ }
246
+
247
+ // Go indicators
248
+ if (
249
+ files.includes('go.mod') ||
250
+ files.includes('go.sum') ||
251
+ files.some((f) => f.endsWith('.go'))
252
+ ) {
253
+ indicators.go = true;
254
+ }
255
+
256
+ // Java indicators
257
+ if (
258
+ files.includes('pom.xml') ||
259
+ files.includes('build.gradle') ||
260
+ files.some((f) => f.endsWith('.java'))
261
+ ) {
262
+ indicators.java = true;
263
+ }
264
+
265
+ // C# indicators
266
+ if (
267
+ files.some((f) => f.endsWith('.csproj')) ||
268
+ files.some((f) => f.endsWith('.sln')) ||
269
+ files.some((f) => f.endsWith('.cs'))
270
+ ) {
271
+ indicators.csharp = true;
272
+ }
273
+
274
+ // PHP indicators
275
+ if (
276
+ files.includes('composer.json') ||
277
+ files.includes('composer.lock') ||
278
+ files.some((f) => f.endsWith('.php'))
279
+ ) {
280
+ indicators.php = true;
281
+ }
282
+
283
+ // Determine primary language (priority order)
284
+ let primaryLanguage = 'unknown';
285
+ if (indicators.typescript) {
286
+ primaryLanguage = 'typescript';
287
+ } else if (indicators.javascript) {
288
+ primaryLanguage = 'javascript';
289
+ } else if (indicators.python) {
290
+ primaryLanguage = 'python';
291
+ } else if (indicators.rust) {
292
+ primaryLanguage = 'rust';
293
+ } else if (indicators.go) {
294
+ primaryLanguage = 'go';
295
+ } else if (indicators.java) {
296
+ primaryLanguage = 'java';
297
+ } else if (indicators.csharp) {
298
+ primaryLanguage = 'csharp';
299
+ } else if (indicators.php) {
300
+ primaryLanguage = 'php';
301
+ }
302
+
303
+ return {
304
+ primary: primaryLanguage,
305
+ indicators,
306
+ hasNodeJs: indicators.javascript || indicators.typescript,
307
+ hasPython: indicators.python,
308
+ };
309
+ }
310
+
311
+ /**
312
+ * Get language-agnostic suggestion for TODO analyzer installation
313
+ * Focuses on runtime availability (Node.js/npx) rather than project language
314
+ * @param {string} cwd - Current working directory
315
+ * @returns {string} Installation suggestion message
316
+ */
317
+ function getTodoAnalyzerSuggestion(cwd = process.cwd()) {
318
+ // Check runtime availability (language-agnostic)
319
+ let hasNodeJs = false;
320
+ let hasNpx = false;
321
+ try {
322
+ const { execSync } = require('child_process');
323
+ execSync('command -v node', { encoding: 'utf8', stdio: 'ignore' });
324
+ hasNodeJs = true;
325
+ execSync('command -v npx', { encoding: 'utf8', stdio: 'ignore' });
326
+ hasNpx = true;
327
+ } catch (e) {
328
+ // Node.js/npx not available
329
+ }
330
+
331
+ const suggestions = [];
332
+
333
+ if (hasNpx) {
334
+ // npx available - works for any language, no installation needed
335
+ suggestions.push(
336
+ ' • Use npx (no installation required): npx --yes @paths.design/quality-gates'
337
+ );
338
+ suggestions.push(' • Install package: npm install --save-dev @paths.design/quality-gates');
339
+ } else if (hasNodeJs) {
340
+ // Node.js available but npx not found (unusual)
341
+ suggestions.push(' • Install package: npm install --save-dev @paths.design/quality-gates');
342
+ suggestions.push(
343
+ ' • Install npx: npm install -g npx (then use: npx --yes @paths.design/quality-gates)'
344
+ );
345
+ } else {
346
+ // Node.js not available - suggest installation
347
+ suggestions.push(
348
+ ' • Install Node.js: https://nodejs.org/ (then use: npx --yes @paths.design/quality-gates)'
349
+ );
350
+ suggestions.push(' • Use CAWS MCP server: caws quality-gates (via MCP)');
351
+ }
352
+
353
+ // Check for project-specific scripts (language-agnostic - if they exist, suggest them)
354
+ const pythonScript = path.join(cwd, 'scripts', 'v3', 'analysis', 'todo_analyzer.py');
355
+ if (fs.existsSync(pythonScript)) {
356
+ suggestions.push(` • Use project script: python3 ${pythonScript}`);
357
+ }
358
+
359
+ return suggestions.join('\n');
360
+ }
361
+
204
362
  module.exports = {
205
363
  detectProjectType,
206
364
  shouldInitInCurrentDirectory,
207
365
  detectsPublishing,
366
+ detectProjectLanguage,
367
+ getTodoAnalyzerSuggestion,
208
368
  };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @fileoverview Promise Utilities
3
+ * Utilities for converting callback-based APIs to promises
4
+ * @author @darianrosebrook
5
+ */
6
+ /**
7
+ * Convert readline question to promise
8
+ * @param {readline.Interface} rl - Readline interface
9
+ * @param {string} question - Question to ask
10
+ * @returns {Promise<string>} User's answer
11
+ */
12
+ export function question(rl: readline.Interface, questionText: any): Promise<string>;
13
+ /**
14
+ * Close readline interface and return promise
15
+ * @param {readline.Interface} rl - Readline interface
16
+ * @returns {Promise<void>}
17
+ */
18
+ export function closeReadline(rl: readline.Interface): Promise<void>;
19
+ /**
20
+ * Create a promise that resolves when event fires
21
+ * @param {EventEmitter} emitter - Event emitter
22
+ * @param {string} event - Event name
23
+ * @param {Object} options - Options
24
+ * @param {number} [options.timeout] - Timeout in ms
25
+ * @returns {Promise<any>} Event data
26
+ */
27
+ export function once(emitter: EventEmitter, event: string, options?: {
28
+ timeout?: number;
29
+ }): Promise<any>;
30
+ //# sourceMappingURL=promise-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promise-utils.d.ts","sourceRoot":"","sources":["../../src/utils/promise-utils.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,6BAJW,QAAQ,CAAC,SAAS,sBAEhB,OAAO,CAAC,MAAM,CAAC,CAQ3B;AAED;;;;GAIG;AACH,kCAHW,QAAQ,CAAC,SAAS,GAChB,OAAO,CAAC,IAAI,CAAC,CAOzB;AAED;;;;;;;GAOG;AACH,8BANW,YAAY,SACZ,MAAM,YAEd;IAAyB,OAAO,GAAxB,MAAM;CACd,GAAU,OAAO,CAAC,GAAG,CAAC,CAyBxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"quality-gates.d.ts","sourceRoot":"","sources":["../../src/utils/quality-gates.js"],"names":[],"mappings":"AAyGA;;;GAGG;AACH,kCAFa,MAAM,EAAE,CAcpB;AAED;;;;;GAKG;AACH,6CAJW,MAAM,EAAE,aACR,MAAM,OAqDhB;AAED;;;;GAIG;AACH,8CAHW,MAAM,EAAE,OA2ClB;AApMD;;;;GAIG;AACH,kCAHW,MAAM,OAiChB;AAED;;;GAGG;AACH,oCAFa,OAAO,CAkCnB;AA6HD;;;;GAIG;AACH,oDAqHC"}
1
+ {"version":3,"file":"quality-gates.d.ts","sourceRoot":"","sources":["../../src/utils/quality-gates.js"],"names":[],"mappings":"AA0GA;;;GAGG;AACH,kCAFa,MAAM,EAAE,CAcpB;AAED;;;;;GAKG;AACH,6CAJW,MAAM,EAAE,aACR,MAAM,OAqDhB;AAED;;;;GAIG;AACH,8CAHW,MAAM,EAAE,OAmFlB;AA5OD;;;;GAIG;AACH,kCAHW,MAAM,OAiChB;AAED;;;GAGG;AACH,oCAFa,OAAO,CAkCnB;AAqKD;;;;GAIG;AACH,oDAqHC"}
@@ -11,6 +11,7 @@ const fs = require('fs');
11
11
  const path = require('path');
12
12
  const yaml = require('js-yaml');
13
13
  const { execSync } = require('child_process');
14
+ const { getTodoAnalyzerSuggestion } = require('./project-analysis');
14
15
 
15
16
  /**
16
17
  * Quality Gate Configuration
@@ -229,17 +230,17 @@ function checkHiddenTodos(stagedFiles) {
229
230
 
230
231
  if (!analyzerPath) {
231
232
  console.warn('⚠️ TODO analyzer not found - skipping TODO analysis');
232
- console.warn(
233
- '💡 Install @paths.design/quality-gates: npm install --save-dev @paths.design/quality-gates'
234
- );
233
+ const suggestion = getTodoAnalyzerSuggestion(process.cwd());
234
+ console.warn('💡 Available options for TODO analysis:');
235
+ console.warn(suggestion);
235
236
  return { todos: [], blocking: 0, total: 0 };
236
237
  }
237
238
 
238
239
  if (usePython) {
239
240
  console.warn('⚠️ Using legacy Python TODO analyzer (deprecated)');
240
- console.warn(
241
- '💡 Install @paths.design/quality-gates for Node.js version: npm install --save-dev @paths.design/quality-gates'
242
- );
241
+ const suggestion = getTodoAnalyzerSuggestion(process.cwd());
242
+ console.warn('💡 Consider upgrading to Node.js version:');
243
+ console.warn(suggestion);
243
244
  }
244
245
 
245
246
  // Run the TODO analyzer with staged files
@@ -61,15 +61,7 @@ export function interactiveSpecSelection(specIds: string[]): Promise<string>;
61
61
  * @returns {Promise<Object>} Registry data
62
62
  */
63
63
  export function loadSpecsRegistry(): Promise<any>;
64
- export function suggestFeatureBreakdown(legacySpec: any): {
65
- id: string;
66
- title: any;
67
- criteria: any;
68
- scope: {
69
- in: string[];
70
- out: any[];
71
- };
72
- }[];
64
+ export function suggestFeatureBreakdown(legacySpec: any): any[];
73
65
  /**
74
66
  * Check if two paths overlap (simplified implementation)
75
67
  * @param {string} path1 - First path
@@ -1 +1 @@
1
- {"version":3,"file":"spec-resolver.d.ts","sourceRoot":"","sources":["../../src/utils/spec-resolver.js"],"names":[],"mappings":"AAwBA;;;;;;;;GAQG;AACH,sCANG;IAAyB,MAAM,GAAvB,MAAM;IACW,QAAQ,GAAzB,MAAM;IACY,UAAU,GAA5B,OAAO;IACW,WAAW,GAA7B,OAAO;CACf,GAAU,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAAC,IAAI,MAAQ;CAAC,CAAC,CAwK7E;AA6BD;;;GAGG;AACH,sCAFa,OAAO,CAAC,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC,CAoDpE;AAgDD;;;GAGG;AACH,wCAFa,OAAO,CAAC;IAAC,WAAW,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAC,CAAC,CAavF;AAED;;;;GAIG;AACH,6CAHW,MAAM,EAAE,GACN,OAAO,CAAC,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAC,CAAC,CAAC,CA2D/E;AA+DD;;;GAGG;AACH,oCAFa,OAAO,CAAC,IAAI,CAAC,CAczB;AA5MD;;;;GAIG;AACH,kDAHW,MAAM,EAAE,GACN,OAAO,CAAC,MAAM,CAAC,CAyC3B;AA/HD;;;GAGG;AACH,qCAFa,OAAO,KAAQ,CAuB3B;AAyQD;;;;;;;;IA+FC;AA/KD;;;;;GAKG;AACH,oCAJW,MAAM,SACN,MAAM,GACJ,OAAO,CAuDnB;AAvcD;;;;GAIG;AACH,wBAAkB,aAAa,CAAC;AAChC,0BAAoB,yBAAyB,CAAC;AAC9C,6BAAuB,2BAA2B,CAAC"}
1
+ {"version":3,"file":"spec-resolver.d.ts","sourceRoot":"","sources":["../../src/utils/spec-resolver.js"],"names":[],"mappings":"AAwBA;;;;;;;;GAQG;AACH,sCANG;IAAyB,MAAM,GAAvB,MAAM;IACW,QAAQ,GAAzB,MAAM;IACY,UAAU,GAA5B,OAAO;IACW,WAAW,GAA7B,OAAO;CACf,GAAU,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAAC,IAAI,MAAQ;CAAC,CAAC,CA+K7E;AA6BD;;;GAGG;AACH,sCAFa,OAAO,CAAC,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC,CAoDpE;AAgDD;;;GAGG;AACH,wCAFa,OAAO,CAAC;IAAC,WAAW,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAC,CAAC,CAavF;AAED;;;;GAIG;AACH,6CAHW,MAAM,EAAE,GACN,OAAO,CAAC,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAC,CAAC,CAAC,CAwE/E;AA+DD;;;GAGG;AACH,oCAFa,OAAO,CAAC,IAAI,CAAC,CAczB;AAzND;;;;GAIG;AACH,kDAHW,MAAM,EAAE,GACN,OAAO,CAAC,MAAM,CAAC,CAyC3B;AA/HD;;;GAGG;AACH,qCAFa,OAAO,KAAQ,CAuB3B;AAsRD,gEAmGC;AAnLD;;;;;GAKG;AACH,oCAJW,MAAM,SACN,MAAM,GACJ,OAAO,CAuDnB;AA3dD;;;;GAIG;AACH,wBAAkB,aAAa,CAAC;AAChC,0BAAoB,yBAAyB,CAAC;AAC9C,6BAAuB,2BAA2B,CAAC"}
@@ -512,6 +512,10 @@ async function suggestMigration() {
512
512
  function suggestFeatureBreakdown(legacySpec) {
513
513
  const features = [];
514
514
 
515
+ if (!legacySpec) {
516
+ return features;
517
+ }
518
+
515
519
  if (legacySpec.acceptance && legacySpec.acceptance.length > 0) {
516
520
  // Group acceptance criteria by logical features
517
521
  const criteriaByFeature = {};
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Validate YAML syntax for a file
3
+ * @param {string} filePath - Path to YAML file
4
+ * @returns {Object} Validation result with valid flag and error details
5
+ */
6
+ export function validateYamlSyntax(filePath: string): any;
7
+ /**
8
+ * Validate YAML syntax for multiple files
9
+ * @param {string[]} filePaths - Array of file paths to validate
10
+ * @returns {Object} Validation results with summary
11
+ */
12
+ export function validateYamlFiles(filePaths: string[]): any;
13
+ /**
14
+ * Find all YAML files in .caws directory
15
+ * @param {string} projectRoot - Project root directory
16
+ * @returns {string[]} Array of YAML file paths
17
+ */
18
+ export function findCawsYamlFiles(projectRoot: string): string[];
19
+ /**
20
+ * Validate all CAWS YAML files in project
21
+ * @param {string} projectRoot - Project root directory
22
+ * @returns {Object} Validation results
23
+ */
24
+ export function validateAllCawsYamlFiles(projectRoot: string): any;
25
+ /**
26
+ * Format validation error for display
27
+ * @param {Object} error - Error object from validateYamlSyntax
28
+ * @param {string} filePath - File path
29
+ * @returns {string} Formatted error message
30
+ */
31
+ export function formatYamlError(error: any, filePath: string): string;
32
+ //# sourceMappingURL=yaml-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yaml-validation.d.ts","sourceRoot":"","sources":["../../src/utils/yaml-validation.js"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,6CAHW,MAAM,OA2BhB;AAED;;;;GAIG;AACH,6CAHW,MAAM,EAAE,OAgClB;AAED;;;;GAIG;AACH,+CAHW,MAAM,GACJ,MAAM,EAAE,CA6BpB;AAED;;;;GAIG;AACH,sDAHW,MAAM,OAMhB;AAED;;;;;GAKG;AACH,sDAHW,MAAM,GACJ,MAAM,CAoBlB"}
@@ -153,3 +153,4 @@ module.exports = {
153
153
  formatYamlError,
154
154
  };
155
155
 
156
+
@@ -1 +1 @@
1
- {"version":3,"file":"spec-validation.d.ts","sourceRoot":"","sources":["../../src/validation/spec-validation.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,mEA8HC;AAED;;;;;GAKG;AACH,kFAyWC;AAoCD;;;;;GAKG;AACH,0CAJW,MAAM,eAEJ,MAAM,CAkBlB;AAED;;;;;GAKG;AACH,uCAJW,MAAM,eAEJ,OAAO,CAKnB;AAnED;;;;;;GAMG;AACH,0EAFa,MAAM,CAclB;AAED;;;;GAIG;AACH,0CAHW,MAAM,GACJ,MAAM,CAQlB"}
1
+ {"version":3,"file":"spec-validation.d.ts","sourceRoot":"","sources":["../../src/validation/spec-validation.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,mEA8HC;AAED;;;;;GAKG;AACH,kFAgdC;AAoCD;;;;;GAKG;AACH,0CAJW,MAAM,eAEJ,MAAM,CAkBlB;AAED;;;;;GAKG;AACH,uCAJW,MAAM,eAEJ,OAAO,CAKnB;AAnED;;;;;;GAMG;AACH,0EAFa,MAAM,CAclB;AAED;;;;GAIG;AACH,0CAHW,MAAM,GACJ,MAAM,CAQlB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paths.design/caws-cli",
3
- "version": "7.0.3",
3
+ "version": "8.0.1",
4
4
  "description": "CAWS CLI - Coding Agent Workflow System command line tools",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -18,3 +18,4 @@ node .caws/tools/scope-guard.js check .caws/working-spec.yaml
18
18
 
19
19
  The `.cursor/hooks/scope-guard.sh` hook automatically uses this tool to validate file attachments against working spec scope boundaries.
20
20
 
21
+