@paths.design/caws-cli 8.2.1 ā 8.2.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.
- package/dist/budget-derivation.js +10 -10
- package/dist/commands/archive.js +22 -22
- package/dist/commands/burnup.js +7 -7
- package/dist/commands/diagnose.js +25 -25
- package/dist/commands/evaluate.js +20 -20
- package/dist/commands/init.js +71 -72
- package/dist/commands/iterate.js +21 -21
- package/dist/commands/mode.js +11 -11
- package/dist/commands/plan.js +5 -5
- package/dist/commands/provenance.js +86 -86
- package/dist/commands/quality-gates.js +3 -3
- package/dist/commands/quality-monitor.js +17 -17
- package/dist/commands/session.js +312 -0
- package/dist/commands/specs.js +44 -44
- package/dist/commands/status.js +43 -43
- package/dist/commands/templates.js +14 -14
- package/dist/commands/tool.js +1 -1
- package/dist/commands/troubleshoot.js +11 -11
- package/dist/commands/tutorial.js +119 -119
- package/dist/commands/validate.js +6 -6
- package/dist/commands/waivers.js +93 -60
- package/dist/commands/workflow.js +17 -17
- package/dist/commands/worktree.js +13 -13
- package/dist/config/index.js +5 -5
- package/dist/config/modes.js +7 -7
- package/dist/constants/spec-types.js +5 -5
- package/dist/error-handler.js +4 -4
- package/dist/generators/jest-config-generator.js +3 -3
- package/dist/generators/working-spec.js +4 -4
- package/dist/index.js +79 -27
- package/dist/minimal-cli.js +9 -9
- package/dist/policy/PolicyManager.js +1 -1
- package/dist/scaffold/claude-hooks.js +7 -7
- package/dist/scaffold/cursor-hooks.js +8 -8
- package/dist/scaffold/git-hooks.js +152 -152
- package/dist/scaffold/index.js +48 -48
- package/dist/session/session-manager.js +548 -0
- package/dist/test-analysis.js +20 -20
- package/dist/utils/command-wrapper.js +8 -8
- package/dist/utils/detection.js +7 -7
- package/dist/utils/finalization.js +21 -21
- package/dist/utils/git-lock.js +3 -3
- package/dist/utils/gitignore-updater.js +1 -1
- package/dist/utils/project-analysis.js +7 -7
- package/dist/utils/quality-gates-utils.js +35 -35
- package/dist/utils/spec-resolver.js +8 -8
- package/dist/utils/typescript-detector.js +5 -5
- package/dist/utils/yaml-validation.js +1 -1
- package/dist/validation/spec-validation.js +4 -4
- package/dist/worktree/worktree-manager.js +11 -5
- package/package.json +1 -1
package/dist/scaffold/index.js
CHANGED
|
@@ -216,16 +216,16 @@ async function scaffoldProject(options) {
|
|
|
216
216
|
|
|
217
217
|
// Check for CAWS setup immediately and exit with helpful message if not found
|
|
218
218
|
if (!setup.hasCAWSDir) {
|
|
219
|
-
console.log(chalk.red('
|
|
220
|
-
console.log(chalk.blue('\
|
|
219
|
+
console.log(chalk.red('CAWS not initialized in this project'));
|
|
220
|
+
console.log(chalk.blue('\nTo get started:'));
|
|
221
221
|
console.log(` 1. Initialize CAWS: ${chalk.cyan('caws init <project-name>')}`);
|
|
222
222
|
console.log(` 2. Or initialize in current directory: ${chalk.cyan('caws init .')}`);
|
|
223
|
-
console.log(chalk.blue('\
|
|
223
|
+
console.log(chalk.blue('\nFor more help:'));
|
|
224
224
|
console.log(` ${chalk.cyan('caws --help')}`);
|
|
225
225
|
process.exit(1);
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
console.log(chalk.cyan(
|
|
228
|
+
console.log(chalk.cyan(`Enhancing existing CAWS project: ${projectName}`));
|
|
229
229
|
|
|
230
230
|
// Preserve the original template directory from global cawsSetup
|
|
231
231
|
// (needed because detectCAWSSetup from within a new project won't find the template)
|
|
@@ -261,12 +261,12 @@ async function scaffoldProject(options) {
|
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
if (!setup.templateDir) {
|
|
264
|
-
console.log(chalk.red(
|
|
265
|
-
console.log(chalk.blue('
|
|
264
|
+
console.log(chalk.red(`No template directory available!`));
|
|
265
|
+
console.log(chalk.blue('To fix this issue:'));
|
|
266
266
|
console.log(` 1. Ensure caws-template package is installed`);
|
|
267
267
|
console.log(` 2. Run from the monorepo root directory`);
|
|
268
268
|
console.log(` 3. Check that CAWS CLI was installed correctly`);
|
|
269
|
-
console.log(chalk.blue('\
|
|
269
|
+
console.log(chalk.blue('\nFor installation help:'));
|
|
270
270
|
console.log(` ${chalk.cyan('npm install -g @paths.design/caws-cli')}`);
|
|
271
271
|
}
|
|
272
272
|
}
|
|
@@ -275,18 +275,18 @@ async function scaffoldProject(options) {
|
|
|
275
275
|
cawsSetup = setup;
|
|
276
276
|
|
|
277
277
|
if (!setup.hasCAWSDir) {
|
|
278
|
-
console.error(chalk.red('
|
|
279
|
-
console.error(chalk.blue('
|
|
278
|
+
console.error(chalk.red('No .caws directory found'));
|
|
279
|
+
console.error(chalk.blue('Run "caws init <project-name>" first to create a CAWS project'));
|
|
280
280
|
process.exit(1);
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
// Adapt behavior based on setup type
|
|
284
284
|
if (setup.isEnhanced) {
|
|
285
|
-
console.log(chalk.green('
|
|
285
|
+
console.log(chalk.green('Enhanced CAWS detected - adding automated publishing'));
|
|
286
286
|
} else if (setup.isAdvanced) {
|
|
287
|
-
console.log(chalk.blue('
|
|
287
|
+
console.log(chalk.blue('Advanced CAWS detected - adding missing capabilities'));
|
|
288
288
|
} else {
|
|
289
|
-
console.log(chalk.blue('
|
|
289
|
+
console.log(chalk.blue('Basic CAWS detected - enhancing with additional tools'));
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
// Generate provenance for scaffolding operation
|
|
@@ -429,7 +429,7 @@ async function scaffoldProject(options) {
|
|
|
429
429
|
});
|
|
430
430
|
|
|
431
431
|
// Install quality gates package
|
|
432
|
-
console.log(chalk.blue('\
|
|
432
|
+
console.log(chalk.blue('\nSetting up quality gates package...'));
|
|
433
433
|
try {
|
|
434
434
|
const { execSync } = require('child_process');
|
|
435
435
|
|
|
@@ -473,7 +473,7 @@ async function scaffoldProject(options) {
|
|
|
473
473
|
stdio: 'inherit',
|
|
474
474
|
});
|
|
475
475
|
|
|
476
|
-
console.log(chalk.green('
|
|
476
|
+
console.log(chalk.green('Quality gates files copied and dependencies installed'));
|
|
477
477
|
} else if (fs.existsSync(path.join(currentDir, 'package.json'))) {
|
|
478
478
|
// Regular project - try to install from npm (when published)
|
|
479
479
|
console.log(chalk.gray(' Installing @paths.design/quality-gates package...'));
|
|
@@ -484,10 +484,10 @@ async function scaffoldProject(options) {
|
|
|
484
484
|
cwd: currentDir,
|
|
485
485
|
stdio: 'inherit',
|
|
486
486
|
});
|
|
487
|
-
console.log(chalk.green('
|
|
487
|
+
console.log(chalk.green('Quality gates package installed from npm'));
|
|
488
488
|
} catch (npmError) {
|
|
489
489
|
console.log(
|
|
490
|
-
chalk.yellow('
|
|
490
|
+
chalk.yellow('Package not found on npm - quality gates will use local files')
|
|
491
491
|
);
|
|
492
492
|
console.log(
|
|
493
493
|
chalk.gray(
|
|
@@ -507,33 +507,33 @@ async function scaffoldProject(options) {
|
|
|
507
507
|
const todoAnalyzerDest = path.join(scriptsDir, 'todo-analyzer.mjs');
|
|
508
508
|
await fs.copy(todoAnalyzerSource, todoAnalyzerDest);
|
|
509
509
|
console.log(
|
|
510
|
-
chalk.green('
|
|
510
|
+
chalk.green('Copied todo-analyzer.mjs to scripts/ directory (local fallback)')
|
|
511
511
|
);
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
514
|
} else {
|
|
515
515
|
// No package.json - suggest global install or manual setup
|
|
516
|
-
console.log(chalk.yellow('
|
|
516
|
+
console.log(chalk.yellow('No package.json found - skipping package installation'));
|
|
517
517
|
console.log(chalk.gray(' Options:'));
|
|
518
518
|
console.log(
|
|
519
|
-
chalk.gray('
|
|
519
|
+
chalk.gray(' - Install globally: npm install -g @paths.design/quality-gates')
|
|
520
520
|
);
|
|
521
521
|
console.log(
|
|
522
522
|
chalk.gray(
|
|
523
|
-
'
|
|
523
|
+
' - Create package.json and run: npm install --save-dev @paths.design/quality-gates'
|
|
524
524
|
)
|
|
525
525
|
);
|
|
526
|
-
console.log(chalk.gray('
|
|
526
|
+
console.log(chalk.gray(' - Use CAWS CLI: caws quality-gates'));
|
|
527
527
|
}
|
|
528
528
|
|
|
529
529
|
console.log(
|
|
530
530
|
chalk.blue(
|
|
531
|
-
'
|
|
531
|
+
'You can now use: node node_modules/@paths.design/quality-gates/run-quality-gates.mjs'
|
|
532
532
|
)
|
|
533
533
|
);
|
|
534
534
|
console.log(chalk.blue(' Or: caws quality-gates'));
|
|
535
535
|
} catch (error) {
|
|
536
|
-
console.log(chalk.yellow(
|
|
536
|
+
console.log(chalk.yellow(`Failed to set up quality gates package: ${error.message}`));
|
|
537
537
|
console.log(
|
|
538
538
|
chalk.gray(
|
|
539
539
|
' You can install manually: npm install --save-dev @paths.design/quality-gates'
|
|
@@ -579,18 +579,18 @@ async function scaffoldProject(options) {
|
|
|
579
579
|
required: false,
|
|
580
580
|
});
|
|
581
581
|
} else if (needsOidc && oidcExists) {
|
|
582
|
-
console.log(chalk.gray('
|
|
582
|
+
console.log(chalk.gray('Skipped OIDC_SETUP.md (already exists)'));
|
|
583
583
|
} else if (!needsOidc && !options.minimal) {
|
|
584
584
|
// Inform user that OIDC is available but not needed
|
|
585
585
|
console.log(
|
|
586
|
-
chalk.blue('
|
|
586
|
+
chalk.blue('OIDC setup skipped (project does not appear to publish packages)')
|
|
587
587
|
);
|
|
588
588
|
console.log(chalk.gray(' Add --with-oidc flag if you plan to publish packages later'));
|
|
589
589
|
}
|
|
590
590
|
|
|
591
591
|
// For enhanced setups, preserve existing tools
|
|
592
592
|
if (setup.isEnhanced) {
|
|
593
|
-
console.log(chalk.blue('
|
|
593
|
+
console.log(chalk.blue('Preserving existing sophisticated CAWS tools'));
|
|
594
594
|
}
|
|
595
595
|
|
|
596
596
|
let addedCount = 0;
|
|
@@ -610,13 +610,13 @@ async function scaffoldProject(options) {
|
|
|
610
610
|
addedFiles.push(enhancement.name);
|
|
611
611
|
}
|
|
612
612
|
} else {
|
|
613
|
-
console.log(chalk.green(
|
|
613
|
+
console.log(chalk.green(`Added ${enhancement.description}`));
|
|
614
614
|
addedCount++;
|
|
615
615
|
addedFiles.push(enhancement.name);
|
|
616
616
|
}
|
|
617
617
|
} catch (error) {
|
|
618
618
|
console.warn(
|
|
619
|
-
chalk.yellow(
|
|
619
|
+
chalk.yellow(`Custom handler failed for ${enhancement.name}:`),
|
|
620
620
|
error.message
|
|
621
621
|
);
|
|
622
622
|
}
|
|
@@ -632,7 +632,7 @@ async function scaffoldProject(options) {
|
|
|
632
632
|
|
|
633
633
|
if (!sourcePath && !enhancement.sourcePath) {
|
|
634
634
|
console.warn(
|
|
635
|
-
chalk.yellow(
|
|
635
|
+
chalk.yellow(`Template directory not available for enhancement: ${enhancement.name}`)
|
|
636
636
|
);
|
|
637
637
|
continue;
|
|
638
638
|
}
|
|
@@ -643,11 +643,11 @@ async function scaffoldProject(options) {
|
|
|
643
643
|
if (fs.existsSync(sourcePath)) {
|
|
644
644
|
try {
|
|
645
645
|
await fs.copy(sourcePath, destPath);
|
|
646
|
-
console.log(chalk.green(
|
|
646
|
+
console.log(chalk.green(`Added ${enhancement.description}`));
|
|
647
647
|
addedCount++;
|
|
648
648
|
addedFiles.push(enhancement.name);
|
|
649
649
|
} catch (copyError) {
|
|
650
|
-
console.warn(chalk.yellow(
|
|
650
|
+
console.warn(chalk.yellow(`Failed to add ${enhancement.name}:`), copyError.message);
|
|
651
651
|
}
|
|
652
652
|
} else {
|
|
653
653
|
// If source doesn't exist in template, check if it should be a file or directory
|
|
@@ -660,19 +660,19 @@ async function scaffoldProject(options) {
|
|
|
660
660
|
await fs.ensureDir(path.dirname(destPath));
|
|
661
661
|
await fs.writeFile(destPath, '');
|
|
662
662
|
console.log(
|
|
663
|
-
chalk.yellow(
|
|
663
|
+
chalk.yellow(`Created empty ${enhancement.description} (template not found)`)
|
|
664
664
|
);
|
|
665
665
|
console.log(chalk.gray(` Template expected at: ${sourcePath}`));
|
|
666
666
|
} else {
|
|
667
667
|
// Create directory for directory-like enhancements
|
|
668
668
|
await fs.ensureDir(destPath);
|
|
669
|
-
console.log(chalk.green(
|
|
669
|
+
console.log(chalk.green(`Created ${enhancement.description}`));
|
|
670
670
|
}
|
|
671
671
|
addedCount++;
|
|
672
672
|
addedFiles.push(enhancement.name);
|
|
673
673
|
} catch (createError) {
|
|
674
674
|
console.warn(
|
|
675
|
-
chalk.yellow(
|
|
675
|
+
chalk.yellow(`Failed to create ${enhancement.name}:`),
|
|
676
676
|
createError.message
|
|
677
677
|
);
|
|
678
678
|
}
|
|
@@ -686,17 +686,17 @@ async function scaffoldProject(options) {
|
|
|
686
686
|
} else {
|
|
687
687
|
await fs.ensureDir(destPath);
|
|
688
688
|
}
|
|
689
|
-
console.log(chalk.blue(
|
|
689
|
+
console.log(chalk.blue(`Updated ${enhancement.description}`));
|
|
690
690
|
addedCount++;
|
|
691
691
|
addedFiles.push(enhancement.name);
|
|
692
692
|
} catch (overwriteError) {
|
|
693
693
|
console.warn(
|
|
694
|
-
chalk.yellow(
|
|
694
|
+
chalk.yellow(`Failed to update ${enhancement.name}:`),
|
|
695
695
|
overwriteError.message
|
|
696
696
|
);
|
|
697
697
|
}
|
|
698
698
|
} else {
|
|
699
|
-
console.log(
|
|
699
|
+
console.log(`Skipped ${enhancement.name} (already exists)`);
|
|
700
700
|
skippedCount++;
|
|
701
701
|
}
|
|
702
702
|
}
|
|
@@ -708,11 +708,11 @@ async function scaffoldProject(options) {
|
|
|
708
708
|
scaffoldProvenance.results.files_skipped = skippedCount;
|
|
709
709
|
|
|
710
710
|
// Show summary
|
|
711
|
-
console.log(chalk.green(`\
|
|
712
|
-
console.log(chalk.bold(
|
|
711
|
+
console.log(chalk.green(`\nEnhancement completed!`));
|
|
712
|
+
console.log(chalk.bold(`Summary: ${addedCount} added, ${skippedCount} skipped`));
|
|
713
713
|
|
|
714
714
|
if (addedCount > 0) {
|
|
715
|
-
console.log(chalk.bold('\
|
|
715
|
+
console.log(chalk.bold('\nNext steps:'));
|
|
716
716
|
console.log('1. Review the added files');
|
|
717
717
|
|
|
718
718
|
// Check if OIDC was added
|
|
@@ -745,18 +745,18 @@ async function scaffoldProject(options) {
|
|
|
745
745
|
|
|
746
746
|
if (setup.isEnhanced) {
|
|
747
747
|
console.log(
|
|
748
|
-
chalk.blue('\
|
|
748
|
+
chalk.blue('\nYour enhanced CAWS setup has been improved with automated publishing!')
|
|
749
749
|
);
|
|
750
750
|
}
|
|
751
751
|
|
|
752
752
|
if (options.force) {
|
|
753
|
-
console.log(chalk.yellow('\
|
|
753
|
+
console.log(chalk.yellow('\nForce mode was used - review changes carefully'));
|
|
754
754
|
}
|
|
755
755
|
|
|
756
756
|
// Update .gitignore to exclude CAWS local runtime files
|
|
757
757
|
const gitignoreUpdated = await updateGitignore(currentDir);
|
|
758
758
|
if (gitignoreUpdated) {
|
|
759
|
-
console.log(chalk.green('\
|
|
759
|
+
console.log(chalk.green('\nUpdated .gitignore to exclude CAWS local runtime files'));
|
|
760
760
|
console.log(
|
|
761
761
|
chalk.gray(' Tracked: Specs, policy, waivers, provenance, plans (shared with team)')
|
|
762
762
|
);
|
|
@@ -767,19 +767,19 @@ async function scaffoldProject(options) {
|
|
|
767
767
|
const tools = loadProvenanceTools && loadProvenanceTools();
|
|
768
768
|
if (tools && typeof tools.saveProvenance === 'function') {
|
|
769
769
|
await tools.saveProvenance(scaffoldProvenance, '.agent/scaffold-provenance.json');
|
|
770
|
-
console.log(chalk.green('
|
|
770
|
+
console.log(chalk.green('Scaffolding provenance saved'));
|
|
771
771
|
} else {
|
|
772
|
-
console.log(chalk.yellow('
|
|
772
|
+
console.log(chalk.yellow('Provenance tools not available - skipping manifest save'));
|
|
773
773
|
}
|
|
774
774
|
} catch (error) {
|
|
775
775
|
// Handle circular reference errors from Commander.js
|
|
776
776
|
if (error.message && error.message.includes('Converting circular structure to JSON')) {
|
|
777
777
|
console.log(
|
|
778
|
-
chalk.yellow('
|
|
778
|
+
chalk.yellow('Scaffolding completed with minor issues (circular reference handled)')
|
|
779
779
|
);
|
|
780
|
-
console.log(chalk.green('
|
|
780
|
+
console.log(chalk.green('CAWS components scaffolded successfully'));
|
|
781
781
|
} else {
|
|
782
|
-
console.error(chalk.red('
|
|
782
|
+
console.error(chalk.red('Error during scaffolding:'), error.message);
|
|
783
783
|
process.exit(1);
|
|
784
784
|
}
|
|
785
785
|
}
|