@paths.design/caws-cli 10.1.0 → 11.0.0
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/README.md +125 -374
- package/dist/index.js +43 -756
- package/dist/shell/binding/resolve-binding.d.ts +4 -0
- package/dist/shell/binding/resolve-binding.d.ts.map +1 -0
- package/dist/shell/binding/resolve-binding.js +228 -0
- package/dist/shell/binding/resolve-binding.js.map +1 -0
- package/dist/shell/binding/types.d.ts +42 -0
- package/dist/shell/binding/types.d.ts.map +1 -0
- package/dist/shell/binding/types.js +21 -0
- package/dist/shell/binding/types.js.map +1 -0
- package/dist/shell/commands/claim.d.ts +14 -0
- package/dist/shell/commands/claim.d.ts.map +1 -0
- package/dist/shell/commands/claim.js +197 -0
- package/dist/shell/commands/claim.js.map +1 -0
- package/dist/shell/commands/doctor.d.ts +13 -0
- package/dist/shell/commands/doctor.d.ts.map +1 -0
- package/dist/shell/commands/doctor.js +97 -0
- package/dist/shell/commands/doctor.js.map +1 -0
- package/dist/shell/commands/evidence.d.ts +28 -0
- package/dist/shell/commands/evidence.d.ts.map +1 -0
- package/dist/shell/commands/evidence.js +166 -0
- package/dist/shell/commands/evidence.js.map +1 -0
- package/dist/shell/commands/gates.d.ts +19 -0
- package/dist/shell/commands/gates.d.ts.map +1 -0
- package/dist/shell/commands/gates.js +181 -0
- package/dist/shell/commands/gates.js.map +1 -0
- package/dist/shell/commands/init.d.ts +8 -0
- package/dist/shell/commands/init.d.ts.map +1 -0
- package/dist/shell/commands/init.js +64 -0
- package/dist/shell/commands/init.js.map +1 -0
- package/dist/shell/commands/scope.d.ts +11 -0
- package/dist/shell/commands/scope.d.ts.map +1 -0
- package/dist/shell/commands/scope.js +92 -0
- package/dist/shell/commands/scope.js.map +1 -0
- package/dist/shell/commands/status.d.ts +15 -0
- package/dist/shell/commands/status.d.ts.map +1 -0
- package/dist/shell/commands/status.js +106 -0
- package/dist/shell/commands/status.js.map +1 -0
- package/dist/shell/commands/waiver.d.ts +38 -0
- package/dist/shell/commands/waiver.d.ts.map +1 -0
- package/dist/shell/commands/waiver.js +240 -0
- package/dist/shell/commands/waiver.js.map +1 -0
- package/dist/shell/gates/disposition.d.ts +23 -0
- package/dist/shell/gates/disposition.d.ts.map +1 -0
- package/dist/shell/gates/disposition.js +87 -0
- package/dist/shell/gates/disposition.js.map +1 -0
- package/dist/shell/gates/gate-result-contract.d.ts +39 -0
- package/dist/shell/gates/gate-result-contract.d.ts.map +1 -0
- package/dist/shell/gates/gate-result-contract.js +150 -0
- package/dist/shell/gates/gate-result-contract.js.map +1 -0
- package/dist/shell/gates/quality-gates-adapter.d.ts +55 -0
- package/dist/shell/gates/quality-gates-adapter.d.ts.map +1 -0
- package/dist/shell/gates/quality-gates-adapter.js +161 -0
- package/dist/shell/gates/quality-gates-adapter.js.map +1 -0
- package/dist/shell/gates/waiver-filter.d.ts +58 -0
- package/dist/shell/gates/waiver-filter.d.ts.map +1 -0
- package/dist/shell/gates/waiver-filter.js +119 -0
- package/dist/shell/gates/waiver-filter.js.map +1 -0
- package/dist/shell/index.d.ts +50 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.js +73 -0
- package/dist/shell/index.js.map +1 -0
- package/dist/shell/register.d.ts +11 -0
- package/dist/shell/register.d.ts.map +1 -0
- package/dist/shell/register.js +274 -0
- package/dist/shell/register.js.map +1 -0
- package/dist/shell/render/claim.d.ts +22 -0
- package/dist/shell/render/claim.d.ts.map +1 -0
- package/dist/shell/render/claim.js +75 -0
- package/dist/shell/render/claim.js.map +1 -0
- package/dist/shell/render/decision.d.ts +15 -0
- package/dist/shell/render/decision.d.ts.map +1 -0
- package/dist/shell/render/decision.js +66 -0
- package/dist/shell/render/decision.js.map +1 -0
- package/dist/shell/render/diagnostic.d.ts +19 -0
- package/dist/shell/render/diagnostic.d.ts.map +1 -0
- package/dist/shell/render/diagnostic.js +76 -0
- package/dist/shell/render/diagnostic.js.map +1 -0
- package/dist/shell/render/finding.d.ts +15 -0
- package/dist/shell/render/finding.d.ts.map +1 -0
- package/dist/shell/render/finding.js +57 -0
- package/dist/shell/render/finding.js.map +1 -0
- package/dist/shell/render/gates.d.ts +3 -0
- package/dist/shell/render/gates.d.ts.map +1 -0
- package/dist/shell/render/gates.js +56 -0
- package/dist/shell/render/gates.js.map +1 -0
- package/dist/shell/render/init.d.ts +11 -0
- package/dist/shell/render/init.d.ts.map +1 -0
- package/dist/shell/render/init.js +32 -0
- package/dist/shell/render/init.js.map +1 -0
- package/dist/shell/render/status.d.ts +26 -0
- package/dist/shell/render/status.d.ts.map +1 -0
- package/dist/shell/render/status.js +143 -0
- package/dist/shell/render/status.js.map +1 -0
- package/dist/shell/render/waiver.d.ts +21 -0
- package/dist/shell/render/waiver.d.ts.map +1 -0
- package/dist/shell/render/waiver.js +94 -0
- package/dist/shell/render/waiver.js.map +1 -0
- package/dist/shell/rules.d.ts +37 -0
- package/dist/shell/rules.d.ts.map +1 -0
- package/dist/shell/rules.js +51 -0
- package/dist/shell/rules.js.map +1 -0
- package/dist/shell/session/actor.d.ts +14 -0
- package/dist/shell/session/actor.d.ts.map +1 -0
- package/dist/shell/session/actor.js +34 -0
- package/dist/shell/session/actor.js.map +1 -0
- package/dist/shell/session/resolve-session.d.ts +5 -0
- package/dist/shell/session/resolve-session.d.ts.map +1 -0
- package/dist/shell/session/resolve-session.js +239 -0
- package/dist/shell/session/resolve-session.js.map +1 -0
- package/dist/shell/session/types.d.ts +56 -0
- package/dist/shell/session/types.d.ts.map +1 -0
- package/dist/shell/session/types.js +15 -0
- package/dist/shell/session/types.js.map +1 -0
- package/dist/store/agents-store.d.ts +3 -0
- package/dist/store/agents-store.d.ts.map +1 -0
- package/dist/store/agents-store.js +63 -0
- package/dist/store/agents-store.js.map +1 -0
- package/dist/store/apply-patch.d.ts +16 -0
- package/dist/store/apply-patch.d.ts.map +1 -0
- package/dist/store/apply-patch.js +191 -0
- package/dist/store/apply-patch.js.map +1 -0
- package/dist/store/atomic-write.d.ts +16 -0
- package/dist/store/atomic-write.d.ts.map +1 -0
- package/dist/store/atomic-write.js +132 -0
- package/dist/store/atomic-write.js.map +1 -0
- package/dist/store/doctor-snapshot.d.ts +20 -0
- package/dist/store/doctor-snapshot.d.ts.map +1 -0
- package/dist/store/doctor-snapshot.js +176 -0
- package/dist/store/doctor-snapshot.js.map +1 -0
- package/dist/store/events-store.d.ts +33 -0
- package/dist/store/events-store.d.ts.map +1 -0
- package/dist/store/events-store.js +297 -0
- package/dist/store/events-store.js.map +1 -0
- package/dist/store/index.d.ts +21 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +47 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/init-store.d.ts +21 -0
- package/dist/store/init-store.d.ts.map +1 -0
- package/dist/store/init-store.js +295 -0
- package/dist/store/init-store.js.map +1 -0
- package/dist/store/json-store.d.ts +3 -0
- package/dist/store/json-store.d.ts.map +1 -0
- package/dist/store/json-store.js +65 -0
- package/dist/store/json-store.js.map +1 -0
- package/dist/store/policy-store.d.ts +3 -0
- package/dist/store/policy-store.d.ts.map +1 -0
- package/dist/store/policy-store.js +65 -0
- package/dist/store/policy-store.js.map +1 -0
- package/dist/store/repo-root.d.ts +46 -0
- package/dist/store/repo-root.d.ts.map +1 -0
- package/dist/store/repo-root.js +145 -0
- package/dist/store/repo-root.js.map +1 -0
- package/dist/store/rules.d.ts +53 -0
- package/dist/store/rules.d.ts.map +1 -0
- package/dist/store/rules.js +78 -0
- package/dist/store/rules.js.map +1 -0
- package/dist/store/specs-store.d.ts +3 -0
- package/dist/store/specs-store.d.ts.map +1 -0
- package/dist/store/specs-store.js +131 -0
- package/dist/store/specs-store.js.map +1 -0
- package/dist/store/types.d.ts +84 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +14 -0
- package/dist/store/types.js.map +1 -0
- package/dist/store/waivers-store.d.ts +25 -0
- package/dist/store/waivers-store.d.ts.map +1 -0
- package/dist/store/waivers-store.js +232 -0
- package/dist/store/waivers-store.js.map +1 -0
- package/dist/store/worktrees-store.d.ts +3 -0
- package/dist/store/worktrees-store.d.ts.map +1 -0
- package/dist/store/worktrees-store.js +62 -0
- package/dist/store/worktrees-store.js.map +1 -0
- package/dist/store/yaml-store.d.ts +9 -0
- package/dist/store/yaml-store.d.ts.map +1 -0
- package/dist/store/yaml-store.js +121 -0
- package/dist/store/yaml-store.js.map +1 -0
- package/package.json +15 -13
- package/dist/budget-derivation.js +0 -751
- package/dist/cicd-optimizer.js +0 -504
- package/dist/commands/archive.js +0 -500
- package/dist/commands/burnup.js +0 -198
- package/dist/commands/diagnose.js +0 -525
- package/dist/commands/evaluate.js +0 -314
- package/dist/commands/gates.js +0 -149
- package/dist/commands/init.js +0 -857
- package/dist/commands/iterate.js +0 -417
- package/dist/commands/mode.js +0 -269
- package/dist/commands/parallel.js +0 -242
- package/dist/commands/plan.js +0 -438
- package/dist/commands/provenance.js +0 -1143
- package/dist/commands/quality-monitor.js +0 -284
- package/dist/commands/scope.js +0 -264
- package/dist/commands/session.js +0 -312
- package/dist/commands/sidecar.js +0 -74
- package/dist/commands/specs.js +0 -1448
- package/dist/commands/status.js +0 -1151
- package/dist/commands/templates.js +0 -237
- package/dist/commands/tool.js +0 -136
- package/dist/commands/tutorial.js +0 -480
- package/dist/commands/validate.js +0 -357
- package/dist/commands/verify-acs.js +0 -443
- package/dist/commands/waivers.js +0 -599
- package/dist/commands/workflow.js +0 -243
- package/dist/commands/worktree.js +0 -386
- package/dist/config/lite-scope.js +0 -158
- package/dist/config/modes.js +0 -347
- package/dist/constants/spec-types.js +0 -65
- package/dist/gates/budget-limit.js +0 -121
- package/dist/gates/feedback.js +0 -260
- package/dist/gates/format.js +0 -179
- package/dist/gates/god-object.js +0 -117
- package/dist/gates/pipeline.js +0 -167
- package/dist/gates/scope-boundary.js +0 -93
- package/dist/gates/spec-completeness.js +0 -109
- package/dist/gates/todo-detection.js +0 -205
- package/dist/generators/jest-config-generator.js +0 -242
- package/dist/generators/working-spec.js +0 -237
- package/dist/minimal-cli.js +0 -88
- package/dist/parallel/parallel-manager.js +0 -433
- package/dist/policy/PolicyManager.js +0 -465
- package/dist/scaffold/claude-hooks.js +0 -443
- package/dist/scaffold/cursor-hooks.js +0 -177
- package/dist/scaffold/git-hooks.js +0 -928
- package/dist/scaffold/index.js +0 -794
- package/dist/session/session-manager.js +0 -653
- package/dist/sidecars/index.js +0 -33
- package/dist/sidecars/listeners.js +0 -40
- package/dist/sidecars/provenance-summary.js +0 -238
- package/dist/sidecars/quality-gaps.js +0 -258
- package/dist/sidecars/schema.js +0 -149
- package/dist/sidecars/spec-drift.js +0 -151
- package/dist/sidecars/waiver-draft.js +0 -176
- package/dist/spec/SpecFileManager.js +0 -419
- package/dist/templates/.caws/schemas/policy.schema.json +0 -112
- package/dist/templates/.caws/schemas/scope.schema.json +0 -52
- package/dist/templates/.caws/schemas/waivers.schema.json +0 -106
- package/dist/templates/.caws/schemas/working-spec.schema.json +0 -340
- package/dist/templates/.caws/schemas/worktrees.schema.json +0 -38
- package/dist/templates/.caws/templates/working-spec.template.yml +0 -80
- package/dist/templates/.caws/tools/README.md +0 -18
- package/dist/templates/.caws/tools/scope-guard.js +0 -203
- package/dist/templates/.caws/tools-allow.json +0 -331
- package/dist/templates/.caws/waivers.yml +0 -19
- package/dist/templates/.claude/README.md +0 -190
- package/dist/templates/.claude/hooks/audit.sh +0 -121
- package/dist/templates/.claude/hooks/block-dangerous.sh +0 -203
- package/dist/templates/.claude/hooks/classify_command.py +0 -592
- package/dist/templates/.claude/hooks/doc-frontmatter-check.sh +0 -173
- package/dist/templates/.claude/hooks/lite-sprawl-check.sh +0 -145
- package/dist/templates/.claude/hooks/naming-check.sh +0 -100
- package/dist/templates/.claude/hooks/protected-paths.sh +0 -39
- package/dist/templates/.claude/hooks/quality-check.sh +0 -81
- package/dist/templates/.claude/hooks/scan-secrets.sh +0 -85
- package/dist/templates/.claude/hooks/scope-guard.sh +0 -381
- package/dist/templates/.claude/hooks/session-caws-status.sh +0 -117
- package/dist/templates/.claude/hooks/session-log.sh +0 -634
- package/dist/templates/.claude/hooks/simplification-guard.sh +0 -92
- package/dist/templates/.claude/hooks/stop-worktree-check.sh +0 -46
- package/dist/templates/.claude/hooks/test_classify_command.py +0 -370
- package/dist/templates/.claude/hooks/test_wrapper_smoke.sh +0 -96
- package/dist/templates/.claude/hooks/validate-spec.sh +0 -76
- package/dist/templates/.claude/hooks/worktree-guard.sh +0 -220
- package/dist/templates/.claude/hooks/worktree-write-guard.sh +0 -190
- package/dist/templates/.claude/rules/git-safety.md +0 -26
- package/dist/templates/.claude/rules/worktree-isolation.md +0 -83
- package/dist/templates/.claude/settings.json +0 -141
- package/dist/templates/.cursor/README.md +0 -299
- package/dist/templates/.cursor/hooks/audit.sh +0 -55
- package/dist/templates/.cursor/hooks/block-dangerous.sh +0 -84
- package/dist/templates/.cursor/hooks/caws-quality-check.sh +0 -52
- package/dist/templates/.cursor/hooks/caws-scope-guard.sh +0 -130
- package/dist/templates/.cursor/hooks/format.sh +0 -38
- package/dist/templates/.cursor/hooks/naming-check.sh +0 -64
- package/dist/templates/.cursor/hooks/scan-secrets.sh +0 -51
- package/dist/templates/.cursor/hooks/scope-guard.sh +0 -52
- package/dist/templates/.cursor/hooks/session-log.sh +0 -924
- package/dist/templates/.cursor/hooks/validate-spec.sh +0 -83
- package/dist/templates/.cursor/hooks.json +0 -76
- package/dist/templates/.cursor/rules/00-claims-verification.mdc +0 -144
- package/dist/templates/.cursor/rules/01-working-style.mdc +0 -50
- package/dist/templates/.cursor/rules/02-quality-gates.mdc +0 -368
- package/dist/templates/.cursor/rules/03-naming-and-refactor.mdc +0 -33
- package/dist/templates/.cursor/rules/04-logging-language-style.mdc +0 -23
- package/dist/templates/.cursor/rules/05-safe-defaults-guards.mdc +0 -23
- package/dist/templates/.cursor/rules/06-typescript-conventions.mdc +0 -36
- package/dist/templates/.cursor/rules/07-process-ops.mdc +0 -20
- package/dist/templates/.cursor/rules/08-solid-and-architecture.mdc +0 -16
- package/dist/templates/.cursor/rules/09-docstrings.mdc +0 -89
- package/dist/templates/.cursor/rules/10-documentation-quality-standards.mdc +0 -385
- package/dist/templates/.cursor/rules/11-scope-management-waivers.mdc +0 -381
- package/dist/templates/.cursor/rules/12-implementation-completeness.mdc +0 -516
- package/dist/templates/.cursor/rules/13-language-agnostic-standards.mdc +0 -578
- package/dist/templates/.cursor/rules/README.md +0 -148
- package/dist/templates/.github/copilot-instructions.md +0 -82
- package/dist/templates/.idea/runConfigurations/CAWS_Evaluate.xml +0 -5
- package/dist/templates/.idea/runConfigurations/CAWS_Validate.xml +0 -5
- package/dist/templates/.junie/guidelines.md +0 -73
- package/dist/templates/.vscode/launch.json +0 -17
- package/dist/templates/.vscode/settings.json +0 -95
- package/dist/templates/.windsurf/rules/caws-quality-standards.md +0 -54
- package/dist/templates/.windsurf/workflows/caws-guided-development.md +0 -92
- package/dist/templates/CLAUDE.md +0 -174
- package/dist/templates/COMMIT_CONVENTIONS.md +0 -86
- package/dist/templates/OIDC_SETUP.md +0 -300
- package/dist/templates/agents.md +0 -145
- package/dist/templates/codemod/README.md +0 -1
- package/dist/templates/codemod/test.js +0 -93
- package/dist/templates/docs/README.md +0 -151
- package/dist/templates/scripts/new_feature.sh +0 -80
- package/dist/templates/scripts/quality-gates/check-god-objects.js +0 -146
- package/dist/templates/scripts/quality-gates/run-quality-gates.js +0 -50
- package/dist/templates/scripts/v3/analysis/todo_analyzer.py +0 -1997
- package/dist/test-analysis.js +0 -786
- package/dist/tool-interface.js +0 -314
- package/dist/tool-loader.js +0 -303
- package/dist/tool-validator.js +0 -393
- package/dist/utils/agent-session.js +0 -202
- package/dist/utils/async-utils.js +0 -188
- package/dist/utils/command-wrapper.js +0 -200
- package/dist/utils/event-log.js +0 -584
- package/dist/utils/event-renderer.js +0 -521
- package/dist/utils/finalization.js +0 -230
- package/dist/utils/git-lock.js +0 -119
- package/dist/utils/gitignore-updater.js +0 -158
- package/dist/utils/ide-detection.js +0 -133
- package/dist/utils/lifecycle-events.js +0 -94
- package/dist/utils/project-analysis.js +0 -367
- package/dist/utils/promise-utils.js +0 -72
- package/dist/utils/quality-gates-errors.js +0 -520
- package/dist/utils/quality-gates-utils.js +0 -387
- package/dist/utils/schema-validator.js +0 -50
- package/dist/utils/spec-resolver.js +0 -711
- package/dist/utils/typescript-detector.js +0 -369
- package/dist/utils/working-state.js +0 -530
- package/dist/utils/yaml-validation.js +0 -156
- package/dist/validation/spec-validation.js +0 -921
- package/dist/waivers-manager.js +0 -732
- package/dist/worktree/worktree-manager.js +0 -1374
- package/templates/.caws/schemas/policy.schema.json +0 -112
- package/templates/.caws/schemas/scope.schema.json +0 -52
- package/templates/.caws/schemas/waivers.schema.json +0 -106
- package/templates/.caws/schemas/working-spec.schema.json +0 -340
- package/templates/.caws/schemas/worktrees.schema.json +0 -38
- package/templates/.caws/templates/working-spec.template.yml +0 -80
- package/templates/.caws/tools/README.md +0 -18
- package/templates/.caws/tools/scope-guard.js +0 -203
- package/templates/.caws/tools-allow.json +0 -331
- package/templates/.caws/waivers.yml +0 -19
- package/templates/.claude/README.md +0 -190
- package/templates/.claude/hooks/audit.sh +0 -121
- package/templates/.claude/hooks/block-dangerous.sh +0 -203
- package/templates/.claude/hooks/classify_command.py +0 -592
- package/templates/.claude/hooks/doc-frontmatter-check.sh +0 -173
- package/templates/.claude/hooks/lite-sprawl-check.sh +0 -145
- package/templates/.claude/hooks/naming-check.sh +0 -100
- package/templates/.claude/hooks/protected-paths.sh +0 -39
- package/templates/.claude/hooks/quality-check.sh +0 -81
- package/templates/.claude/hooks/scan-secrets.sh +0 -85
- package/templates/.claude/hooks/scope-guard.sh +0 -381
- package/templates/.claude/hooks/session-caws-status.sh +0 -117
- package/templates/.claude/hooks/session-log.sh +0 -634
- package/templates/.claude/hooks/simplification-guard.sh +0 -92
- package/templates/.claude/hooks/stop-worktree-check.sh +0 -46
- package/templates/.claude/hooks/test_classify_command.py +0 -370
- package/templates/.claude/hooks/test_wrapper_smoke.sh +0 -96
- package/templates/.claude/hooks/validate-spec.sh +0 -76
- package/templates/.claude/hooks/worktree-guard.sh +0 -220
- package/templates/.claude/hooks/worktree-write-guard.sh +0 -190
- package/templates/.claude/rules/git-safety.md +0 -26
- package/templates/.claude/rules/worktree-isolation.md +0 -83
- package/templates/.claude/settings.json +0 -141
- package/templates/.cursor/README.md +0 -299
- package/templates/.cursor/hooks/audit.sh +0 -55
- package/templates/.cursor/hooks/block-dangerous.sh +0 -84
- package/templates/.cursor/hooks/caws-quality-check.sh +0 -52
- package/templates/.cursor/hooks/caws-scope-guard.sh +0 -130
- package/templates/.cursor/hooks/format.sh +0 -38
- package/templates/.cursor/hooks/naming-check.sh +0 -64
- package/templates/.cursor/hooks/scan-secrets.sh +0 -51
- package/templates/.cursor/hooks/scope-guard.sh +0 -52
- package/templates/.cursor/hooks/session-log.sh +0 -924
- package/templates/.cursor/hooks/validate-spec.sh +0 -83
- package/templates/.cursor/hooks.json +0 -76
- package/templates/.cursor/rules/00-claims-verification.mdc +0 -144
- package/templates/.cursor/rules/01-working-style.mdc +0 -50
- package/templates/.cursor/rules/02-quality-gates.mdc +0 -368
- package/templates/.cursor/rules/03-naming-and-refactor.mdc +0 -33
- package/templates/.cursor/rules/04-logging-language-style.mdc +0 -23
- package/templates/.cursor/rules/05-safe-defaults-guards.mdc +0 -23
- package/templates/.cursor/rules/06-typescript-conventions.mdc +0 -36
- package/templates/.cursor/rules/07-process-ops.mdc +0 -20
- package/templates/.cursor/rules/08-solid-and-architecture.mdc +0 -16
- package/templates/.cursor/rules/09-docstrings.mdc +0 -89
- package/templates/.cursor/rules/10-documentation-quality-standards.mdc +0 -385
- package/templates/.cursor/rules/11-scope-management-waivers.mdc +0 -381
- package/templates/.cursor/rules/12-implementation-completeness.mdc +0 -516
- package/templates/.cursor/rules/13-language-agnostic-standards.mdc +0 -578
- package/templates/.cursor/rules/README.md +0 -148
- package/templates/.github/copilot-instructions.md +0 -82
- package/templates/.idea/runConfigurations/CAWS_Evaluate.xml +0 -5
- package/templates/.idea/runConfigurations/CAWS_Validate.xml +0 -5
- package/templates/.junie/guidelines.md +0 -73
- package/templates/.vscode/launch.json +0 -17
- package/templates/.vscode/settings.json +0 -95
- package/templates/.windsurf/rules/caws-quality-standards.md +0 -54
- package/templates/.windsurf/workflows/caws-guided-development.md +0 -92
- package/templates/CLAUDE.md +0 -174
- package/templates/COMMIT_CONVENTIONS.md +0 -86
- package/templates/OIDC_SETUP.md +0 -300
- package/templates/agents.md +0 -145
- package/templates/codemod/README.md +0 -1
- package/templates/codemod/test.js +0 -93
- package/templates/docs/README.md +0 -151
- package/templates/scripts/new_feature.sh +0 -80
- package/templates/scripts/quality-gates/check-god-objects.js +0 -146
- package/templates/scripts/quality-gates/run-quality-gates.js +0 -50
- package/templates/scripts/v3/analysis/todo_analyzer.py +0 -1997
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Project Finalization Utilities
|
|
3
|
-
* Functions for finalizing CAWS project setup
|
|
4
|
-
* @author @darianrosebrook
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const fs = require('fs-extra');
|
|
8
|
-
const path = require('path');
|
|
9
|
-
const chalk = require('chalk');
|
|
10
|
-
|
|
11
|
-
// CLI version from package.json
|
|
12
|
-
const CLI_VERSION = require('../../package.json').version;
|
|
13
|
-
|
|
14
|
-
// Import scaffold utilities
|
|
15
|
-
const { scaffoldCursorHooks } = require('../scaffold/cursor-hooks');
|
|
16
|
-
|
|
17
|
-
// Dependencies injected via setFinalizationDependencies()
|
|
18
|
-
let languageSupport = null;
|
|
19
|
-
let loadProvenanceTools = null;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Set dependencies for finalization utilities
|
|
23
|
-
* @param {Object} deps - Dependencies object
|
|
24
|
-
*/
|
|
25
|
-
function setFinalizationDependencies(deps) {
|
|
26
|
-
languageSupport = deps.languageSupport;
|
|
27
|
-
loadProvenanceTools = deps.loadProvenanceTools;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Generate provenance manifest and git initialization (for both modes)
|
|
32
|
-
* @param {string} projectName - Project name
|
|
33
|
-
* @param {Object} options - Command options
|
|
34
|
-
* @param {Object} answers - User answers
|
|
35
|
-
*/
|
|
36
|
-
async function finalizeProject(projectName, options, answers) {
|
|
37
|
-
try {
|
|
38
|
-
// Detect and configure language support
|
|
39
|
-
if (languageSupport) {
|
|
40
|
-
console.log(chalk.cyan('Detecting project language...'));
|
|
41
|
-
const detectedLanguage = languageSupport.detectProjectLanguage();
|
|
42
|
-
|
|
43
|
-
if (detectedLanguage !== 'unknown') {
|
|
44
|
-
console.log(chalk.green(`Detected language: ${detectedLanguage}`));
|
|
45
|
-
|
|
46
|
-
// Generate language-specific configuration
|
|
47
|
-
try {
|
|
48
|
-
const langConfig = languageSupport.generateLanguageConfig(
|
|
49
|
-
detectedLanguage,
|
|
50
|
-
'.caws/language-config.json'
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
console.log(chalk.green('Generated language-specific configuration'));
|
|
54
|
-
console.log(` Language: ${langConfig.name}`);
|
|
55
|
-
console.log(` Tier: ${langConfig.tier}`);
|
|
56
|
-
console.log(
|
|
57
|
-
` Thresholds: Branch ≥${langConfig.thresholds.min_branch * 100}%, Mutation ≥${langConfig.thresholds.min_mutation * 100}%`
|
|
58
|
-
);
|
|
59
|
-
} catch (langError) {
|
|
60
|
-
console.warn(chalk.yellow('Could not generate language config:'), langError.message);
|
|
61
|
-
}
|
|
62
|
-
} else {
|
|
63
|
-
console.log(
|
|
64
|
-
chalk.blue('Could not detect project language - using default configuration')
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Setup Cursor hooks if enabled
|
|
70
|
-
if (answers && answers.enableCursorHooks) {
|
|
71
|
-
console.log(chalk.cyan('Setting up Cursor hooks...'));
|
|
72
|
-
await scaffoldCursorHooks(
|
|
73
|
-
process.cwd(),
|
|
74
|
-
answers.cursorHookLevels || ['safety', 'quality', 'scope', 'audit']
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Generate provenance manifest
|
|
79
|
-
console.log(chalk.cyan('Generating provenance manifest...'));
|
|
80
|
-
|
|
81
|
-
const provenanceData = {
|
|
82
|
-
agent: 'caws-cli',
|
|
83
|
-
model: 'cli-interactive',
|
|
84
|
-
modelHash: CLI_VERSION,
|
|
85
|
-
toolAllowlist: [
|
|
86
|
-
'node',
|
|
87
|
-
'npm',
|
|
88
|
-
'git',
|
|
89
|
-
'fs-extra',
|
|
90
|
-
'inquirer',
|
|
91
|
-
'commander',
|
|
92
|
-
'js-yaml',
|
|
93
|
-
'ajv',
|
|
94
|
-
'chalk',
|
|
95
|
-
],
|
|
96
|
-
prompts: Object.keys(answers),
|
|
97
|
-
commit: null, // Will be set after git init
|
|
98
|
-
artifacts: ['.caws/specs/', '.caws/working-spec.yaml'],
|
|
99
|
-
results: {
|
|
100
|
-
project_id: answers.projectId,
|
|
101
|
-
project_title: answers.projectTitle,
|
|
102
|
-
risk_tier: answers.riskTier,
|
|
103
|
-
mode: answers.projectMode,
|
|
104
|
-
change_budget: {
|
|
105
|
-
max_files: answers.maxFiles,
|
|
106
|
-
max_loc: answers.maxLoc,
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
approvals: [],
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
// Generate provenance if tools are available
|
|
113
|
-
const tools = loadProvenanceTools && loadProvenanceTools();
|
|
114
|
-
if (
|
|
115
|
-
tools &&
|
|
116
|
-
typeof tools.generateProvenance === 'function' &&
|
|
117
|
-
typeof tools.saveProvenance === 'function'
|
|
118
|
-
) {
|
|
119
|
-
const provenance = tools.generateProvenance(provenanceData);
|
|
120
|
-
await tools.saveProvenance(provenance, '.agent/provenance.json');
|
|
121
|
-
console.log(chalk.green('Provenance manifest generated'));
|
|
122
|
-
} else {
|
|
123
|
-
console.log(
|
|
124
|
-
chalk.yellow('Provenance tools not available - skipping manifest generation')
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Initialize git repository
|
|
129
|
-
if (options.git) {
|
|
130
|
-
try {
|
|
131
|
-
console.log(chalk.cyan('Initializing git repository...'));
|
|
132
|
-
|
|
133
|
-
// Check if git is available
|
|
134
|
-
try {
|
|
135
|
-
require('child_process').execSync('git --version', { stdio: 'ignore' });
|
|
136
|
-
} catch (error) {
|
|
137
|
-
console.warn(chalk.yellow('Git not found. Skipping git initialization.'));
|
|
138
|
-
console.warn(chalk.blue('Install git to enable automatic repository setup.'));
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Configure git author information
|
|
143
|
-
const gitConfig = answers.git_config || {};
|
|
144
|
-
const authorName = process.env.GIT_AUTHOR_NAME || gitConfig.author_name;
|
|
145
|
-
const authorEmail = process.env.GIT_AUTHOR_EMAIL || gitConfig.author_email;
|
|
146
|
-
|
|
147
|
-
if (authorName && authorEmail) {
|
|
148
|
-
require('child_process').execSync(`git config user.name "${authorName}"`, {
|
|
149
|
-
stdio: 'inherit',
|
|
150
|
-
});
|
|
151
|
-
require('child_process').execSync(`git config user.email "${authorEmail}"`, {
|
|
152
|
-
stdio: 'inherit',
|
|
153
|
-
});
|
|
154
|
-
console.log(chalk.green(`Git configured: ${authorName} <${authorEmail}>`));
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
require('child_process').execSync('git init', { stdio: 'inherit' });
|
|
158
|
-
require('child_process').execSync('git add .', { stdio: 'inherit' });
|
|
159
|
-
require('child_process').execSync('git commit -m "Initial CAWS project setup"', {
|
|
160
|
-
stdio: 'inherit',
|
|
161
|
-
});
|
|
162
|
-
console.log(chalk.green('Git repository initialized'));
|
|
163
|
-
|
|
164
|
-
// Update provenance with commit hash
|
|
165
|
-
const commitHash = require('child_process')
|
|
166
|
-
.execSync('git rev-parse HEAD', { encoding: 'utf8' })
|
|
167
|
-
.trim();
|
|
168
|
-
const currentProvenance = JSON.parse(fs.readFileSync('.agent/provenance.json', 'utf8'));
|
|
169
|
-
currentProvenance.commit = commitHash;
|
|
170
|
-
currentProvenance.hash = require('crypto')
|
|
171
|
-
.createHash('sha256')
|
|
172
|
-
.update(JSON.stringify(currentProvenance, Object.keys(currentProvenance).sort()))
|
|
173
|
-
.digest('hex');
|
|
174
|
-
await fs.writeFile('.agent/provenance.json', JSON.stringify(currentProvenance, null, 2));
|
|
175
|
-
|
|
176
|
-
console.log(chalk.green('Provenance updated with commit hash'));
|
|
177
|
-
} catch (error) {
|
|
178
|
-
console.warn(
|
|
179
|
-
chalk.yellow('Failed to initialize git repository:'),
|
|
180
|
-
error?.message || String(error)
|
|
181
|
-
);
|
|
182
|
-
console.warn(chalk.blue('You can initialize git manually later with:'));
|
|
183
|
-
console.warn(" git init && git add . && git commit -m 'Initial CAWS project setup'");
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
} catch (error) {
|
|
187
|
-
console.error(
|
|
188
|
-
chalk.red('Error during project finalization:'),
|
|
189
|
-
error?.message || String(error)
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Display success message after project initialization
|
|
196
|
-
*/
|
|
197
|
-
function continueToSuccess() {
|
|
198
|
-
const isCurrentDir =
|
|
199
|
-
process.cwd() ===
|
|
200
|
-
path.resolve(process.argv[3] === '.' ? process.cwd() : process.argv[3] || 'caws-project');
|
|
201
|
-
|
|
202
|
-
console.log(chalk.green('\nCAWS project initialized successfully!'));
|
|
203
|
-
|
|
204
|
-
if (isCurrentDir) {
|
|
205
|
-
console.log(
|
|
206
|
-
`${chalk.cyan('Initialized in current directory')}: ${path.resolve(process.cwd())}`
|
|
207
|
-
);
|
|
208
|
-
console.log(chalk.gray(' (CAWS files added to your existing project)'));
|
|
209
|
-
} else {
|
|
210
|
-
console.log(`${chalk.cyan('Project location')}: ${path.resolve(process.cwd())}`);
|
|
211
|
-
console.log(chalk.gray(' (New subdirectory created with CAWS structure)'));
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
console.log(chalk.bold('\nNext steps:'));
|
|
215
|
-
console.log('1. Customize .caws/specs/<spec-id>.yaml');
|
|
216
|
-
console.log('2. Treat .caws/working-spec.yaml as a compatibility mirror');
|
|
217
|
-
console.log('3. Review added CAWS tools and documentation');
|
|
218
|
-
if (!isCurrentDir) {
|
|
219
|
-
console.log('4. Move CAWS files to your main project if needed');
|
|
220
|
-
}
|
|
221
|
-
console.log('5. npm install (if using Node.js)');
|
|
222
|
-
console.log('6. Set up your CI/CD pipeline');
|
|
223
|
-
console.log(chalk.blue('\nFor help: caws --help'));
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
module.exports = {
|
|
227
|
-
finalizeProject,
|
|
228
|
-
continueToSuccess,
|
|
229
|
-
setFinalizationDependencies,
|
|
230
|
-
};
|
package/dist/utils/git-lock.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Git Lock Detection Utilities
|
|
3
|
-
* Functions for detecting and handling git locks
|
|
4
|
-
* @author @darianrosebrook
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const fs = require('fs-extra');
|
|
8
|
-
const path = require('path');
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Check for git lock files
|
|
12
|
-
* @param {string} projectRoot - Project root directory
|
|
13
|
-
* @returns {Object} Lock status information
|
|
14
|
-
*/
|
|
15
|
-
function checkGitLock(projectRoot) {
|
|
16
|
-
const lockFile = path.join(projectRoot, '.git', 'index.lock');
|
|
17
|
-
const headLockFile = path.join(projectRoot, '.git', 'HEAD.lock');
|
|
18
|
-
|
|
19
|
-
const result = {
|
|
20
|
-
locked: false,
|
|
21
|
-
stale: false,
|
|
22
|
-
lockFiles: [],
|
|
23
|
-
message: null,
|
|
24
|
-
suggestion: null,
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
// Check index.lock
|
|
28
|
-
if (fs.existsSync(lockFile)) {
|
|
29
|
-
const lockAge = Date.now() - fs.statSync(lockFile).mtimeMs;
|
|
30
|
-
const lockAgeMinutes = Math.floor(lockAge / 60000);
|
|
31
|
-
|
|
32
|
-
result.locked = true;
|
|
33
|
-
result.lockFiles.push({
|
|
34
|
-
path: '.git/index.lock',
|
|
35
|
-
age: lockAgeMinutes,
|
|
36
|
-
stale: lockAgeMinutes > 5,
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
if (lockAgeMinutes > 5) {
|
|
40
|
-
// Stale lock (older than 5 minutes)
|
|
41
|
-
result.stale = true;
|
|
42
|
-
result.message = `Stale git lock detected (${lockAgeMinutes} minutes old). This may indicate a crashed git process.`;
|
|
43
|
-
result.suggestion = 'Remove stale lock: rm .git/index.lock';
|
|
44
|
-
} else {
|
|
45
|
-
// Active lock
|
|
46
|
-
result.message =
|
|
47
|
-
'Git lock detected. Another git process may be running.';
|
|
48
|
-
result.suggestion =
|
|
49
|
-
'Wait for the other process to complete, or check for running git/editor processes';
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Check HEAD.lock
|
|
54
|
-
if (fs.existsSync(headLockFile)) {
|
|
55
|
-
const lockAge = Date.now() - fs.statSync(headLockFile).mtimeMs;
|
|
56
|
-
const lockAgeMinutes = Math.floor(lockAge / 60000);
|
|
57
|
-
|
|
58
|
-
result.locked = true;
|
|
59
|
-
result.lockFiles.push({
|
|
60
|
-
path: '.git/HEAD.lock',
|
|
61
|
-
age: lockAgeMinutes,
|
|
62
|
-
stale: lockAgeMinutes > 5,
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
if (lockAgeMinutes > 5) {
|
|
66
|
-
result.stale = true;
|
|
67
|
-
if (!result.message) {
|
|
68
|
-
result.message = `Stale git lock detected (${lockAgeMinutes} minutes old).`;
|
|
69
|
-
result.suggestion = 'Remove stale lock: rm .git/HEAD.lock';
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return result;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Format git lock error message
|
|
79
|
-
* @param {Object} lockStatus - Lock status from checkGitLock
|
|
80
|
-
* @returns {string} Formatted error message
|
|
81
|
-
*/
|
|
82
|
-
function formatGitLockError(lockStatus) {
|
|
83
|
-
if (!lockStatus.locked) {
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
let message = 'Git lock detected\n';
|
|
88
|
-
message += ` ${lockStatus.message}\n`;
|
|
89
|
-
|
|
90
|
-
if (lockStatus.lockFiles.length > 0) {
|
|
91
|
-
message += '\n Lock files:\n';
|
|
92
|
-
for (const lockFile of lockStatus.lockFiles) {
|
|
93
|
-
message += ` - ${lockFile.path} (${lockFile.age} minutes old)`;
|
|
94
|
-
if (lockFile.stale) {
|
|
95
|
-
message += ' [STALE]';
|
|
96
|
-
}
|
|
97
|
-
message += '\n';
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (lockStatus.suggestion) {
|
|
102
|
-
message += `\n ${lockStatus.suggestion}\n`;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (lockStatus.stale) {
|
|
106
|
-
message +=
|
|
107
|
-
'\n Warning: Removing stale locks may cause data loss if another process is actually running.\n';
|
|
108
|
-
message += ' Check for running git/editor processes before removing locks.\n';
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return message;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
module.exports = {
|
|
115
|
-
checkGitLock,
|
|
116
|
-
formatGitLockError,
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Gitignore Updater Utility
|
|
3
|
-
* Updates .gitignore to properly handle CAWS runtime files vs source files
|
|
4
|
-
* @author @darianrosebrook
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const fs = require('fs-extra');
|
|
8
|
-
const path = require('path');
|
|
9
|
-
const chalk = require('chalk');
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* CAWS .gitignore entries
|
|
13
|
-
*
|
|
14
|
-
* Strategy: Track shared/collaborative files, ignore local-only runtime data
|
|
15
|
-
*
|
|
16
|
-
* TRACKED (shared with team):
|
|
17
|
-
* - .caws/working-spec.yaml (main spec)
|
|
18
|
-
* - .caws/specs/*.yaml (feature specs)
|
|
19
|
-
* - .caws/policy.yaml (team policy)
|
|
20
|
-
* - .caws/waivers/*.yaml (project-wide waivers)
|
|
21
|
-
* - .caws/provenance/ (audit trails for compliance)
|
|
22
|
-
* - .caws/changes/ (change tracking for team visibility)
|
|
23
|
-
* - .caws/archive/ (archived changes for history)
|
|
24
|
-
* - .caws/plans/*.md (implementation plans)
|
|
25
|
-
*
|
|
26
|
-
* IGNORED (local-only):
|
|
27
|
-
* - .agent/ (agent runtime tracking, local to each developer)
|
|
28
|
-
* - Temporary files (*.tmp, *.bak)
|
|
29
|
-
* - Logs (caws.log, debug logs)
|
|
30
|
-
* - Local overrides (caws.local.*)
|
|
31
|
-
*/
|
|
32
|
-
const CAWS_GITIGNORE_ENTRIES = `
|
|
33
|
-
# CAWS Local Runtime Data (developer-specific, should not be tracked)
|
|
34
|
-
# ====================================================================
|
|
35
|
-
# Note: Specs, policy, waivers, provenance, and plans ARE tracked for team collaboration
|
|
36
|
-
# Only local agent tracking, generated tools, and temporary files are ignored
|
|
37
|
-
|
|
38
|
-
# Agent runtime tracking (local to each developer)
|
|
39
|
-
.agent/
|
|
40
|
-
|
|
41
|
-
# CAWS tools (now in .caws/tools/)
|
|
42
|
-
.caws/tools/
|
|
43
|
-
# Legacy location (for backward compatibility)
|
|
44
|
-
apps/tools/caws/
|
|
45
|
-
|
|
46
|
-
# Temporary CAWS files
|
|
47
|
-
**/*.caws.tmp
|
|
48
|
-
**/*.working-spec.bak
|
|
49
|
-
.caws/*.tmp
|
|
50
|
-
.caws/*.bak
|
|
51
|
-
|
|
52
|
-
# CAWS logs (local debugging)
|
|
53
|
-
caws-debug.log*
|
|
54
|
-
**/caws.log
|
|
55
|
-
.caws/*.log
|
|
56
|
-
|
|
57
|
-
# Local development overrides (developer-specific)
|
|
58
|
-
caws.local.*
|
|
59
|
-
.caws/local.*
|
|
60
|
-
|
|
61
|
-
# CAWS working state (runtime, not committed)
|
|
62
|
-
.caws/state/
|
|
63
|
-
|
|
64
|
-
# CAWS Worktrees (local, should not be tracked)
|
|
65
|
-
.caws/worktrees/
|
|
66
|
-
.caws/worktrees.json
|
|
67
|
-
|
|
68
|
-
# Session transcripts (generated by session-log hook)
|
|
69
|
-
tmp/
|
|
70
|
-
`;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Update .gitignore to include CAWS runtime file exclusions
|
|
74
|
-
* @param {string} projectRoot - Project root directory
|
|
75
|
-
* @param {Object} options - Options
|
|
76
|
-
* @param {boolean} options.force - Force update even if entries exist
|
|
77
|
-
* @returns {Promise<boolean>} Whether .gitignore was updated
|
|
78
|
-
*/
|
|
79
|
-
async function updateGitignore(projectRoot, options = {}) {
|
|
80
|
-
const { force = false } = options;
|
|
81
|
-
const gitignorePath = path.join(projectRoot, '.gitignore');
|
|
82
|
-
|
|
83
|
-
try {
|
|
84
|
-
// Read existing .gitignore or create empty
|
|
85
|
-
let existingContent = '';
|
|
86
|
-
if (await fs.pathExists(gitignorePath)) {
|
|
87
|
-
existingContent = await fs.readFile(gitignorePath, 'utf8');
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Check if CAWS entries already exist (check for either old or new header)
|
|
91
|
-
const hasCawsEntries =
|
|
92
|
-
existingContent.includes('# CAWS Local Runtime Data') ||
|
|
93
|
-
existingContent.includes('# CAWS Runtime Data');
|
|
94
|
-
|
|
95
|
-
if (hasCawsEntries && !force) {
|
|
96
|
-
// Already has CAWS entries, skip
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// If old entries exist, replace them with new ones
|
|
101
|
-
if (existingContent.includes('# CAWS Runtime Data') && force) {
|
|
102
|
-
// Remove old CAWS entries (between "# CAWS Runtime Data" and next major section)
|
|
103
|
-
const lines = existingContent.split('\n');
|
|
104
|
-
const startIndex = lines.findIndex((line) => line.includes('# CAWS Runtime Data'));
|
|
105
|
-
if (startIndex !== -1) {
|
|
106
|
-
// Find the end of CAWS section (next major section starting with #)
|
|
107
|
-
let endIndex = startIndex + 1;
|
|
108
|
-
while (
|
|
109
|
-
endIndex < lines.length &&
|
|
110
|
-
(lines[endIndex].trim() === '' ||
|
|
111
|
-
lines[endIndex].startsWith('#') ||
|
|
112
|
-
lines[endIndex].startsWith('.caws/') ||
|
|
113
|
-
lines[endIndex].startsWith('.agent/') ||
|
|
114
|
-
lines[endIndex].includes('caws') ||
|
|
115
|
-
lines[endIndex].includes('CAWS'))
|
|
116
|
-
) {
|
|
117
|
-
endIndex++;
|
|
118
|
-
}
|
|
119
|
-
// Remove old section and insert new one
|
|
120
|
-
const before = lines.slice(0, startIndex).join('\n');
|
|
121
|
-
const after = lines.slice(endIndex).join('\n');
|
|
122
|
-
existingContent = [before, after].filter(Boolean).join('\n');
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// Append CAWS entries
|
|
127
|
-
const updatedContent = existingContent.trim() + '\n' + CAWS_GITIGNORE_ENTRIES.trim() + '\n';
|
|
128
|
-
|
|
129
|
-
await fs.writeFile(gitignorePath, updatedContent, 'utf8');
|
|
130
|
-
|
|
131
|
-
return true;
|
|
132
|
-
} catch (error) {
|
|
133
|
-
console.warn(chalk.yellow(`Could not update .gitignore: ${error.message}`));
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Verify .gitignore has proper CAWS entries
|
|
140
|
-
* @param {string} projectRoot - Project root directory
|
|
141
|
-
* @returns {Promise<boolean>} Whether .gitignore has CAWS entries
|
|
142
|
-
*/
|
|
143
|
-
async function verifyGitignore(projectRoot) {
|
|
144
|
-
const gitignorePath = path.join(projectRoot, '.gitignore');
|
|
145
|
-
|
|
146
|
-
if (!(await fs.pathExists(gitignorePath))) {
|
|
147
|
-
return false;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const content = await fs.readFile(gitignorePath, 'utf8');
|
|
151
|
-
return content.includes('# CAWS Local Runtime Data') || content.includes('# CAWS Runtime Data');
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
module.exports = {
|
|
155
|
-
updateGitignore,
|
|
156
|
-
verifyGitignore,
|
|
157
|
-
CAWS_GITIGNORE_ENTRIES,
|
|
158
|
-
};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview IDE Detection and Selection Utilities
|
|
3
|
-
* Detects active IDEs from environment variables and provides
|
|
4
|
-
* selection/parsing helpers for the --ide CLI flag.
|
|
5
|
-
* @author @darianrosebrook
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const chalk = require('chalk');
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Registry of supported IDE integrations.
|
|
12
|
-
* Each entry maps an ID to its display name, description, and detection env vars.
|
|
13
|
-
*/
|
|
14
|
-
const IDE_REGISTRY = {
|
|
15
|
-
cursor: {
|
|
16
|
-
id: 'cursor',
|
|
17
|
-
name: 'Cursor',
|
|
18
|
-
description: 'AI-first IDE with hooks, rules, and audit logs',
|
|
19
|
-
envVars: ['CURSOR_TRACE_DIR'],
|
|
20
|
-
},
|
|
21
|
-
claude: {
|
|
22
|
-
id: 'claude',
|
|
23
|
-
name: 'Claude Code',
|
|
24
|
-
description: 'Claude Code with safety hooks and settings',
|
|
25
|
-
envVars: ['CLAUDE_PROJECT_DIR'],
|
|
26
|
-
},
|
|
27
|
-
vscode: {
|
|
28
|
-
id: 'vscode',
|
|
29
|
-
name: 'VS Code',
|
|
30
|
-
description: 'Visual Studio Code settings and debug configs',
|
|
31
|
-
envVars: ['VSCODE_PID', 'VSCODE_IPC_HOOK'],
|
|
32
|
-
},
|
|
33
|
-
intellij: {
|
|
34
|
-
id: 'intellij',
|
|
35
|
-
name: 'IntelliJ IDEA',
|
|
36
|
-
description: 'IntelliJ run configurations for CAWS',
|
|
37
|
-
envVars: ['IDEA_INITIAL_DIRECTORY'],
|
|
38
|
-
},
|
|
39
|
-
windsurf: {
|
|
40
|
-
id: 'windsurf',
|
|
41
|
-
name: 'Windsurf',
|
|
42
|
-
description: 'Windsurf workflow for CAWS-guided development',
|
|
43
|
-
envVars: ['WINDSURF_WORKSPACE'],
|
|
44
|
-
},
|
|
45
|
-
copilot: {
|
|
46
|
-
id: 'copilot',
|
|
47
|
-
name: 'GitHub Copilot',
|
|
48
|
-
description: 'GitHub Copilot CAWS integration instructions',
|
|
49
|
-
envVars: [], // No reliable env var; paired with vscode
|
|
50
|
-
},
|
|
51
|
-
junie: {
|
|
52
|
-
id: 'junie',
|
|
53
|
-
name: 'JetBrains Junie',
|
|
54
|
-
description: 'Junie AI agent guidelines for JetBrains IDEs',
|
|
55
|
-
envVars: [], // Paired with intellij
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const ALL_IDE_IDS = Object.keys(IDE_REGISTRY);
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Detect currently active IDEs from environment variables.
|
|
63
|
-
* @returns {string[]} Array of detected IDE identifiers
|
|
64
|
-
*/
|
|
65
|
-
function detectActiveIDEs() {
|
|
66
|
-
const detected = [];
|
|
67
|
-
for (const [id, config] of Object.entries(IDE_REGISTRY)) {
|
|
68
|
-
if (config.envVars.length > 0 && config.envVars.some((v) => process.env[v])) {
|
|
69
|
-
detected.push(id);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return detected;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Get recommended IDE set based on detection and natural pairings.
|
|
77
|
-
* - Cursor detected -> also recommend Claude Code
|
|
78
|
-
* - VS Code detected -> also recommend Copilot
|
|
79
|
-
* - Nothing detected -> default to cursor + claude (AI-first set)
|
|
80
|
-
* @returns {string[]} Array of recommended IDE identifiers
|
|
81
|
-
*/
|
|
82
|
-
function getRecommendedIDEs() {
|
|
83
|
-
const detected = detectActiveIDEs();
|
|
84
|
-
|
|
85
|
-
if (detected.length > 0) {
|
|
86
|
-
const recommended = new Set(detected);
|
|
87
|
-
if (detected.includes('cursor')) recommended.add('claude');
|
|
88
|
-
if (detected.includes('vscode')) recommended.add('copilot');
|
|
89
|
-
if (detected.includes('intellij')) recommended.add('junie');
|
|
90
|
-
return Array.from(recommended);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return ['cursor', 'claude'];
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Parse an IDE selection from a CLI flag value or prompt answer.
|
|
98
|
-
* @param {string|string[]} input - Comma-separated string or array of IDE ids
|
|
99
|
-
* @returns {string[]} Normalized, validated array of IDE identifiers
|
|
100
|
-
*/
|
|
101
|
-
function parseIDESelection(input) {
|
|
102
|
-
if (!input) return [];
|
|
103
|
-
|
|
104
|
-
let ids;
|
|
105
|
-
if (typeof input === 'string') {
|
|
106
|
-
ids = input.split(',').map((s) => s.trim().toLowerCase()).filter(Boolean);
|
|
107
|
-
} else if (Array.isArray(input)) {
|
|
108
|
-
ids = input.map((s) => String(s).trim().toLowerCase()).filter(Boolean);
|
|
109
|
-
} else {
|
|
110
|
-
return [];
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (ids.includes('all')) return [...ALL_IDE_IDS];
|
|
114
|
-
if (ids.includes('none')) return [];
|
|
115
|
-
|
|
116
|
-
const valid = ids.filter((id) => id in IDE_REGISTRY);
|
|
117
|
-
const invalid = ids.filter((id) => !(id in IDE_REGISTRY));
|
|
118
|
-
|
|
119
|
-
if (invalid.length > 0) {
|
|
120
|
-
console.warn(chalk.yellow(`Warning: Unknown IDE identifiers: ${invalid.join(', ')}`));
|
|
121
|
-
console.warn(chalk.blue(`Valid options: ${ALL_IDE_IDS.join(', ')}, all, none`));
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return valid;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
module.exports = {
|
|
128
|
-
IDE_REGISTRY,
|
|
129
|
-
ALL_IDE_IDS,
|
|
130
|
-
detectActiveIDEs,
|
|
131
|
-
getRecommendedIDEs,
|
|
132
|
-
parseIDESelection,
|
|
133
|
-
};
|