devflow-kit 0.8.1 → 1.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/CHANGELOG.md +185 -29
- package/LICENSE +1 -1
- package/README.md +179 -308
- package/dist/cli.js +3 -1
- package/dist/commands/init.d.ts +21 -0
- package/dist/commands/init.js +311 -575
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/list.js +20 -0
- package/dist/commands/uninstall.d.ts +10 -0
- package/dist/commands/uninstall.js +351 -78
- package/dist/plugins.d.ts +46 -0
- package/dist/plugins.js +162 -0
- package/dist/utils/cli.d.ts +5 -0
- package/dist/utils/cli.js +14 -0
- package/dist/utils/installer.d.ts +41 -0
- package/dist/utils/installer.js +177 -0
- package/dist/utils/paths.d.ts +10 -0
- package/dist/utils/paths.js +23 -3
- package/dist/utils/post-install.d.ts +68 -0
- package/dist/utils/post-install.js +427 -0
- package/dist/utils/safe-delete-install.d.ts +22 -0
- package/dist/utils/safe-delete-install.js +156 -0
- package/dist/utils/safe-delete.d.ts +12 -0
- package/dist/utils/safe-delete.js +83 -0
- package/package.json +18 -8
- package/plugins/devflow-audit-claude/.claude-plugin/plugin.json +7 -0
- package/plugins/devflow-audit-claude/README.md +46 -0
- package/plugins/devflow-audit-claude/agents/claude-md-auditor.md +134 -0
- package/plugins/devflow-audit-claude/commands/audit-claude.md +85 -0
- package/plugins/devflow-code-review/.claude-plugin/plugin.json +31 -0
- package/plugins/devflow-code-review/README.md +73 -0
- package/plugins/devflow-code-review/agents/git.md +272 -0
- package/plugins/devflow-code-review/agents/reviewer.md +119 -0
- package/plugins/devflow-code-review/agents/synthesizer.md +204 -0
- package/plugins/devflow-code-review/commands/code-review-teams.md +262 -0
- package/plugins/devflow-code-review/commands/code-review.md +141 -0
- package/plugins/devflow-code-review/skills/accessibility/SKILL.md +229 -0
- package/plugins/devflow-code-review/skills/accessibility/references/detection.md +171 -0
- package/plugins/devflow-code-review/skills/accessibility/references/patterns.md +670 -0
- package/plugins/devflow-code-review/skills/accessibility/references/violations.md +419 -0
- package/plugins/devflow-code-review/skills/agent-teams/SKILL.md +124 -0
- package/plugins/devflow-code-review/skills/agent-teams/references/cleanup.md +104 -0
- package/plugins/devflow-code-review/skills/agent-teams/references/communication.md +122 -0
- package/plugins/devflow-code-review/skills/agent-teams/references/team-patterns.md +217 -0
- package/plugins/devflow-code-review/skills/architecture-patterns/SKILL.md +153 -0
- package/plugins/devflow-code-review/skills/architecture-patterns/references/detection.md +337 -0
- package/plugins/devflow-code-review/skills/architecture-patterns/references/patterns.md +873 -0
- package/plugins/devflow-code-review/skills/architecture-patterns/references/violations.md +575 -0
- package/plugins/devflow-code-review/skills/complexity-patterns/SKILL.md +143 -0
- package/plugins/devflow-code-review/skills/complexity-patterns/references/detection.md +264 -0
- package/plugins/devflow-code-review/skills/complexity-patterns/references/patterns.md +487 -0
- package/plugins/devflow-code-review/skills/complexity-patterns/references/violations.md +361 -0
- package/plugins/devflow-code-review/skills/consistency-patterns/SKILL.md +140 -0
- package/plugins/devflow-code-review/skills/consistency-patterns/references/detection.md +207 -0
- package/plugins/devflow-code-review/skills/consistency-patterns/references/patterns.md +202 -0
- package/plugins/devflow-code-review/skills/consistency-patterns/references/violations.md +213 -0
- package/plugins/devflow-code-review/skills/database-patterns/SKILL.md +134 -0
- package/plugins/devflow-code-review/skills/database-patterns/references/detection.md +208 -0
- package/plugins/devflow-code-review/skills/database-patterns/references/patterns.md +394 -0
- package/plugins/devflow-code-review/skills/database-patterns/references/violations.md +332 -0
- package/plugins/devflow-code-review/skills/dependencies-patterns/SKILL.md +141 -0
- package/plugins/devflow-code-review/skills/dependencies-patterns/references/detection.md +181 -0
- package/plugins/devflow-code-review/skills/dependencies-patterns/references/patterns.md +225 -0
- package/plugins/devflow-code-review/skills/dependencies-patterns/references/violations.md +247 -0
- package/plugins/devflow-code-review/skills/documentation-patterns/SKILL.md +125 -0
- package/plugins/devflow-code-review/skills/documentation-patterns/references/detection.md +190 -0
- package/plugins/devflow-code-review/skills/documentation-patterns/references/patterns.md +189 -0
- package/plugins/devflow-code-review/skills/documentation-patterns/references/violations.md +163 -0
- package/plugins/devflow-code-review/skills/frontend-design/SKILL.md +254 -0
- package/plugins/devflow-code-review/skills/frontend-design/references/detection.md +184 -0
- package/plugins/devflow-code-review/skills/frontend-design/references/patterns.md +511 -0
- package/plugins/devflow-code-review/skills/frontend-design/references/violations.md +453 -0
- package/plugins/devflow-code-review/skills/performance-patterns/SKILL.md +154 -0
- package/plugins/devflow-code-review/skills/performance-patterns/references/detection.md +351 -0
- package/plugins/devflow-code-review/skills/performance-patterns/references/patterns.md +503 -0
- package/plugins/devflow-code-review/skills/performance-patterns/references/violations.md +354 -0
- package/plugins/devflow-code-review/skills/react/SKILL.md +276 -0
- package/plugins/devflow-code-review/skills/react/references/patterns.md +1331 -0
- package/plugins/devflow-code-review/skills/react/references/violations.md +565 -0
- package/plugins/devflow-code-review/skills/regression-patterns/SKILL.md +146 -0
- package/plugins/devflow-code-review/skills/regression-patterns/references/detection.md +237 -0
- package/plugins/devflow-code-review/skills/regression-patterns/references/patterns.md +226 -0
- package/plugins/devflow-code-review/skills/regression-patterns/references/violations.md +225 -0
- package/plugins/devflow-code-review/skills/review-methodology/SKILL.md +119 -0
- package/plugins/devflow-code-review/skills/review-methodology/references/patterns.md +186 -0
- package/plugins/devflow-code-review/skills/review-methodology/references/report-template.md +142 -0
- package/plugins/devflow-code-review/skills/review-methodology/references/violations.md +125 -0
- package/plugins/devflow-code-review/skills/security-patterns/SKILL.md +156 -0
- package/plugins/devflow-code-review/skills/security-patterns/references/detection.md +287 -0
- package/plugins/devflow-code-review/skills/security-patterns/references/patterns.md +507 -0
- package/plugins/devflow-code-review/skills/security-patterns/references/violations.md +237 -0
- package/plugins/devflow-code-review/skills/test-patterns/SKILL.md +183 -0
- package/plugins/devflow-code-review/skills/test-patterns/references/detection.md +149 -0
- package/plugins/devflow-code-review/skills/test-patterns/references/patterns.md +220 -0
- package/plugins/devflow-code-review/skills/test-patterns/references/report-template.md +108 -0
- package/plugins/devflow-code-review/skills/test-patterns/references/violations.md +221 -0
- package/plugins/devflow-core-skills/.claude-plugin/plugin.json +27 -0
- package/plugins/devflow-core-skills/README.md +50 -0
- package/plugins/devflow-core-skills/skills/accessibility/SKILL.md +229 -0
- package/plugins/devflow-core-skills/skills/accessibility/references/detection.md +171 -0
- package/plugins/devflow-core-skills/skills/accessibility/references/patterns.md +670 -0
- package/plugins/devflow-core-skills/skills/accessibility/references/violations.md +419 -0
- package/plugins/devflow-core-skills/skills/core-patterns/SKILL.md +162 -0
- package/plugins/devflow-core-skills/skills/core-patterns/references/checklist.md +276 -0
- package/plugins/devflow-core-skills/skills/core-patterns/references/code-smell-violations.md +144 -0
- package/plugins/devflow-core-skills/skills/core-patterns/references/detection.md +303 -0
- package/plugins/devflow-core-skills/skills/core-patterns/references/patterns.md +576 -0
- package/plugins/devflow-core-skills/skills/core-patterns/references/violations.md +369 -0
- package/plugins/devflow-core-skills/skills/docs-framework/SKILL.md +134 -0
- package/plugins/devflow-core-skills/skills/docs-framework/references/patterns.md +346 -0
- package/plugins/devflow-core-skills/skills/docs-framework/references/violations.md +221 -0
- package/plugins/devflow-core-skills/skills/frontend-design/SKILL.md +254 -0
- package/plugins/devflow-core-skills/skills/frontend-design/references/detection.md +184 -0
- package/plugins/devflow-core-skills/skills/frontend-design/references/patterns.md +511 -0
- package/plugins/devflow-core-skills/skills/frontend-design/references/violations.md +453 -0
- package/plugins/devflow-core-skills/skills/git-safety/SKILL.md +122 -0
- package/plugins/devflow-core-skills/skills/git-safety/references/detection.md +290 -0
- package/plugins/devflow-core-skills/skills/git-safety/references/patterns.md +289 -0
- package/plugins/devflow-core-skills/skills/git-safety/references/violations.md +18 -0
- package/plugins/devflow-core-skills/skills/git-workflow/SKILL.md +158 -0
- package/plugins/devflow-core-skills/skills/git-workflow/references/commit-patterns.md +115 -0
- package/plugins/devflow-core-skills/skills/git-workflow/references/commit-violations.md +77 -0
- package/plugins/devflow-core-skills/skills/git-workflow/references/pr-patterns.md +127 -0
- package/plugins/devflow-core-skills/skills/git-workflow/references/pr-violations.md +96 -0
- package/plugins/devflow-core-skills/skills/github-patterns/SKILL.md +153 -0
- package/plugins/devflow-core-skills/skills/github-patterns/references/patterns.md +572 -0
- package/plugins/devflow-core-skills/skills/github-patterns/references/violations.md +298 -0
- package/plugins/devflow-core-skills/skills/input-validation/SKILL.md +148 -0
- package/plugins/devflow-core-skills/skills/input-validation/references/detection.md +283 -0
- package/plugins/devflow-core-skills/skills/input-validation/references/patterns.md +361 -0
- package/plugins/devflow-core-skills/skills/input-validation/references/violations.md +224 -0
- package/plugins/devflow-core-skills/skills/react/SKILL.md +276 -0
- package/plugins/devflow-core-skills/skills/react/references/patterns.md +1331 -0
- package/plugins/devflow-core-skills/skills/react/references/violations.md +565 -0
- package/plugins/devflow-core-skills/skills/test-patterns/SKILL.md +183 -0
- package/plugins/devflow-core-skills/skills/test-patterns/references/detection.md +149 -0
- package/plugins/devflow-core-skills/skills/test-patterns/references/patterns.md +220 -0
- package/plugins/devflow-core-skills/skills/test-patterns/references/report-template.md +108 -0
- package/plugins/devflow-core-skills/skills/test-patterns/references/violations.md +221 -0
- package/plugins/devflow-core-skills/skills/typescript/SKILL.md +176 -0
- package/plugins/devflow-core-skills/skills/typescript/references/patterns.md +1105 -0
- package/plugins/devflow-core-skills/skills/typescript/references/violations.md +433 -0
- package/plugins/devflow-debug/.claude-plugin/plugin.json +18 -0
- package/plugins/devflow-debug/README.md +65 -0
- package/plugins/devflow-debug/agents/git.md +272 -0
- package/plugins/devflow-debug/commands/debug-teams.md +231 -0
- package/plugins/devflow-debug/commands/debug.md +160 -0
- package/plugins/devflow-debug/skills/agent-teams/SKILL.md +124 -0
- package/plugins/devflow-debug/skills/agent-teams/references/cleanup.md +104 -0
- package/plugins/devflow-debug/skills/agent-teams/references/communication.md +122 -0
- package/plugins/devflow-debug/skills/agent-teams/references/team-patterns.md +217 -0
- package/plugins/devflow-debug/skills/git-safety/SKILL.md +122 -0
- package/plugins/devflow-debug/skills/git-safety/references/detection.md +290 -0
- package/plugins/devflow-debug/skills/git-safety/references/patterns.md +289 -0
- package/plugins/devflow-debug/skills/git-safety/references/violations.md +18 -0
- package/plugins/devflow-implement/.claude-plugin/plugin.json +21 -0
- package/plugins/devflow-implement/README.md +71 -0
- package/plugins/devflow-implement/agents/coder.md +122 -0
- package/plugins/devflow-implement/agents/git.md +272 -0
- package/plugins/devflow-implement/agents/scrutinizer.md +80 -0
- package/plugins/devflow-implement/agents/shepherd.md +94 -0
- package/plugins/devflow-implement/agents/simplifier.md +62 -0
- package/plugins/devflow-implement/agents/skimmer.md +88 -0
- package/plugins/devflow-implement/agents/synthesizer.md +204 -0
- package/plugins/devflow-implement/agents/validator.md +86 -0
- package/plugins/devflow-implement/commands/implement-teams.md +608 -0
- package/plugins/devflow-implement/commands/implement.md +426 -0
- package/plugins/devflow-implement/skills/accessibility/SKILL.md +229 -0
- package/plugins/devflow-implement/skills/accessibility/references/detection.md +171 -0
- package/plugins/devflow-implement/skills/accessibility/references/patterns.md +670 -0
- package/plugins/devflow-implement/skills/accessibility/references/violations.md +419 -0
- package/plugins/devflow-implement/skills/agent-teams/SKILL.md +124 -0
- package/plugins/devflow-implement/skills/agent-teams/references/cleanup.md +104 -0
- package/plugins/devflow-implement/skills/agent-teams/references/communication.md +122 -0
- package/plugins/devflow-implement/skills/agent-teams/references/team-patterns.md +217 -0
- package/plugins/devflow-implement/skills/frontend-design/SKILL.md +254 -0
- package/plugins/devflow-implement/skills/frontend-design/references/detection.md +184 -0
- package/plugins/devflow-implement/skills/frontend-design/references/patterns.md +511 -0
- package/plugins/devflow-implement/skills/frontend-design/references/violations.md +453 -0
- package/plugins/devflow-implement/skills/implementation-patterns/SKILL.md +162 -0
- package/plugins/devflow-implement/skills/implementation-patterns/references/patterns.md +1063 -0
- package/plugins/devflow-implement/skills/implementation-patterns/references/violations.md +483 -0
- package/plugins/devflow-implement/skills/self-review/SKILL.md +149 -0
- package/plugins/devflow-implement/skills/self-review/references/patterns.md +405 -0
- package/plugins/devflow-implement/skills/self-review/references/report-template.md +253 -0
- package/plugins/devflow-implement/skills/self-review/references/violations.md +308 -0
- package/plugins/devflow-resolve/.claude-plugin/plugin.json +19 -0
- package/plugins/devflow-resolve/README.md +65 -0
- package/plugins/devflow-resolve/agents/git.md +272 -0
- package/plugins/devflow-resolve/agents/resolver.md +131 -0
- package/plugins/devflow-resolve/agents/simplifier.md +62 -0
- package/plugins/devflow-resolve/commands/resolve-teams.md +298 -0
- package/plugins/devflow-resolve/commands/resolve.md +237 -0
- package/plugins/devflow-resolve/skills/agent-teams/SKILL.md +124 -0
- package/plugins/devflow-resolve/skills/agent-teams/references/cleanup.md +104 -0
- package/plugins/devflow-resolve/skills/agent-teams/references/communication.md +122 -0
- package/plugins/devflow-resolve/skills/agent-teams/references/team-patterns.md +217 -0
- package/plugins/devflow-resolve/skills/implementation-patterns/SKILL.md +162 -0
- package/plugins/devflow-resolve/skills/implementation-patterns/references/patterns.md +1063 -0
- package/plugins/devflow-resolve/skills/implementation-patterns/references/violations.md +483 -0
- package/plugins/devflow-resolve/skills/security-patterns/SKILL.md +156 -0
- package/plugins/devflow-resolve/skills/security-patterns/references/detection.md +287 -0
- package/plugins/devflow-resolve/skills/security-patterns/references/patterns.md +507 -0
- package/plugins/devflow-resolve/skills/security-patterns/references/violations.md +237 -0
- package/plugins/devflow-self-review/.claude-plugin/plugin.json +7 -0
- package/plugins/devflow-self-review/README.md +38 -0
- package/plugins/devflow-self-review/agents/scrutinizer.md +80 -0
- package/plugins/devflow-self-review/agents/simplifier.md +62 -0
- package/plugins/devflow-self-review/agents/validator.md +86 -0
- package/plugins/devflow-self-review/commands/self-review.md +126 -0
- package/plugins/devflow-self-review/skills/core-patterns/SKILL.md +162 -0
- package/plugins/devflow-self-review/skills/core-patterns/references/checklist.md +276 -0
- package/plugins/devflow-self-review/skills/core-patterns/references/code-smell-violations.md +144 -0
- package/plugins/devflow-self-review/skills/core-patterns/references/detection.md +303 -0
- package/plugins/devflow-self-review/skills/core-patterns/references/patterns.md +576 -0
- package/plugins/devflow-self-review/skills/core-patterns/references/violations.md +369 -0
- package/plugins/devflow-self-review/skills/self-review/SKILL.md +149 -0
- package/plugins/devflow-self-review/skills/self-review/references/patterns.md +405 -0
- package/plugins/devflow-self-review/skills/self-review/references/report-template.md +253 -0
- package/plugins/devflow-self-review/skills/self-review/references/violations.md +308 -0
- package/plugins/devflow-specify/.claude-plugin/plugin.json +15 -0
- package/plugins/devflow-specify/README.md +46 -0
- package/plugins/devflow-specify/agents/skimmer.md +88 -0
- package/plugins/devflow-specify/agents/synthesizer.md +204 -0
- package/plugins/devflow-specify/commands/specify-teams.md +314 -0
- package/plugins/devflow-specify/commands/specify.md +179 -0
- package/plugins/devflow-specify/skills/agent-teams/SKILL.md +124 -0
- package/plugins/devflow-specify/skills/agent-teams/references/cleanup.md +104 -0
- package/plugins/devflow-specify/skills/agent-teams/references/communication.md +122 -0
- package/plugins/devflow-specify/skills/agent-teams/references/team-patterns.md +217 -0
- package/scripts/hooks/background-memory-update.sh +167 -0
- package/scripts/hooks/pre-compact-memory.sh +81 -0
- package/scripts/hooks/session-start-memory.sh +84 -0
- package/scripts/hooks/stop-update-memory.sh +81 -0
- package/shared/agents/coder.md +122 -0
- package/shared/agents/git.md +272 -0
- package/shared/agents/resolver.md +131 -0
- package/shared/agents/reviewer.md +119 -0
- package/shared/agents/scrutinizer.md +80 -0
- package/shared/agents/shepherd.md +94 -0
- package/shared/agents/simplifier.md +62 -0
- package/shared/agents/skimmer.md +88 -0
- package/shared/agents/synthesizer.md +204 -0
- package/shared/agents/validator.md +86 -0
- package/shared/skills/accessibility/SKILL.md +229 -0
- package/shared/skills/accessibility/references/detection.md +171 -0
- package/shared/skills/accessibility/references/patterns.md +670 -0
- package/shared/skills/accessibility/references/violations.md +419 -0
- package/shared/skills/agent-teams/SKILL.md +124 -0
- package/shared/skills/agent-teams/references/cleanup.md +104 -0
- package/shared/skills/agent-teams/references/communication.md +122 -0
- package/shared/skills/agent-teams/references/team-patterns.md +217 -0
- package/shared/skills/architecture-patterns/SKILL.md +153 -0
- package/shared/skills/architecture-patterns/references/detection.md +337 -0
- package/shared/skills/architecture-patterns/references/patterns.md +873 -0
- package/shared/skills/architecture-patterns/references/violations.md +575 -0
- package/shared/skills/complexity-patterns/SKILL.md +143 -0
- package/shared/skills/complexity-patterns/references/detection.md +264 -0
- package/shared/skills/complexity-patterns/references/patterns.md +487 -0
- package/shared/skills/complexity-patterns/references/violations.md +361 -0
- package/shared/skills/consistency-patterns/SKILL.md +140 -0
- package/shared/skills/consistency-patterns/references/detection.md +207 -0
- package/shared/skills/consistency-patterns/references/patterns.md +202 -0
- package/shared/skills/consistency-patterns/references/violations.md +213 -0
- package/shared/skills/core-patterns/SKILL.md +162 -0
- package/shared/skills/core-patterns/references/checklist.md +276 -0
- package/shared/skills/core-patterns/references/code-smell-violations.md +144 -0
- package/shared/skills/core-patterns/references/detection.md +303 -0
- package/shared/skills/core-patterns/references/patterns.md +576 -0
- package/shared/skills/core-patterns/references/violations.md +369 -0
- package/shared/skills/database-patterns/SKILL.md +134 -0
- package/shared/skills/database-patterns/references/detection.md +208 -0
- package/shared/skills/database-patterns/references/patterns.md +394 -0
- package/shared/skills/database-patterns/references/violations.md +332 -0
- package/shared/skills/dependencies-patterns/SKILL.md +141 -0
- package/shared/skills/dependencies-patterns/references/detection.md +181 -0
- package/shared/skills/dependencies-patterns/references/patterns.md +225 -0
- package/shared/skills/dependencies-patterns/references/violations.md +247 -0
- package/shared/skills/docs-framework/SKILL.md +134 -0
- package/shared/skills/docs-framework/references/patterns.md +346 -0
- package/shared/skills/docs-framework/references/violations.md +221 -0
- package/shared/skills/documentation-patterns/SKILL.md +125 -0
- package/shared/skills/documentation-patterns/references/detection.md +190 -0
- package/shared/skills/documentation-patterns/references/patterns.md +189 -0
- package/shared/skills/documentation-patterns/references/violations.md +163 -0
- package/shared/skills/frontend-design/SKILL.md +254 -0
- package/shared/skills/frontend-design/references/detection.md +184 -0
- package/shared/skills/frontend-design/references/patterns.md +511 -0
- package/shared/skills/frontend-design/references/violations.md +453 -0
- package/shared/skills/git-safety/SKILL.md +122 -0
- package/shared/skills/git-safety/references/detection.md +290 -0
- package/shared/skills/git-safety/references/patterns.md +289 -0
- package/shared/skills/git-safety/references/violations.md +18 -0
- package/shared/skills/git-workflow/SKILL.md +158 -0
- package/shared/skills/git-workflow/references/commit-patterns.md +115 -0
- package/shared/skills/git-workflow/references/commit-violations.md +77 -0
- package/shared/skills/git-workflow/references/pr-patterns.md +127 -0
- package/shared/skills/git-workflow/references/pr-violations.md +96 -0
- package/shared/skills/github-patterns/SKILL.md +153 -0
- package/shared/skills/github-patterns/references/patterns.md +572 -0
- package/shared/skills/github-patterns/references/violations.md +298 -0
- package/shared/skills/implementation-patterns/SKILL.md +162 -0
- package/shared/skills/implementation-patterns/references/patterns.md +1063 -0
- package/shared/skills/implementation-patterns/references/violations.md +483 -0
- package/shared/skills/input-validation/SKILL.md +148 -0
- package/shared/skills/input-validation/references/detection.md +283 -0
- package/shared/skills/input-validation/references/patterns.md +361 -0
- package/shared/skills/input-validation/references/violations.md +224 -0
- package/shared/skills/performance-patterns/SKILL.md +154 -0
- package/shared/skills/performance-patterns/references/detection.md +351 -0
- package/shared/skills/performance-patterns/references/patterns.md +503 -0
- package/shared/skills/performance-patterns/references/violations.md +354 -0
- package/shared/skills/react/SKILL.md +276 -0
- package/shared/skills/react/references/patterns.md +1331 -0
- package/shared/skills/react/references/violations.md +565 -0
- package/shared/skills/regression-patterns/SKILL.md +146 -0
- package/shared/skills/regression-patterns/references/detection.md +237 -0
- package/shared/skills/regression-patterns/references/patterns.md +226 -0
- package/shared/skills/regression-patterns/references/violations.md +225 -0
- package/shared/skills/review-methodology/SKILL.md +119 -0
- package/shared/skills/review-methodology/references/patterns.md +186 -0
- package/shared/skills/review-methodology/references/report-template.md +142 -0
- package/shared/skills/review-methodology/references/violations.md +125 -0
- package/shared/skills/security-patterns/SKILL.md +156 -0
- package/shared/skills/security-patterns/references/detection.md +287 -0
- package/shared/skills/security-patterns/references/patterns.md +507 -0
- package/shared/skills/security-patterns/references/violations.md +237 -0
- package/shared/skills/self-review/SKILL.md +149 -0
- package/shared/skills/self-review/references/patterns.md +405 -0
- package/shared/skills/self-review/references/report-template.md +253 -0
- package/shared/skills/self-review/references/violations.md +308 -0
- package/shared/skills/test-patterns/SKILL.md +183 -0
- package/shared/skills/test-patterns/references/detection.md +149 -0
- package/shared/skills/test-patterns/references/patterns.md +220 -0
- package/shared/skills/test-patterns/references/report-template.md +108 -0
- package/shared/skills/test-patterns/references/violations.md +221 -0
- package/shared/skills/typescript/SKILL.md +176 -0
- package/shared/skills/typescript/references/patterns.md +1105 -0
- package/shared/skills/typescript/references/violations.md +433 -0
- package/src/templates/claudeignore.template +188 -0
- package/src/templates/managed-settings.json +146 -0
- package/src/templates/settings.json +59 -0
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/uninstall.d.ts.map +0 -1
- package/dist/commands/uninstall.js.map +0 -1
- package/dist/utils/git.d.ts.map +0 -1
- package/dist/utils/git.js.map +0 -1
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js.map +0 -1
- package/src/claude/CLAUDE.md +0 -400
- package/src/claude/agents/devflow/audit-architecture.md +0 -132
- package/src/claude/agents/devflow/audit-complexity.md +0 -132
- package/src/claude/agents/devflow/audit-database.md +0 -132
- package/src/claude/agents/devflow/audit-dependencies.md +0 -132
- package/src/claude/agents/devflow/audit-documentation.md +0 -132
- package/src/claude/agents/devflow/audit-performance.md +0 -256
- package/src/claude/agents/devflow/audit-security.md +0 -259
- package/src/claude/agents/devflow/audit-tests.md +0 -132
- package/src/claude/agents/devflow/audit-typescript.md +0 -132
- package/src/claude/agents/devflow/brainstorm.md +0 -279
- package/src/claude/agents/devflow/catch-up.md +0 -345
- package/src/claude/agents/devflow/code-review.md +0 -307
- package/src/claude/agents/devflow/commit.md +0 -380
- package/src/claude/agents/devflow/debug.md +0 -476
- package/src/claude/agents/devflow/design.md +0 -491
- package/src/claude/agents/devflow/pr-comments.md +0 -285
- package/src/claude/agents/devflow/project-state.md +0 -419
- package/src/claude/agents/devflow/pull-request.md +0 -423
- package/src/claude/agents/devflow/release.md +0 -1137
- package/src/claude/agents/devflow/tech-debt.md +0 -338
- package/src/claude/commands/devflow/brainstorm.md +0 -68
- package/src/claude/commands/devflow/breakdown.md +0 -125
- package/src/claude/commands/devflow/catch-up.md +0 -29
- package/src/claude/commands/devflow/code-review.md +0 -237
- package/src/claude/commands/devflow/commit.md +0 -17
- package/src/claude/commands/devflow/debug.md +0 -56
- package/src/claude/commands/devflow/design.md +0 -82
- package/src/claude/commands/devflow/devlog.md +0 -408
- package/src/claude/commands/devflow/implement.md +0 -100
- package/src/claude/commands/devflow/plan.md +0 -223
- package/src/claude/commands/devflow/pull-request.md +0 -269
- package/src/claude/commands/devflow/release.md +0 -251
- package/src/claude/commands/devflow/resolve-comments.md +0 -583
- package/src/claude/scripts/statusline.sh +0 -47
- package/src/claude/settings.json +0 -6
- package/src/claude/skills/devflow/code-smell/SKILL.md +0 -428
- package/src/claude/skills/devflow/debug/SKILL.md +0 -119
- package/src/claude/skills/devflow/error-handling/SKILL.md +0 -597
- package/src/claude/skills/devflow/input-validation/SKILL.md +0 -514
- package/src/claude/skills/devflow/pattern-check/SKILL.md +0 -238
- package/src/claude/skills/devflow/research/SKILL.md +0 -138
- package/src/claude/skills/devflow/test-design/SKILL.md +0 -384
package/dist/commands/init.js
CHANGED
|
@@ -3,125 +3,60 @@ import { promises as fs } from 'fs';
|
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import { dirname } from 'path';
|
|
6
|
-
import * as
|
|
6
|
+
import * as p from '@clack/prompts';
|
|
7
|
+
import color from 'picocolors';
|
|
7
8
|
import { getInstallationPaths } from '../utils/paths.js';
|
|
8
9
|
import { getGitRoot } from '../utils/git.js';
|
|
10
|
+
import { isClaudeCliAvailable } from '../utils/cli.js';
|
|
11
|
+
import { installViaCli, installViaFileCopy } from '../utils/installer.js';
|
|
12
|
+
import { installSettings, installManagedSettings, installClaudeignore, updateGitignore, createDocsStructure, } from '../utils/post-install.js';
|
|
13
|
+
import { DEVFLOW_PLUGINS, LEGACY_SKILL_NAMES, LEGACY_COMMAND_NAMES, buildAssetMaps } from '../plugins.js';
|
|
14
|
+
import { detectPlatform, detectShell, getProfilePath, getSafeDeleteInfo, hasSafeDelete } from '../utils/safe-delete.js';
|
|
15
|
+
import { generateSafeDeleteBlock, isAlreadyInstalled, installToProfile } from '../utils/safe-delete-install.js';
|
|
16
|
+
// Re-export pure functions for tests (canonical source is post-install.ts)
|
|
17
|
+
export { substituteSettingsTemplate, computeGitignoreAppend, applyTeamsConfig, stripTeamsConfig, mergeDenyList } from '../utils/post-install.js';
|
|
9
18
|
const __filename = fileURLToPath(import.meta.url);
|
|
10
19
|
const __dirname = dirname(__filename);
|
|
11
|
-
function isNodeSystemError(error) {
|
|
12
|
-
return (error instanceof Error &&
|
|
13
|
-
'code' in error &&
|
|
14
|
-
typeof error.code === 'string');
|
|
15
|
-
}
|
|
16
20
|
/**
|
|
17
|
-
*
|
|
21
|
+
* Parse a comma-separated plugin selection string into normalized plugin names.
|
|
22
|
+
* Validates against known plugins; returns invalid names as errors.
|
|
18
23
|
*/
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
return new Promise((resolve) => {
|
|
25
|
-
rl.question(question, (answer) => {
|
|
26
|
-
rl.close();
|
|
27
|
-
resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes');
|
|
28
|
-
});
|
|
24
|
+
export function parsePluginSelection(input, validPlugins) {
|
|
25
|
+
const selected = input.split(',').map(p => {
|
|
26
|
+
const trimmed = p.trim();
|
|
27
|
+
return trimmed.startsWith('devflow-') ? trimmed : `devflow-${trimmed}`;
|
|
29
28
|
});
|
|
29
|
+
const validNames = validPlugins.map(p => p.name);
|
|
30
|
+
const invalid = selected.filter(p => !validNames.includes(p));
|
|
31
|
+
return { selected, invalid };
|
|
30
32
|
}
|
|
31
33
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*/
|
|
35
|
-
const DEVFLOW_COMMANDS = [
|
|
36
|
-
{ name: '/catch-up', description: 'Get up to speed on project state' },
|
|
37
|
-
{ name: '/brainstorm', description: 'Explore design decisions' },
|
|
38
|
-
{ name: '/design', description: 'Create implementation plan' },
|
|
39
|
-
{ name: '/plan', description: 'Triage issues from discussion' },
|
|
40
|
-
{ name: '/breakdown', description: 'Break down tasks quickly' },
|
|
41
|
-
{ name: '/implement', description: 'Interactive implementation' },
|
|
42
|
-
{ name: '/code-review', description: 'Comprehensive code review' },
|
|
43
|
-
{ name: '/commit', description: 'Smart atomic commits' },
|
|
44
|
-
{ name: '/pull-request', description: 'Create PR with description' },
|
|
45
|
-
{ name: '/release', description: 'Automated releases' },
|
|
46
|
-
{ name: '/devlog', description: 'Document session progress' },
|
|
47
|
-
{ name: '/debug', description: 'Systematic debugging' },
|
|
48
|
-
{ name: '/resolve-comments', description: 'Address PR feedback' },
|
|
49
|
-
];
|
|
50
|
-
/**
|
|
51
|
-
* DevFlow skills with descriptions.
|
|
52
|
-
* Displayed only in verbose mode to show auto-activating capabilities.
|
|
53
|
-
*/
|
|
54
|
-
const DEVFLOW_SKILLS = [
|
|
55
|
-
{ name: 'pattern-check', description: 'Architectural pattern validation' },
|
|
56
|
-
{ name: 'test-design', description: 'Test quality enforcement' },
|
|
57
|
-
{ name: 'code-smell', description: 'Anti-pattern detection' },
|
|
58
|
-
{ name: 'research', description: 'Pre-implementation planning (auto)' },
|
|
59
|
-
{ name: 'debug', description: 'Systematic debugging (auto)' },
|
|
60
|
-
{ name: 'input-validation', description: 'Boundary validation' },
|
|
61
|
-
{ name: 'error-handling', description: 'Result type consistency' },
|
|
62
|
-
];
|
|
63
|
-
/**
|
|
64
|
-
* Render clean, minimal output for default (non-verbose) mode.
|
|
65
|
-
* Shows only essential information: version, available commands, and docs link.
|
|
66
|
-
*
|
|
67
|
-
* @param version - The DevFlow version string to display
|
|
34
|
+
* Build the list of configuration extras available for the given scope/git context.
|
|
35
|
+
* Pure function — no I/O, no side effects.
|
|
68
36
|
*/
|
|
69
|
-
function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const padding = ' '.repeat(maxLen - cmd.name.length + 2);
|
|
76
|
-
console.log(` ${cmd.name}${padding}${cmd.description}`);
|
|
77
|
-
}
|
|
78
|
-
console.log('\nRun any command in Claude Code to get started.');
|
|
79
|
-
console.log('\nDocs: https://github.com/dean0x/devflow');
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Render detailed output for verbose mode.
|
|
83
|
-
* Shows full installation details including paths, merge instructions, and skills.
|
|
84
|
-
*
|
|
85
|
-
* @param version - The DevFlow version string to display
|
|
86
|
-
* @param scope - Installation scope ('user' for user-wide, 'local' for project-only)
|
|
87
|
-
* @param claudeDir - Path to the Claude Code directory
|
|
88
|
-
* @param devflowDir - Path to the DevFlow directory
|
|
89
|
-
* @param settingsExists - Whether existing settings.json was preserved
|
|
90
|
-
* @param claudeMdExists - Whether existing CLAUDE.md was preserved
|
|
91
|
-
*/
|
|
92
|
-
function renderVerboseOutput(version, scope, claudeDir, devflowDir, settingsExists, claudeMdExists) {
|
|
93
|
-
console.log(`\n✅ DevFlow v${version} installed!\n`);
|
|
94
|
-
console.log(`📍 Installation scope: ${scope}`);
|
|
95
|
-
console.log(` Claude dir: ${claudeDir}`);
|
|
96
|
-
console.log(` DevFlow dir: ${devflowDir}\n`);
|
|
97
|
-
// Show manual merge instructions if needed
|
|
98
|
-
if (settingsExists || claudeMdExists) {
|
|
99
|
-
console.log('📝 Manual merge recommended:\n');
|
|
100
|
-
if (settingsExists) {
|
|
101
|
-
console.log(' Settings: Review settings.devflow.json and merge desired config into settings.json');
|
|
102
|
-
console.log(' Key setting: statusLine configuration for DevFlow statusline\n');
|
|
103
|
-
}
|
|
104
|
-
if (claudeMdExists) {
|
|
105
|
-
console.log(' Instructions: Review CLAUDE.devflow.md and adopt desired practices');
|
|
106
|
-
console.log(" This contains DevFlow's recommended development patterns\n");
|
|
107
|
-
}
|
|
37
|
+
export function buildExtrasOptions(scope, gitRoot) {
|
|
38
|
+
const options = [
|
|
39
|
+
{ value: 'settings', label: 'Settings & Working Memory', hint: 'Model defaults, session memory hooks, status line' },
|
|
40
|
+
];
|
|
41
|
+
if (gitRoot) {
|
|
42
|
+
options.push({ value: 'claudeignore', label: '.claudeignore', hint: 'Exclude secrets, deps, build artifacts from Claude context' });
|
|
108
43
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
console.log(` ${cmd.name.padEnd(18)}${cmd.description}`);
|
|
44
|
+
if (scope === 'local' && gitRoot) {
|
|
45
|
+
options.push({ value: 'gitignore', label: '.gitignore entries', hint: 'Add .claude/ and .devflow/ to .gitignore' });
|
|
112
46
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
console.log(` ${skill.name.padEnd(18)}${skill.description}`);
|
|
47
|
+
if (scope === 'local') {
|
|
48
|
+
options.push({ value: 'docs', label: '.docs/ directory', hint: 'Review reports, dev logs, status tracking for this project' });
|
|
116
49
|
}
|
|
117
|
-
|
|
118
|
-
|
|
50
|
+
options.push({ value: 'safe-delete', label: 'Safe-delete (rm → trash)', hint: 'Override rm to use trash CLI — prevents accidental deletion' });
|
|
51
|
+
return options;
|
|
119
52
|
}
|
|
120
53
|
export const initCommand = new Command('init')
|
|
121
54
|
.description('Initialize DevFlow for Claude Code')
|
|
122
|
-
.option('--
|
|
123
|
-
.option('--scope <type>', 'Installation scope: user (user-wide) or local (project-only)', /^(user|local)$/i)
|
|
55
|
+
.option('--scope <type>', 'Installation scope: user or local (project-only)', /^(user|local)$/i)
|
|
124
56
|
.option('--verbose', 'Show detailed installation output')
|
|
57
|
+
.option('--plugin <names>', 'Install specific plugin(s), comma-separated (e.g., implement,code-review)')
|
|
58
|
+
.option('--teams', 'Enable Agent Teams (peer debate, adversarial review)')
|
|
59
|
+
.option('--no-teams', 'Disable Agent Teams (use parallel subagents instead)')
|
|
125
60
|
.action(async (options) => {
|
|
126
61
|
// Get package version
|
|
127
62
|
const packageJsonPath = path.resolve(__dirname, '../../package.json');
|
|
@@ -134,68 +69,109 @@ export const initCommand = new Command('init')
|
|
|
134
69
|
version = 'unknown';
|
|
135
70
|
}
|
|
136
71
|
const verbose = options.verbose ?? false;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
72
|
+
// Start the CLI flow
|
|
73
|
+
p.intro(color.bgCyan(color.black(` DevFlow v${version} `)));
|
|
140
74
|
// Determine installation scope
|
|
141
|
-
let scope = 'user';
|
|
75
|
+
let scope = 'user';
|
|
142
76
|
if (options.scope) {
|
|
143
77
|
const normalizedScope = options.scope.toLowerCase();
|
|
144
|
-
// Runtime validation (Commander regex already validates, but be defensive)
|
|
145
78
|
if (normalizedScope !== 'user' && normalizedScope !== 'local') {
|
|
146
|
-
|
|
79
|
+
p.log.error('Invalid scope. Use "user" or "local"');
|
|
147
80
|
process.exit(1);
|
|
148
81
|
}
|
|
149
82
|
scope = normalizedScope;
|
|
150
83
|
}
|
|
84
|
+
else if (!process.stdin.isTTY) {
|
|
85
|
+
p.log.info('Non-interactive mode detected, using scope: user');
|
|
86
|
+
scope = 'user';
|
|
87
|
+
}
|
|
151
88
|
else {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
89
|
+
const selected = await p.select({
|
|
90
|
+
message: 'Installation scope',
|
|
91
|
+
options: [
|
|
92
|
+
{ value: 'user', label: 'User', hint: 'all projects (~/.claude/)' },
|
|
93
|
+
{ value: 'local', label: 'Local', hint: 'this project only (./.claude/)' },
|
|
94
|
+
],
|
|
95
|
+
});
|
|
96
|
+
if (p.isCancel(selected)) {
|
|
97
|
+
p.cancel('Installation cancelled.');
|
|
98
|
+
process.exit(0);
|
|
160
99
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
console.log();
|
|
195
|
-
}
|
|
100
|
+
scope = selected;
|
|
101
|
+
}
|
|
102
|
+
// Select plugins to install
|
|
103
|
+
let selectedPlugins = [];
|
|
104
|
+
if (options.plugin) {
|
|
105
|
+
const { selected, invalid } = parsePluginSelection(options.plugin, DEVFLOW_PLUGINS);
|
|
106
|
+
selectedPlugins = selected;
|
|
107
|
+
if (invalid.length > 0) {
|
|
108
|
+
p.log.error(`Unknown plugin(s): ${invalid.join(', ')}`);
|
|
109
|
+
p.log.info(`Valid plugins: ${DEVFLOW_PLUGINS.map(pl => pl.name).join(', ')}`);
|
|
110
|
+
process.exit(1);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else if (process.stdin.isTTY) {
|
|
114
|
+
const choices = DEVFLOW_PLUGINS
|
|
115
|
+
.filter(pl => pl.name !== 'devflow-core-skills')
|
|
116
|
+
.map(pl => ({
|
|
117
|
+
value: pl.name,
|
|
118
|
+
label: pl.name.replace('devflow-', ''),
|
|
119
|
+
hint: pl.description + (pl.optional ? ' (optional)' : ''),
|
|
120
|
+
}));
|
|
121
|
+
const preSelected = DEVFLOW_PLUGINS
|
|
122
|
+
.filter(pl => !pl.optional && pl.name !== 'devflow-core-skills')
|
|
123
|
+
.map(pl => pl.name);
|
|
124
|
+
const pluginSelection = await p.multiselect({
|
|
125
|
+
message: 'Select plugins to install',
|
|
126
|
+
options: choices,
|
|
127
|
+
initialValues: preSelected,
|
|
128
|
+
required: true,
|
|
129
|
+
});
|
|
130
|
+
if (p.isCancel(pluginSelection)) {
|
|
131
|
+
p.cancel('Installation cancelled.');
|
|
132
|
+
process.exit(0);
|
|
196
133
|
}
|
|
134
|
+
selectedPlugins = pluginSelection;
|
|
197
135
|
}
|
|
198
|
-
//
|
|
136
|
+
// Agent Teams variant selection
|
|
137
|
+
let teamsEnabled;
|
|
138
|
+
if (options.teams !== undefined) {
|
|
139
|
+
teamsEnabled = options.teams;
|
|
140
|
+
}
|
|
141
|
+
else if (!process.stdin.isTTY) {
|
|
142
|
+
teamsEnabled = false;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
const teamsChoice = await p.confirm({
|
|
146
|
+
message: 'Enable Agent Teams? (peer debate in review, exploration, debugging)',
|
|
147
|
+
initialValue: false,
|
|
148
|
+
});
|
|
149
|
+
if (p.isCancel(teamsChoice)) {
|
|
150
|
+
p.cancel('Installation cancelled.');
|
|
151
|
+
process.exit(0);
|
|
152
|
+
}
|
|
153
|
+
teamsEnabled = teamsChoice;
|
|
154
|
+
}
|
|
155
|
+
// Security deny list placement (user scope + TTY only)
|
|
156
|
+
let securityMode = 'user';
|
|
157
|
+
if (scope === 'user' && process.stdin.isTTY) {
|
|
158
|
+
const securityChoice = await p.select({
|
|
159
|
+
message: 'How should DevFlow install the security deny list?',
|
|
160
|
+
options: [
|
|
161
|
+
{ value: 'managed', label: 'Managed settings (Recommended)', hint: 'Cannot be overridden, requires admin' },
|
|
162
|
+
{ value: 'user', label: 'User settings', hint: 'Included in settings.json, editable' },
|
|
163
|
+
],
|
|
164
|
+
});
|
|
165
|
+
if (p.isCancel(securityChoice)) {
|
|
166
|
+
p.cancel('Installation cancelled.');
|
|
167
|
+
process.exit(0);
|
|
168
|
+
}
|
|
169
|
+
securityMode = securityChoice;
|
|
170
|
+
}
|
|
171
|
+
// Start spinner immediately after prompts — covers path resolution + git detection
|
|
172
|
+
const s = p.spinner();
|
|
173
|
+
s.start('Resolving paths');
|
|
174
|
+
// Get installation paths
|
|
199
175
|
let claudeDir;
|
|
200
176
|
let devflowDir;
|
|
201
177
|
let gitRoot = null;
|
|
@@ -203,468 +179,228 @@ export const initCommand = new Command('init')
|
|
|
203
179
|
const paths = await getInstallationPaths(scope);
|
|
204
180
|
claudeDir = paths.claudeDir;
|
|
205
181
|
devflowDir = paths.devflowDir;
|
|
206
|
-
|
|
207
|
-
gitRoot = await getGitRoot();
|
|
208
|
-
if (verbose) {
|
|
209
|
-
console.log(`📍 Installation scope: ${scope}`);
|
|
210
|
-
console.log(` Claude dir: ${claudeDir}`);
|
|
211
|
-
console.log(` DevFlow dir: ${devflowDir}\n`);
|
|
212
|
-
}
|
|
182
|
+
gitRoot = paths.gitRoot ?? await getGitRoot();
|
|
213
183
|
}
|
|
214
184
|
catch (error) {
|
|
215
|
-
|
|
185
|
+
s.stop('Path resolution failed');
|
|
186
|
+
p.log.error(`Path configuration error: ${error instanceof Error ? error.message : error}`);
|
|
216
187
|
process.exit(1);
|
|
217
188
|
}
|
|
218
|
-
//
|
|
219
|
-
|
|
189
|
+
// Validate target directory
|
|
190
|
+
s.message('Validating target directory');
|
|
191
|
+
if (scope === 'local') {
|
|
220
192
|
try {
|
|
221
|
-
await fs.
|
|
193
|
+
await fs.mkdir(claudeDir, { recursive: true });
|
|
222
194
|
}
|
|
223
|
-
catch {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
console.error(' Or set CLAUDE_CODE_DIR if installed elsewhere\n');
|
|
195
|
+
catch (error) {
|
|
196
|
+
s.stop('Installation failed');
|
|
197
|
+
p.log.error(`Failed to create ${claudeDir}: ${error}`);
|
|
227
198
|
process.exit(1);
|
|
228
199
|
}
|
|
229
|
-
if (verbose) {
|
|
230
|
-
console.log('✓ Claude Code detected');
|
|
231
|
-
}
|
|
232
200
|
}
|
|
233
201
|
else {
|
|
234
|
-
// Local scope - create .claude directory if it doesn't exist
|
|
235
202
|
try {
|
|
236
|
-
await fs.
|
|
237
|
-
if (verbose) {
|
|
238
|
-
console.log('✓ Local .claude directory ready');
|
|
239
|
-
}
|
|
203
|
+
await fs.access(claudeDir);
|
|
240
204
|
}
|
|
241
|
-
catch
|
|
242
|
-
|
|
205
|
+
catch {
|
|
206
|
+
s.stop('Installation failed');
|
|
207
|
+
p.log.error(`Claude Code not detected at ${claudeDir}`);
|
|
208
|
+
p.log.info('Install from: https://claude.ai/download');
|
|
243
209
|
process.exit(1);
|
|
244
210
|
}
|
|
245
211
|
}
|
|
246
|
-
//
|
|
212
|
+
// Resolve plugins and deduplication maps
|
|
213
|
+
s.message('Installing components');
|
|
247
214
|
const rootDir = path.resolve(__dirname, '../..');
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
target: path.join(claudeDir, 'skills'),
|
|
264
|
-
source: path.join(claudeSourceDir, 'skills', 'devflow'),
|
|
265
|
-
name: 'skills'
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
target: path.join(devflowDir, 'scripts'),
|
|
269
|
-
source: path.join(claudeSourceDir, 'scripts'),
|
|
270
|
-
name: 'scripts'
|
|
271
|
-
}
|
|
272
|
-
];
|
|
273
|
-
// Clean old DevFlow files before installing
|
|
274
|
-
for (const dir of devflowDirectories) {
|
|
275
|
-
if (dir.name === 'skills') {
|
|
276
|
-
// Special handling for skills: clean old nested structure and individual skills
|
|
277
|
-
// Remove old devflow/ subdirectory if it exists (migration from old structure)
|
|
278
|
-
const oldSkillsDir = path.join(claudeDir, 'skills', 'devflow');
|
|
279
|
-
try {
|
|
280
|
-
await fs.rm(oldSkillsDir, { recursive: true, force: true });
|
|
281
|
-
}
|
|
282
|
-
catch (e) {
|
|
283
|
-
// Directory might not exist
|
|
284
|
-
}
|
|
285
|
-
// Remove individual skill directories that we're about to reinstall
|
|
286
|
-
try {
|
|
287
|
-
const skillEntries = await fs.readdir(dir.source, { withFileTypes: true });
|
|
288
|
-
for (const entry of skillEntries) {
|
|
289
|
-
if (entry.isDirectory()) {
|
|
290
|
-
const skillTarget = path.join(dir.target, entry.name);
|
|
291
|
-
try {
|
|
292
|
-
await fs.rm(skillTarget, { recursive: true, force: true });
|
|
293
|
-
}
|
|
294
|
-
catch (e) {
|
|
295
|
-
// Skill might not exist
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
catch (e) {
|
|
301
|
-
// Source directory might not exist
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
else {
|
|
305
|
-
// For other components (commands, agents, scripts), clean the entire directory
|
|
306
|
-
try {
|
|
307
|
-
await fs.rm(dir.target, { recursive: true, force: true });
|
|
308
|
-
}
|
|
309
|
-
catch (e) {
|
|
310
|
-
// Directory might not exist on first install
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
// Install all DevFlow components
|
|
315
|
-
for (const dir of devflowDirectories) {
|
|
316
|
-
await fs.mkdir(dir.target, { recursive: true });
|
|
317
|
-
await copyDirectory(dir.source, dir.target);
|
|
318
|
-
}
|
|
319
|
-
// Make scripts executable
|
|
320
|
-
const scriptsDir = devflowDirectories.find(d => d.name === 'scripts').target;
|
|
321
|
-
const scripts = await fs.readdir(scriptsDir);
|
|
322
|
-
for (const script of scripts) {
|
|
323
|
-
await fs.chmod(path.join(scriptsDir, script), 0o755);
|
|
324
|
-
}
|
|
325
|
-
if (verbose) {
|
|
326
|
-
console.log('✓ Installing components... (commands, agents, skills, scripts)');
|
|
215
|
+
const pluginsDir = path.join(rootDir, 'plugins');
|
|
216
|
+
let pluginsToInstall = selectedPlugins.length > 0
|
|
217
|
+
? DEVFLOW_PLUGINS.filter(p => selectedPlugins.includes(p.name))
|
|
218
|
+
: DEVFLOW_PLUGINS.filter(p => !p.optional);
|
|
219
|
+
const coreSkillsPlugin = DEVFLOW_PLUGINS.find(p => p.name === 'devflow-core-skills');
|
|
220
|
+
if (pluginsToInstall.length > 0 && coreSkillsPlugin && !pluginsToInstall.includes(coreSkillsPlugin)) {
|
|
221
|
+
pluginsToInstall = [coreSkillsPlugin, ...pluginsToInstall];
|
|
222
|
+
}
|
|
223
|
+
const { skillsMap, agentsMap } = buildAssetMaps(pluginsToInstall);
|
|
224
|
+
// Install: try native CLI first, fall back to file copy
|
|
225
|
+
const cliAvailable = isClaudeCliAvailable();
|
|
226
|
+
const usedNativeCli = cliAvailable && installViaCli(pluginsToInstall, scope, s);
|
|
227
|
+
if (!usedNativeCli) {
|
|
228
|
+
if (cliAvailable && verbose) {
|
|
229
|
+
p.log.warn('Claude CLI installation failed, falling back to manual copy');
|
|
327
230
|
}
|
|
328
|
-
// Install settings.json - never override existing files (atomic operation)
|
|
329
|
-
const settingsPath = path.join(claudeDir, 'settings.json');
|
|
330
|
-
const devflowSettingsPath = path.join(claudeDir, 'settings.devflow.json');
|
|
331
|
-
const sourceSettingsPath = path.join(claudeSourceDir, 'settings.json');
|
|
332
|
-
// Read template and replace ~ with actual home directory
|
|
333
|
-
const settingsTemplate = await fs.readFile(sourceSettingsPath, 'utf-8');
|
|
334
|
-
const settingsContent = settingsTemplate.replace(/~\/\.devflow\/scripts\/statusline\.sh/g, path.join(devflowDir, 'scripts', 'statusline.sh'));
|
|
335
|
-
let settingsExists = false;
|
|
336
231
|
try {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
232
|
+
await installViaFileCopy({
|
|
233
|
+
plugins: pluginsToInstall,
|
|
234
|
+
claudeDir,
|
|
235
|
+
pluginsDir,
|
|
236
|
+
rootDir,
|
|
237
|
+
devflowDir,
|
|
238
|
+
skillsMap,
|
|
239
|
+
agentsMap,
|
|
240
|
+
isPartialInstall: !!options.plugin,
|
|
241
|
+
teamsEnabled,
|
|
242
|
+
spinner: s,
|
|
243
|
+
});
|
|
342
244
|
}
|
|
343
245
|
catch (error) {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
await fs.writeFile(devflowSettingsPath, settingsContent, 'utf-8');
|
|
348
|
-
if (verbose) {
|
|
349
|
-
console.log('⚠️ Existing settings.json preserved → DevFlow config: settings.devflow.json');
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
else {
|
|
353
|
-
throw error;
|
|
354
|
-
}
|
|
246
|
+
s.stop('Installation failed');
|
|
247
|
+
p.log.error(`${error}`);
|
|
248
|
+
process.exit(1);
|
|
355
249
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
250
|
+
}
|
|
251
|
+
s.stop('Plugins installed');
|
|
252
|
+
// Clean up stale skills from previous installations
|
|
253
|
+
const skillsDir = path.join(claudeDir, 'skills');
|
|
254
|
+
let staleRemoved = 0;
|
|
255
|
+
for (const legacy of LEGACY_SKILL_NAMES) {
|
|
256
|
+
const legacyPath = path.join(skillsDir, legacy);
|
|
361
257
|
try {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
await fs.writeFile(claudeMdPath, content, { encoding: 'utf-8', flag: 'wx' });
|
|
365
|
-
if (verbose) {
|
|
366
|
-
console.log('✓ CLAUDE.md configured');
|
|
367
|
-
}
|
|
258
|
+
await fs.rm(legacyPath, { recursive: true });
|
|
259
|
+
staleRemoved++;
|
|
368
260
|
}
|
|
369
|
-
catch
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
261
|
+
catch {
|
|
262
|
+
// Doesn't exist — expected for most entries
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (staleRemoved > 0 && verbose) {
|
|
266
|
+
p.log.info(`Cleaned up ${staleRemoved} legacy skill(s)`);
|
|
267
|
+
}
|
|
268
|
+
// Clean up stale commands from previous installations (e.g., /review → /code-review)
|
|
269
|
+
const commandsDir = path.join(claudeDir, 'commands', 'devflow');
|
|
270
|
+
let staleCommandsRemoved = 0;
|
|
271
|
+
for (const legacy of LEGACY_COMMAND_NAMES) {
|
|
272
|
+
for (const suffix of ['.md', '-teams.md']) {
|
|
273
|
+
const legacyPath = path.join(commandsDir, `${legacy}${suffix}`);
|
|
274
|
+
try {
|
|
275
|
+
await fs.rm(legacyPath);
|
|
276
|
+
staleCommandsRemoved++;
|
|
377
277
|
}
|
|
378
|
-
|
|
379
|
-
|
|
278
|
+
catch {
|
|
279
|
+
// Doesn't exist — expected for most entries
|
|
380
280
|
}
|
|
381
281
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
282
|
+
}
|
|
283
|
+
if (staleCommandsRemoved > 0 && verbose) {
|
|
284
|
+
p.log.info(`Cleaned up ${staleCommandsRemoved} legacy command(s)`);
|
|
285
|
+
}
|
|
286
|
+
// === Configuration extras ===
|
|
287
|
+
const extrasOptions = buildExtrasOptions(scope, gitRoot);
|
|
288
|
+
let selectedExtras;
|
|
289
|
+
if (process.stdin.isTTY) {
|
|
290
|
+
const extrasSelection = await p.multiselect({
|
|
291
|
+
message: 'Configure extras',
|
|
292
|
+
options: extrasOptions,
|
|
293
|
+
initialValues: extrasOptions.map(o => o.value),
|
|
294
|
+
required: false,
|
|
295
|
+
});
|
|
296
|
+
if (p.isCancel(extrasSelection)) {
|
|
297
|
+
p.cancel('Installation cancelled.');
|
|
298
|
+
process.exit(0);
|
|
299
|
+
}
|
|
300
|
+
selectedExtras = extrasSelection;
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
selectedExtras = extrasOptions.map(o => o.value);
|
|
304
|
+
}
|
|
305
|
+
// Settings may trigger its own TTY sub-prompt — run outside spinner
|
|
306
|
+
if (selectedExtras.includes('settings')) {
|
|
307
|
+
// Attempt managed settings write if user chose managed mode
|
|
308
|
+
let effectiveSecurityMode = securityMode;
|
|
309
|
+
if (securityMode === 'managed') {
|
|
310
|
+
const managed = await installManagedSettings(rootDir, verbose);
|
|
311
|
+
if (!managed) {
|
|
312
|
+
p.log.warn('Managed settings write failed — falling back to user settings');
|
|
313
|
+
effectiveSecurityMode = 'user';
|
|
388
314
|
}
|
|
389
|
-
const claudeignorePath = path.join(gitRoot, '.claudeignore');
|
|
390
|
-
// Atomic exclusive create - only create if doesn't exist
|
|
391
|
-
const claudeignoreContent = `# DevFlow .claudeignore - Protects against sensitive files and context pollution
|
|
392
|
-
# Generated by DevFlow - Edit as needed for your project
|
|
393
|
-
|
|
394
|
-
# === SECURITY: Sensitive Files ===
|
|
395
|
-
# Environment and secrets
|
|
396
|
-
.env
|
|
397
|
-
.env.*
|
|
398
|
-
.env.local
|
|
399
|
-
.env.*.local
|
|
400
|
-
*.env
|
|
401
|
-
.envrc
|
|
402
|
-
|
|
403
|
-
# Credentials and keys
|
|
404
|
-
*.key
|
|
405
|
-
*.pem
|
|
406
|
-
*.p12
|
|
407
|
-
*.pfx
|
|
408
|
-
*.cer
|
|
409
|
-
*.crt
|
|
410
|
-
*.der
|
|
411
|
-
id_rsa
|
|
412
|
-
id_dsa
|
|
413
|
-
id_ecdsa
|
|
414
|
-
id_ed25519
|
|
415
|
-
*.ppk
|
|
416
|
-
*_rsa
|
|
417
|
-
*_dsa
|
|
418
|
-
*secret*
|
|
419
|
-
*password*
|
|
420
|
-
*credential*
|
|
421
|
-
credentials.json
|
|
422
|
-
secrets.json
|
|
423
|
-
secrets.yaml
|
|
424
|
-
secrets.yml
|
|
425
|
-
|
|
426
|
-
# Cloud provider credentials
|
|
427
|
-
.aws/credentials
|
|
428
|
-
.aws/config
|
|
429
|
-
.gcp/credentials.json
|
|
430
|
-
.azure/credentials
|
|
431
|
-
|
|
432
|
-
# Package manager credentials
|
|
433
|
-
.npmrc
|
|
434
|
-
.pypirc
|
|
435
|
-
.gem/credentials
|
|
436
|
-
pip.conf
|
|
437
|
-
|
|
438
|
-
# Database
|
|
439
|
-
*.sql
|
|
440
|
-
*.db
|
|
441
|
-
*.sqlite
|
|
442
|
-
*.sqlite3
|
|
443
|
-
|
|
444
|
-
# === DEPENDENCIES & BUILD ===
|
|
445
|
-
# Node.js
|
|
446
|
-
node_modules/
|
|
447
|
-
npm-debug.log*
|
|
448
|
-
yarn-debug.log*
|
|
449
|
-
yarn-error.log*
|
|
450
|
-
pnpm-debug.log*
|
|
451
|
-
.pnpm-store/
|
|
452
|
-
|
|
453
|
-
# Python
|
|
454
|
-
__pycache__/
|
|
455
|
-
*.py[cod]
|
|
456
|
-
*$py.class
|
|
457
|
-
.Python
|
|
458
|
-
env/
|
|
459
|
-
venv/
|
|
460
|
-
ENV/
|
|
461
|
-
.venv/
|
|
462
|
-
pip-log.txt
|
|
463
|
-
pip-delete-this-directory.txt
|
|
464
|
-
.eggs/
|
|
465
|
-
*.egg-info/
|
|
466
|
-
dist/
|
|
467
|
-
build/
|
|
468
|
-
*.whl
|
|
469
|
-
|
|
470
|
-
# Ruby
|
|
471
|
-
vendor/bundle/
|
|
472
|
-
.bundle/
|
|
473
|
-
|
|
474
|
-
# Go
|
|
475
|
-
vendor/
|
|
476
|
-
go.sum
|
|
477
|
-
|
|
478
|
-
# Rust
|
|
479
|
-
target/
|
|
480
|
-
Cargo.lock
|
|
481
|
-
|
|
482
|
-
# Java
|
|
483
|
-
target/
|
|
484
|
-
*.class
|
|
485
|
-
*.jar
|
|
486
|
-
*.war
|
|
487
|
-
|
|
488
|
-
# PHP
|
|
489
|
-
vendor/
|
|
490
|
-
composer.lock
|
|
491
|
-
|
|
492
|
-
# === BUILD ARTIFACTS ===
|
|
493
|
-
dist/
|
|
494
|
-
build/
|
|
495
|
-
out/
|
|
496
|
-
.next/
|
|
497
|
-
.nuxt/
|
|
498
|
-
.output/
|
|
499
|
-
.vite/
|
|
500
|
-
.cache/
|
|
501
|
-
.parcel-cache/
|
|
502
|
-
.turbo/
|
|
503
|
-
*.tsbuildinfo
|
|
504
|
-
|
|
505
|
-
# === LOGS & TEMP FILES ===
|
|
506
|
-
logs/
|
|
507
|
-
*.log
|
|
508
|
-
*.tmp
|
|
509
|
-
*.temp
|
|
510
|
-
*.swp
|
|
511
|
-
*.swo
|
|
512
|
-
*~
|
|
513
|
-
.DS_Store
|
|
514
|
-
Thumbs.db
|
|
515
|
-
*.bak
|
|
516
|
-
*.orig
|
|
517
|
-
*.rej
|
|
518
|
-
.cache
|
|
519
|
-
|
|
520
|
-
# === VERSION CONTROL ===
|
|
521
|
-
.git/
|
|
522
|
-
.svn/
|
|
523
|
-
.hg/
|
|
524
|
-
.gitignore
|
|
525
|
-
|
|
526
|
-
# === IDE & EDITORS ===
|
|
527
|
-
.vscode/
|
|
528
|
-
.idea/
|
|
529
|
-
*.sublime-*
|
|
530
|
-
*.code-workspace
|
|
531
|
-
.project
|
|
532
|
-
.classpath
|
|
533
|
-
.settings/
|
|
534
|
-
|
|
535
|
-
# === TEST COVERAGE ===
|
|
536
|
-
coverage/
|
|
537
|
-
.nyc_output/
|
|
538
|
-
htmlcov/
|
|
539
|
-
.coverage
|
|
540
|
-
.pytest_cache/
|
|
541
|
-
.tox/
|
|
542
|
-
|
|
543
|
-
# === OS-SPECIFIC ===
|
|
544
|
-
.DS_Store
|
|
545
|
-
.AppleDouble
|
|
546
|
-
.LSOverride
|
|
547
|
-
Thumbs.db
|
|
548
|
-
ehthumbs.db
|
|
549
|
-
Desktop.ini
|
|
550
|
-
|
|
551
|
-
# === MEDIA & LARGE FILES ===
|
|
552
|
-
*.mp4
|
|
553
|
-
*.avi
|
|
554
|
-
*.mov
|
|
555
|
-
*.wmv
|
|
556
|
-
*.flv
|
|
557
|
-
*.mp3
|
|
558
|
-
*.wav
|
|
559
|
-
*.zip
|
|
560
|
-
*.tar.gz
|
|
561
|
-
*.rar
|
|
562
|
-
*.7z
|
|
563
|
-
*.dmg
|
|
564
|
-
*.iso
|
|
565
|
-
|
|
566
|
-
# === DOCUMENTATION BUILD ===
|
|
567
|
-
site/
|
|
568
|
-
_site/
|
|
569
|
-
.docusaurus/
|
|
570
|
-
.vuepress/dist/
|
|
571
|
-
|
|
572
|
-
# === LOCK FILES (usually not needed for AI context) ===
|
|
573
|
-
package-lock.json
|
|
574
|
-
yarn.lock
|
|
575
|
-
pnpm-lock.yaml
|
|
576
|
-
Gemfile.lock
|
|
577
|
-
poetry.lock
|
|
578
|
-
Pipfile.lock
|
|
579
|
-
`;
|
|
580
|
-
// Atomic exclusive create - fails if file already exists
|
|
581
|
-
await fs.writeFile(claudeignorePath, claudeignoreContent, { encoding: 'utf-8', flag: 'wx' });
|
|
582
|
-
claudeignoreCreated = true;
|
|
583
315
|
}
|
|
584
|
-
|
|
585
|
-
|
|
316
|
+
await installSettings(claudeDir, rootDir, devflowDir, verbose, teamsEnabled, effectiveSecurityMode);
|
|
317
|
+
}
|
|
318
|
+
const fileExtras = selectedExtras.filter(e => e !== 'settings' && e !== 'safe-delete');
|
|
319
|
+
if (fileExtras.length > 0) {
|
|
320
|
+
const sExtras = p.spinner();
|
|
321
|
+
sExtras.start('Configuring extras');
|
|
322
|
+
if (selectedExtras.includes('claudeignore') && gitRoot) {
|
|
323
|
+
await installClaudeignore(gitRoot, rootDir, verbose);
|
|
586
324
|
}
|
|
587
|
-
if (
|
|
588
|
-
|
|
325
|
+
if (selectedExtras.includes('gitignore') && gitRoot) {
|
|
326
|
+
await updateGitignore(gitRoot, verbose);
|
|
589
327
|
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
328
|
+
if (selectedExtras.includes('docs')) {
|
|
329
|
+
await createDocsStructure(verbose);
|
|
330
|
+
}
|
|
331
|
+
sExtras.stop('Extras configured');
|
|
332
|
+
}
|
|
333
|
+
// Summary output
|
|
334
|
+
if (usedNativeCli) {
|
|
335
|
+
p.log.success('Installed via Claude plugin system');
|
|
336
|
+
}
|
|
337
|
+
else if (!cliAvailable) {
|
|
338
|
+
p.log.info('Installed via file copy (Claude CLI not available)');
|
|
339
|
+
}
|
|
340
|
+
const installedCommands = pluginsToInstall.flatMap(p => p.commands).filter(c => c.length > 0);
|
|
341
|
+
if (installedCommands.length > 0) {
|
|
342
|
+
const commandsNote = installedCommands
|
|
343
|
+
.map(cmd => color.cyan(cmd))
|
|
344
|
+
.join(' ');
|
|
345
|
+
p.note(commandsNote, 'Available commands');
|
|
346
|
+
}
|
|
347
|
+
// Safe-delete auto-install (gated by extras selection)
|
|
348
|
+
if (selectedExtras.includes('safe-delete')) {
|
|
349
|
+
const platform = detectPlatform();
|
|
350
|
+
const shell = detectShell();
|
|
351
|
+
const safeDeleteInfo = getSafeDeleteInfo(platform);
|
|
352
|
+
const safeDeleteAvailable = hasSafeDelete(platform);
|
|
353
|
+
const profilePath = getProfilePath(shell);
|
|
354
|
+
if (process.stdin.isTTY && profilePath) {
|
|
355
|
+
if (!safeDeleteAvailable && safeDeleteInfo.installHint) {
|
|
356
|
+
p.log.info(`Install ${color.cyan(safeDeleteInfo.command ?? 'trash')} first: ${color.dim(safeDeleteInfo.installHint)}`);
|
|
357
|
+
p.log.info(`Then re-run ${color.cyan('devflow init')} to auto-configure safe-delete.`);
|
|
358
|
+
}
|
|
359
|
+
else if (safeDeleteAvailable) {
|
|
360
|
+
const alreadyInstalled = await isAlreadyInstalled(profilePath);
|
|
361
|
+
if (alreadyInstalled) {
|
|
362
|
+
p.log.info(`Safe-delete already configured in ${color.dim(profilePath)}`);
|
|
608
363
|
}
|
|
609
|
-
|
|
610
|
-
const
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
364
|
+
else {
|
|
365
|
+
const trashCmd = safeDeleteInfo.command;
|
|
366
|
+
const block = generateSafeDeleteBlock(shell, process.platform, trashCmd);
|
|
367
|
+
if (block) {
|
|
368
|
+
const confirm = await p.confirm({
|
|
369
|
+
message: `Install safe-delete to ${profilePath}? (overrides rm to use ${trashCmd ?? 'recycle bin'})`,
|
|
370
|
+
initialValue: true,
|
|
371
|
+
});
|
|
372
|
+
if (!p.isCancel(confirm) && confirm) {
|
|
373
|
+
await installToProfile(profilePath, block);
|
|
374
|
+
p.log.success(`Safe-delete installed to ${color.dim(profilePath)}`);
|
|
375
|
+
p.log.info('Restart your shell or run: ' + color.cyan(`source ${profilePath}`));
|
|
376
|
+
}
|
|
616
377
|
}
|
|
617
378
|
}
|
|
618
379
|
}
|
|
619
|
-
catch (error) {
|
|
620
|
-
if (verbose) {
|
|
621
|
-
console.warn('⚠️ Could not update .gitignore:', error instanceof Error ? error.message : error);
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
380
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
const docsDir = path.join(process.cwd(), '.docs');
|
|
629
|
-
try {
|
|
630
|
-
await fs.mkdir(path.join(docsDir, 'status', 'compact'), { recursive: true });
|
|
631
|
-
await fs.mkdir(path.join(docsDir, 'reviews'), { recursive: true });
|
|
632
|
-
await fs.mkdir(path.join(docsDir, 'audits', 'standalone'), { recursive: true });
|
|
633
|
-
await fs.mkdir(path.join(docsDir, 'releases'), { recursive: true });
|
|
634
|
-
docsCreated = true;
|
|
381
|
+
else if (!process.stdin.isTTY) {
|
|
382
|
+
if (safeDeleteAvailable && safeDeleteInfo.command) {
|
|
383
|
+
p.log.info(`Safe-delete available (${safeDeleteInfo.command}). Run interactively to auto-install.`);
|
|
635
384
|
}
|
|
636
|
-
|
|
637
|
-
|
|
385
|
+
else if (safeDeleteInfo.installHint) {
|
|
386
|
+
p.log.info(`Protect against accidental ${color.red('rm -rf')}: ${color.cyan(safeDeleteInfo.installHint)}`);
|
|
638
387
|
}
|
|
639
388
|
}
|
|
640
|
-
if (docsCreated && verbose) {
|
|
641
|
-
console.log('✓ .docs/ structure ready');
|
|
642
|
-
}
|
|
643
|
-
// Render output based on verbose flag
|
|
644
|
-
if (verbose) {
|
|
645
|
-
renderVerboseOutput(version, scope, claudeDir, devflowDir, settingsExists, claudeMdExists);
|
|
646
|
-
}
|
|
647
|
-
else {
|
|
648
|
-
renderCleanOutput(version);
|
|
649
|
-
}
|
|
650
389
|
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
390
|
+
// Verbose mode: show details
|
|
391
|
+
if (verbose) {
|
|
392
|
+
const pluginsList = pluginsToInstall
|
|
393
|
+
.map(plugin => `${color.yellow(plugin.name.padEnd(24))}${color.dim(plugin.description)}`)
|
|
394
|
+
.join('\n');
|
|
395
|
+
p.note(pluginsList, 'Installed plugins');
|
|
396
|
+
p.log.info(`Scope: ${scope}`);
|
|
397
|
+
p.log.info(`Claude dir: ${claudeDir}`);
|
|
398
|
+
p.log.info(`DevFlow dir: ${devflowDir}`);
|
|
399
|
+
const totalSkillDeclarations = pluginsToInstall.reduce((sum, p) => sum + p.skills.length, 0);
|
|
400
|
+
const totalAgentDeclarations = pluginsToInstall.reduce((sum, p) => sum + p.agents.length, 0);
|
|
401
|
+
p.log.info(`Deduplication: ${skillsMap.size} unique skills (from ${totalSkillDeclarations} declarations)`);
|
|
402
|
+
p.log.info(`Deduplication: ${agentsMap.size} unique agents (from ${totalAgentDeclarations} declarations)`);
|
|
654
403
|
}
|
|
404
|
+
p.outro(color.green('Ready! Run any command in Claude Code to get started.'));
|
|
655
405
|
});
|
|
656
|
-
async function copyDirectory(src, dest) {
|
|
657
|
-
await fs.mkdir(dest, { recursive: true });
|
|
658
|
-
const entries = await fs.readdir(src, { withFileTypes: true });
|
|
659
|
-
for (const entry of entries) {
|
|
660
|
-
const srcPath = path.join(src, entry.name);
|
|
661
|
-
const destPath = path.join(dest, entry.name);
|
|
662
|
-
if (entry.isDirectory()) {
|
|
663
|
-
await copyDirectory(srcPath, destPath);
|
|
664
|
-
}
|
|
665
|
-
else {
|
|
666
|
-
await fs.copyFile(srcPath, destPath);
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
406
|
//# sourceMappingURL=init.js.map
|