@accelerationguy/accel 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/CLAUDE.md +19 -0
- package/LICENSE +33 -0
- package/README.md +275 -0
- package/bin/install.js +661 -0
- package/docs/getting-started.md +164 -0
- package/docs/module-guide.md +139 -0
- package/modules/drive/LICENSE +21 -0
- package/modules/drive/PAUL-VS-GSD.md +171 -0
- package/modules/drive/README.md +555 -0
- package/modules/drive/assets/terminal.svg +67 -0
- package/modules/drive/bin/install.js +210 -0
- package/modules/drive/integration.js +76 -0
- package/modules/drive/package.json +38 -0
- package/modules/drive/src/commands/add-phase.md +36 -0
- package/modules/drive/src/commands/apply.md +83 -0
- package/modules/drive/src/commands/assumptions.md +37 -0
- package/modules/drive/src/commands/audit.md +57 -0
- package/modules/drive/src/commands/complete-milestone.md +36 -0
- package/modules/drive/src/commands/config.md +175 -0
- package/modules/drive/src/commands/consider-issues.md +41 -0
- package/modules/drive/src/commands/discover.md +48 -0
- package/modules/drive/src/commands/discuss-milestone.md +33 -0
- package/modules/drive/src/commands/discuss.md +34 -0
- package/modules/drive/src/commands/flows.md +73 -0
- package/modules/drive/src/commands/handoff.md +201 -0
- package/modules/drive/src/commands/help.md +525 -0
- package/modules/drive/src/commands/init.md +54 -0
- package/modules/drive/src/commands/map-codebase.md +34 -0
- package/modules/drive/src/commands/milestone.md +34 -0
- package/modules/drive/src/commands/pause.md +44 -0
- package/modules/drive/src/commands/plan-fix.md +216 -0
- package/modules/drive/src/commands/plan.md +36 -0
- package/modules/drive/src/commands/progress.md +138 -0
- package/modules/drive/src/commands/register.md +29 -0
- package/modules/drive/src/commands/remove-phase.md +37 -0
- package/modules/drive/src/commands/research-phase.md +209 -0
- package/modules/drive/src/commands/research.md +47 -0
- package/modules/drive/src/commands/resume.md +49 -0
- package/modules/drive/src/commands/status.md +78 -0
- package/modules/drive/src/commands/unify.md +87 -0
- package/modules/drive/src/commands/verify.md +60 -0
- package/modules/drive/src/references/checkpoints.md +234 -0
- package/modules/drive/src/references/context-management.md +219 -0
- package/modules/drive/src/references/git-strategy.md +206 -0
- package/modules/drive/src/references/loop-phases.md +254 -0
- package/modules/drive/src/references/plan-format.md +263 -0
- package/modules/drive/src/references/quality-principles.md +152 -0
- package/modules/drive/src/references/research-quality-control.md +247 -0
- package/modules/drive/src/references/sonarqube-integration.md +244 -0
- package/modules/drive/src/references/specialized-workflow-integration.md +186 -0
- package/modules/drive/src/references/subagent-criteria.md +179 -0
- package/modules/drive/src/references/tdd.md +219 -0
- package/modules/drive/src/references/work-units.md +161 -0
- package/modules/drive/src/rules/commands.md +108 -0
- package/modules/drive/src/rules/references.md +107 -0
- package/modules/drive/src/rules/style.md +123 -0
- package/modules/drive/src/rules/templates.md +51 -0
- package/modules/drive/src/rules/workflows.md +133 -0
- package/modules/drive/src/templates/CONTEXT.md +88 -0
- package/modules/drive/src/templates/DEBUG.md +164 -0
- package/modules/drive/src/templates/DISCOVERY.md +148 -0
- package/modules/drive/src/templates/HANDOFF.md +77 -0
- package/modules/drive/src/templates/ISSUES.md +93 -0
- package/modules/drive/src/templates/MILESTONES.md +167 -0
- package/modules/drive/src/templates/PLAN.md +328 -0
- package/modules/drive/src/templates/PROJECT.md +219 -0
- package/modules/drive/src/templates/RESEARCH.md +130 -0
- package/modules/drive/src/templates/ROADMAP.md +328 -0
- package/modules/drive/src/templates/SPECIAL-FLOWS.md +70 -0
- package/modules/drive/src/templates/STATE.md +210 -0
- package/modules/drive/src/templates/SUMMARY.md +221 -0
- package/modules/drive/src/templates/UAT-ISSUES.md +139 -0
- package/modules/drive/src/templates/codebase/architecture.md +259 -0
- package/modules/drive/src/templates/codebase/concerns.md +329 -0
- package/modules/drive/src/templates/codebase/conventions.md +311 -0
- package/modules/drive/src/templates/codebase/integrations.md +284 -0
- package/modules/drive/src/templates/codebase/stack.md +190 -0
- package/modules/drive/src/templates/codebase/structure.md +287 -0
- package/modules/drive/src/templates/codebase/testing.md +484 -0
- package/modules/drive/src/templates/config.md +181 -0
- package/modules/drive/src/templates/milestone-archive.md +236 -0
- package/modules/drive/src/templates/milestone-context.md +190 -0
- package/modules/drive/src/templates/paul-json.md +147 -0
- package/modules/drive/src/vector-config/PAUL +26 -0
- package/modules/drive/src/vector-config/PAUL.manifest +11 -0
- package/modules/drive/src/workflows/apply-phase.md +393 -0
- package/modules/drive/src/workflows/audit-plan.md +344 -0
- package/modules/drive/src/workflows/complete-milestone.md +479 -0
- package/modules/drive/src/workflows/configure-special-flows.md +283 -0
- package/modules/drive/src/workflows/consider-issues.md +172 -0
- package/modules/drive/src/workflows/create-milestone.md +268 -0
- package/modules/drive/src/workflows/debug.md +292 -0
- package/modules/drive/src/workflows/discovery.md +187 -0
- package/modules/drive/src/workflows/discuss-milestone.md +245 -0
- package/modules/drive/src/workflows/discuss-phase.md +231 -0
- package/modules/drive/src/workflows/init-project.md +698 -0
- package/modules/drive/src/workflows/map-codebase.md +459 -0
- package/modules/drive/src/workflows/pause-work.md +259 -0
- package/modules/drive/src/workflows/phase-assumptions.md +181 -0
- package/modules/drive/src/workflows/plan-phase.md +385 -0
- package/modules/drive/src/workflows/quality-gate.md +263 -0
- package/modules/drive/src/workflows/register-manifest.md +107 -0
- package/modules/drive/src/workflows/research.md +241 -0
- package/modules/drive/src/workflows/resume-project.md +200 -0
- package/modules/drive/src/workflows/roadmap-management.md +334 -0
- package/modules/drive/src/workflows/transition-phase.md +368 -0
- package/modules/drive/src/workflows/unify-phase.md +290 -0
- package/modules/drive/src/workflows/verify-work.md +241 -0
- package/modules/forge/README.md +281 -0
- package/modules/forge/bin/install.js +200 -0
- package/modules/forge/package.json +32 -0
- package/modules/forge/skillsmith/rules/checklists-rules.md +42 -0
- package/modules/forge/skillsmith/rules/context-rules.md +43 -0
- package/modules/forge/skillsmith/rules/entry-point-rules.md +44 -0
- package/modules/forge/skillsmith/rules/frameworks-rules.md +43 -0
- package/modules/forge/skillsmith/rules/tasks-rules.md +52 -0
- package/modules/forge/skillsmith/rules/templates-rules.md +43 -0
- package/modules/forge/skillsmith/skillsmith.md +82 -0
- package/modules/forge/skillsmith/tasks/audit.md +277 -0
- package/modules/forge/skillsmith/tasks/discover.md +145 -0
- package/modules/forge/skillsmith/tasks/distill.md +276 -0
- package/modules/forge/skillsmith/tasks/scaffold.md +349 -0
- package/modules/forge/specs/checklists.md +193 -0
- package/modules/forge/specs/context.md +223 -0
- package/modules/forge/specs/entry-point.md +320 -0
- package/modules/forge/specs/frameworks.md +228 -0
- package/modules/forge/specs/rules.md +245 -0
- package/modules/forge/specs/tasks.md +344 -0
- package/modules/forge/specs/templates.md +335 -0
- package/modules/forge/terminal.svg +70 -0
- package/modules/ignition/README.md +245 -0
- package/modules/ignition/bin/install.js +184 -0
- package/modules/ignition/checklists/planning-quality.md +55 -0
- package/modules/ignition/data/application/config.md +21 -0
- package/modules/ignition/data/application/guide.md +51 -0
- package/modules/ignition/data/application/skill-loadout.md +11 -0
- package/modules/ignition/data/campaign/config.md +18 -0
- package/modules/ignition/data/campaign/guide.md +36 -0
- package/modules/ignition/data/campaign/skill-loadout.md +10 -0
- package/modules/ignition/data/client/config.md +18 -0
- package/modules/ignition/data/client/guide.md +36 -0
- package/modules/ignition/data/client/skill-loadout.md +11 -0
- package/modules/ignition/data/utility/config.md +18 -0
- package/modules/ignition/data/utility/guide.md +31 -0
- package/modules/ignition/data/utility/skill-loadout.md +8 -0
- package/modules/ignition/data/workflow/config.md +19 -0
- package/modules/ignition/data/workflow/guide.md +41 -0
- package/modules/ignition/data/workflow/skill-loadout.md +10 -0
- package/modules/ignition/integration.js +54 -0
- package/modules/ignition/package.json +35 -0
- package/modules/ignition/seed.md +81 -0
- package/modules/ignition/tasks/add-type.md +164 -0
- package/modules/ignition/tasks/graduate.md +182 -0
- package/modules/ignition/tasks/ideate.md +221 -0
- package/modules/ignition/tasks/launch.md +137 -0
- package/modules/ignition/tasks/status.md +71 -0
- package/modules/ignition/templates/planning-application.md +193 -0
- package/modules/ignition/templates/planning-campaign.md +138 -0
- package/modules/ignition/templates/planning-client.md +149 -0
- package/modules/ignition/templates/planning-utility.md +112 -0
- package/modules/ignition/templates/planning-workflow.md +125 -0
- package/modules/ignition/terminal.svg +74 -0
- package/modules/mission-control/CONTEXT-CONTINUITY-SPEC.md +293 -0
- package/modules/mission-control/CONTEXT-ENGINEERING-GUIDE.md +282 -0
- package/modules/mission-control/README.md +91 -0
- package/modules/mission-control/assets/terminal.svg +80 -0
- package/modules/mission-control/examples/entities.example.json +133 -0
- package/modules/mission-control/examples/projects.example.json +318 -0
- package/modules/mission-control/examples/state.example.json +183 -0
- package/modules/mission-control/examples/vector.example.json +245 -0
- package/modules/mission-control/mission-control/checklists/install-verification.md +46 -0
- package/modules/mission-control/mission-control/frameworks/framework-registry.md +83 -0
- package/modules/mission-control/mission-control/mission-control.md +83 -0
- package/modules/mission-control/mission-control/tasks/insights.md +73 -0
- package/modules/mission-control/mission-control/tasks/install.md +194 -0
- package/modules/mission-control/mission-control/tasks/status.md +125 -0
- package/modules/mission-control/schemas/entities.schema.json +89 -0
- package/modules/mission-control/schemas/projects.schema.json +221 -0
- package/modules/mission-control/schemas/state.schema.json +108 -0
- package/modules/mission-control/schemas/vector.schema.json +200 -0
- package/modules/momentum/README.md +678 -0
- package/modules/momentum/bin/install.js +563 -0
- package/modules/momentum/integration.js +131 -0
- package/modules/momentum/package.json +42 -0
- package/modules/momentum/schemas/entities.schema.json +89 -0
- package/modules/momentum/schemas/projects.schema.json +221 -0
- package/modules/momentum/schemas/state.schema.json +108 -0
- package/modules/momentum/src/commands/audit-claude-md.md +31 -0
- package/modules/momentum/src/commands/audit.md +33 -0
- package/modules/momentum/src/commands/groom.md +35 -0
- package/modules/momentum/src/commands/history.md +27 -0
- package/modules/momentum/src/commands/pulse.md +33 -0
- package/modules/momentum/src/commands/scaffold.md +33 -0
- package/modules/momentum/src/commands/status.md +28 -0
- package/modules/momentum/src/commands/surface-convert.md +35 -0
- package/modules/momentum/src/commands/surface-create.md +34 -0
- package/modules/momentum/src/commands/surface-list.md +27 -0
- package/modules/momentum/src/commands/vector-hygiene.md +33 -0
- package/modules/momentum/src/framework/context/momentum-principles.md +71 -0
- package/modules/momentum/src/framework/frameworks/audit-strategies.md +53 -0
- package/modules/momentum/src/framework/frameworks/satellite-registration.md +44 -0
- package/modules/momentum/src/framework/tasks/audit-claude-md.md +68 -0
- package/modules/momentum/src/framework/tasks/audit.md +64 -0
- package/modules/momentum/src/framework/tasks/groom.md +164 -0
- package/modules/momentum/src/framework/tasks/history.md +34 -0
- package/modules/momentum/src/framework/tasks/pulse.md +83 -0
- package/modules/momentum/src/framework/tasks/scaffold.md +202 -0
- package/modules/momentum/src/framework/tasks/status.md +35 -0
- package/modules/momentum/src/framework/tasks/surface-convert.md +143 -0
- package/modules/momentum/src/framework/tasks/surface-create.md +184 -0
- package/modules/momentum/src/framework/tasks/surface-list.md +42 -0
- package/modules/momentum/src/framework/tasks/vector-hygiene.md +160 -0
- package/modules/momentum/src/framework/templates/workspace-json.md +96 -0
- package/modules/momentum/src/hooks/_template.py +129 -0
- package/modules/momentum/src/hooks/active-hook.py +178 -0
- package/modules/momentum/src/hooks/backlog-hook.py +115 -0
- package/modules/momentum/src/hooks/mission-control-insights.py +169 -0
- package/modules/momentum/src/hooks/momentum-pulse-check.py +351 -0
- package/modules/momentum/src/hooks/operator.py +53 -0
- package/modules/momentum/src/hooks/psmm-injector.py +67 -0
- package/modules/momentum/src/hooks/satellite-detection.py +248 -0
- package/modules/momentum/src/packages/momentum-mcp/index.js +119 -0
- package/modules/momentum/src/packages/momentum-mcp/package.json +10 -0
- package/modules/momentum/src/packages/momentum-mcp/tools/entities.js +226 -0
- package/modules/momentum/src/packages/momentum-mcp/tools/operator.js +106 -0
- package/modules/momentum/src/packages/momentum-mcp/tools/projects.js +322 -0
- package/modules/momentum/src/packages/momentum-mcp/tools/psmm.js +206 -0
- package/modules/momentum/src/packages/momentum-mcp/tools/state.js +199 -0
- package/modules/momentum/src/packages/momentum-mcp/tools/surfaces.js +404 -0
- package/modules/momentum/src/skill/momentum.md +111 -0
- package/modules/momentum/src/tasks/groom.md +164 -0
- package/modules/momentum/src/templates/operator.json +66 -0
- package/modules/momentum/src/templates/workspace.json +111 -0
- package/modules/momentum/terminal.svg +77 -0
- package/modules/radar/README.md +1552 -0
- package/modules/radar/commands/audit.md +233 -0
- package/modules/radar/commands/guardrails.md +194 -0
- package/modules/radar/commands/init.md +207 -0
- package/modules/radar/commands/playbook.md +176 -0
- package/modules/radar/commands/remediate.md +156 -0
- package/modules/radar/commands/report.md +172 -0
- package/modules/radar/commands/resume.md +176 -0
- package/modules/radar/commands/status.md +148 -0
- package/modules/radar/commands/transform.md +205 -0
- package/modules/radar/commands/validate.md +177 -0
- package/modules/radar/docs/ARCHITECTURE.md +336 -0
- package/modules/radar/docs/GETTING-STARTED.md +287 -0
- package/modules/radar/docs/standards/agents.md +197 -0
- package/modules/radar/docs/standards/commands.md +250 -0
- package/modules/radar/docs/standards/domains.md +191 -0
- package/modules/radar/docs/standards/personas.md +211 -0
- package/modules/radar/docs/standards/rules.md +218 -0
- package/modules/radar/docs/standards/runtime.md +445 -0
- package/modules/radar/docs/standards/schemas.md +269 -0
- package/modules/radar/docs/standards/tools.md +273 -0
- package/modules/radar/docs/standards/workflows.md +254 -0
- package/modules/radar/docs/terminal.svg +72 -0
- package/modules/radar/docs/validation/convention-compliance-report.md +183 -0
- package/modules/radar/docs/validation/cross-reference-report.md +195 -0
- package/modules/radar/docs/validation/validation-summary.md +118 -0
- package/modules/radar/docs/validation/version-manifest.yaml +363 -0
- package/modules/radar/install.sh +711 -0
- package/modules/radar/integration.js +53 -0
- package/modules/radar/src/core/agents/architect.md +25 -0
- package/modules/radar/src/core/agents/compliance-officer.md +25 -0
- package/modules/radar/src/core/agents/data-engineer.md +25 -0
- package/modules/radar/src/core/agents/devils-advocate.md +22 -0
- package/modules/radar/src/core/agents/performance-engineer.md +25 -0
- package/modules/radar/src/core/agents/principal-engineer.md +23 -0
- package/modules/radar/src/core/agents/reality-gap-analyst.md +22 -0
- package/modules/radar/src/core/agents/security-engineer.md +25 -0
- package/modules/radar/src/core/agents/senior-app-engineer.md +25 -0
- package/modules/radar/src/core/agents/sre.md +25 -0
- package/modules/radar/src/core/agents/staff-engineer.md +23 -0
- package/modules/radar/src/core/agents/test-engineer.md +25 -0
- package/modules/radar/src/core/personas/architect.md +111 -0
- package/modules/radar/src/core/personas/compliance-officer.md +104 -0
- package/modules/radar/src/core/personas/data-engineer.md +113 -0
- package/modules/radar/src/core/personas/devils-advocate.md +105 -0
- package/modules/radar/src/core/personas/performance-engineer.md +119 -0
- package/modules/radar/src/core/personas/principal-engineer.md +119 -0
- package/modules/radar/src/core/personas/reality-gap-analyst.md +111 -0
- package/modules/radar/src/core/personas/security-engineer.md +108 -0
- package/modules/radar/src/core/personas/senior-app-engineer.md +111 -0
- package/modules/radar/src/core/personas/sre.md +117 -0
- package/modules/radar/src/core/personas/staff-engineer.md +109 -0
- package/modules/radar/src/core/personas/test-engineer.md +109 -0
- package/modules/radar/src/core/workflows/disagreement-resolution.md +183 -0
- package/modules/radar/src/core/workflows/phase-0-context.md +148 -0
- package/modules/radar/src/core/workflows/phase-1-reconnaissance.md +169 -0
- package/modules/radar/src/core/workflows/phase-2-domain-audits.md +190 -0
- package/modules/radar/src/core/workflows/phase-3-cross-domain.md +177 -0
- package/modules/radar/src/core/workflows/phase-4-adversarial-review.md +165 -0
- package/modules/radar/src/core/workflows/phase-5-report.md +189 -0
- package/modules/radar/src/core/workflows/phase-checkpoint.md +222 -0
- package/modules/radar/src/core/workflows/session-handoff.md +152 -0
- package/modules/radar/src/domains/00-context.md +201 -0
- package/modules/radar/src/domains/01-architecture.md +248 -0
- package/modules/radar/src/domains/02-data.md +224 -0
- package/modules/radar/src/domains/03-correctness.md +230 -0
- package/modules/radar/src/domains/04-security.md +274 -0
- package/modules/radar/src/domains/05-compliance.md +228 -0
- package/modules/radar/src/domains/06-testing.md +228 -0
- package/modules/radar/src/domains/07-reliability.md +246 -0
- package/modules/radar/src/domains/08-performance.md +247 -0
- package/modules/radar/src/domains/09-maintainability.md +271 -0
- package/modules/radar/src/domains/10-operability.md +250 -0
- package/modules/radar/src/domains/11-change-risk.md +246 -0
- package/modules/radar/src/domains/12-team-risk.md +221 -0
- package/modules/radar/src/domains/13-risk-synthesis.md +202 -0
- package/modules/radar/src/rules/agent-boundaries.md +78 -0
- package/modules/radar/src/rules/disagreement-protocol.md +76 -0
- package/modules/radar/src/rules/epistemic-hygiene.md +78 -0
- package/modules/radar/src/schemas/confidence.md +185 -0
- package/modules/radar/src/schemas/disagreement.md +238 -0
- package/modules/radar/src/schemas/finding.md +287 -0
- package/modules/radar/src/schemas/report-section.md +150 -0
- package/modules/radar/src/schemas/signal.md +108 -0
- package/modules/radar/src/tools/checkov.md +463 -0
- package/modules/radar/src/tools/git-history.md +581 -0
- package/modules/radar/src/tools/gitleaks.md +447 -0
- package/modules/radar/src/tools/grype.md +611 -0
- package/modules/radar/src/tools/semgrep.md +378 -0
- package/modules/radar/src/tools/sonarqube.md +550 -0
- package/modules/radar/src/tools/syft.md +539 -0
- package/modules/radar/src/tools/trivy.md +439 -0
- package/modules/radar/src/transform/agents/change-risk-modeler.md +24 -0
- package/modules/radar/src/transform/agents/execution-validator.md +24 -0
- package/modules/radar/src/transform/agents/guardrail-generator.md +24 -0
- package/modules/radar/src/transform/agents/pedagogy-agent.md +24 -0
- package/modules/radar/src/transform/agents/remediation-architect.md +24 -0
- package/modules/radar/src/transform/personas/change-risk-modeler.md +95 -0
- package/modules/radar/src/transform/personas/execution-validator.md +95 -0
- package/modules/radar/src/transform/personas/guardrail-generator.md +103 -0
- package/modules/radar/src/transform/personas/pedagogy-agent.md +105 -0
- package/modules/radar/src/transform/personas/remediation-architect.md +95 -0
- package/modules/radar/src/transform/rules/change-risk-rules.md +87 -0
- package/modules/radar/src/transform/rules/safety-governance.md +87 -0
- package/modules/radar/src/transform/schemas/change-risk.md +139 -0
- package/modules/radar/src/transform/schemas/intervention-level.md +207 -0
- package/modules/radar/src/transform/schemas/playbook.md +205 -0
- package/modules/radar/src/transform/schemas/verification-plan.md +134 -0
- package/modules/radar/src/transform/workflows/phase-6-remediation.md +148 -0
- package/modules/radar/src/transform/workflows/phase-7-risk-validation.md +161 -0
- package/modules/radar/src/transform/workflows/phase-8-execution-planning.md +159 -0
- package/modules/radar/src/transform/workflows/transform-safety.md +158 -0
- package/modules/vector/.vector-template/sessions/.gitkeep +0 -0
- package/modules/vector/.vector-template/vector.json +72 -0
- package/modules/vector/AUDIT-CLAUDEMD.md +154 -0
- package/modules/vector/INSTALL.md +185 -0
- package/modules/vector/LICENSE +21 -0
- package/modules/vector/README.md +409 -0
- package/modules/vector/VECTOR-BLOCK.md +57 -0
- package/modules/vector/assets/terminal.svg +68 -0
- package/modules/vector/bin/install.js +455 -0
- package/modules/vector/bin/migrate-v1-to-v2.sh +492 -0
- package/modules/vector/commands/help.md +46 -0
- package/modules/vector/hooks/vector-hook.py +775 -0
- package/modules/vector/mcp/index.js +118 -0
- package/modules/vector/mcp/package.json +10 -0
- package/modules/vector/mcp/tools/decisions.js +269 -0
- package/modules/vector/mcp/tools/domains.js +361 -0
- package/modules/vector/mcp/tools/staging.js +252 -0
- package/modules/vector/mcp/tools/vector-json.js +647 -0
- package/modules/vector/package.json +38 -0
- package/modules/vector/schemas/vector.schema.json +237 -0
- package/package.json +39 -0
- package/shared/branding/branding.js +70 -0
- package/shared/config/defaults.json +59 -0
- package/shared/events/README.md +175 -0
- package/shared/events/event-bus.js +134 -0
- package/shared/events/event_bus.py +255 -0
- package/shared/events/integrations.js +161 -0
- package/shared/events/schemas/audit-complete.schema.json +21 -0
- package/shared/events/schemas/phase-progress.schema.json +23 -0
- package/shared/events/schemas/plan-created.schema.json +21 -0
package/bin/install.js
ADDED
|
@@ -0,0 +1,661 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
const readline = require('readline');
|
|
7
|
+
const { execFileSync } = require('child_process');
|
|
8
|
+
|
|
9
|
+
// ─── Branding ───────────────────────────────────────────────
|
|
10
|
+
const BRAND = 'Accelerate';
|
|
11
|
+
const AUTHOR = 'Acceleration Guy';
|
|
12
|
+
const WEBSITE = 'accelerationguy.com';
|
|
13
|
+
|
|
14
|
+
// ─── Colors ─────────────────────────────────────────────────
|
|
15
|
+
const c = {
|
|
16
|
+
reset: '\x1b[0m',
|
|
17
|
+
bold: '\x1b[1m',
|
|
18
|
+
dim: '\x1b[2m',
|
|
19
|
+
green: '\x1b[32m',
|
|
20
|
+
cyan: '\x1b[36m',
|
|
21
|
+
yellow: '\x1b[33m',
|
|
22
|
+
red: '\x1b[31m',
|
|
23
|
+
magenta: '\x1b[35m',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// ─── Module Registry ────────────────────────────────────────
|
|
27
|
+
const MODULES = [
|
|
28
|
+
{
|
|
29
|
+
id: 'vector',
|
|
30
|
+
name: 'Vector',
|
|
31
|
+
desc: 'Rules engine — steers Claude behavior per context',
|
|
32
|
+
recommended: true,
|
|
33
|
+
dependencies: [],
|
|
34
|
+
requiresPython: true,
|
|
35
|
+
hasMcp: true,
|
|
36
|
+
hasHooks: true,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'momentum',
|
|
40
|
+
name: 'Momentum',
|
|
41
|
+
desc: 'Workspace state — tracks tasks, backlog, project health',
|
|
42
|
+
recommended: true,
|
|
43
|
+
dependencies: ['vector'],
|
|
44
|
+
requiresPython: true,
|
|
45
|
+
hasMcp: true,
|
|
46
|
+
hasHooks: true,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'drive',
|
|
50
|
+
name: 'Drive',
|
|
51
|
+
desc: 'Dev workflow — plan, apply, unify loop',
|
|
52
|
+
recommended: true,
|
|
53
|
+
dependencies: [],
|
|
54
|
+
enhancedBy: ['momentum'],
|
|
55
|
+
requiresPython: false,
|
|
56
|
+
hasMcp: false,
|
|
57
|
+
hasHooks: false,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'ignition',
|
|
61
|
+
name: 'Ignition',
|
|
62
|
+
desc: 'Project incubation — guided ideation to planning docs',
|
|
63
|
+
recommended: false,
|
|
64
|
+
dependencies: [],
|
|
65
|
+
enhancedBy: ['drive'],
|
|
66
|
+
requiresPython: false,
|
|
67
|
+
hasMcp: false,
|
|
68
|
+
hasHooks: false,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'radar',
|
|
72
|
+
name: 'Radar',
|
|
73
|
+
desc: 'Security auditing — 12 personas, 14 audit domains',
|
|
74
|
+
recommended: false,
|
|
75
|
+
dependencies: [],
|
|
76
|
+
enhancedBy: ['momentum'],
|
|
77
|
+
requiresPython: false,
|
|
78
|
+
hasMcp: false,
|
|
79
|
+
hasHooks: false,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: 'forge',
|
|
83
|
+
name: 'Forge',
|
|
84
|
+
desc: 'Skill builder — create custom Claude Code extensions',
|
|
85
|
+
recommended: false,
|
|
86
|
+
dependencies: [],
|
|
87
|
+
requiresPython: false,
|
|
88
|
+
hasMcp: false,
|
|
89
|
+
hasHooks: false,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 'mission-control',
|
|
93
|
+
name: 'Mission Control',
|
|
94
|
+
desc: 'Orchestrator — manages all modules',
|
|
95
|
+
recommended: false,
|
|
96
|
+
dependencies: [],
|
|
97
|
+
requiresPython: false,
|
|
98
|
+
hasMcp: false,
|
|
99
|
+
hasHooks: false,
|
|
100
|
+
},
|
|
101
|
+
];
|
|
102
|
+
|
|
103
|
+
// ─── Paths ──────────────────────────────────────────────────
|
|
104
|
+
const ACCEL_HOME = path.join(os.homedir(), '.accel');
|
|
105
|
+
const CLAUDE_HOME = process.env.CLAUDE_CONFIG_DIR
|
|
106
|
+
? expandTilde(process.env.CLAUDE_CONFIG_DIR)
|
|
107
|
+
: path.join(os.homedir(), '.claude');
|
|
108
|
+
const MANIFEST_PATH = path.join(ACCEL_HOME, 'manifest.json');
|
|
109
|
+
const PACKAGE_DIR = path.resolve(__dirname, '..');
|
|
110
|
+
|
|
111
|
+
function expandTilde(p) {
|
|
112
|
+
if (p.startsWith('~/')) return path.join(os.homedir(), p.slice(2));
|
|
113
|
+
return p;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ─── Prerequisite Checks ────────────────────────────────────
|
|
117
|
+
function checkPrerequisites(selectedModules) {
|
|
118
|
+
const issues = [];
|
|
119
|
+
|
|
120
|
+
const nodeVersion = parseInt(process.version.slice(1).split('.')[0]);
|
|
121
|
+
if (nodeVersion < 16) {
|
|
122
|
+
issues.push(`Node.js >= 16 required (you have ${process.version})`);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const needsPython = selectedModules.some(
|
|
126
|
+
(m) => MODULES.find((mod) => mod.id === m)?.requiresPython
|
|
127
|
+
);
|
|
128
|
+
if (needsPython) {
|
|
129
|
+
try {
|
|
130
|
+
const pyVersion = execFileSync('python3', ['--version'], { encoding: 'utf8' }).trim();
|
|
131
|
+
const match = pyVersion.match(/(\d+)\.(\d+)/);
|
|
132
|
+
if (match && (parseInt(match[1]) < 3 || (parseInt(match[1]) === 3 && parseInt(match[2]) < 9))) {
|
|
133
|
+
issues.push(`Python >= 3.9 required for Vector/Momentum hooks (you have ${pyVersion})`);
|
|
134
|
+
}
|
|
135
|
+
} catch {
|
|
136
|
+
issues.push('Python 3.9+ required for Vector/Momentum hooks. Install: brew install python@3.12');
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return issues;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// ─── Dependency Resolution ──────────────────────────────────
|
|
144
|
+
function resolveDependencies(selected) {
|
|
145
|
+
const resolved = new Set(selected);
|
|
146
|
+
let changed = true;
|
|
147
|
+
const autoAdded = [];
|
|
148
|
+
|
|
149
|
+
while (changed) {
|
|
150
|
+
changed = false;
|
|
151
|
+
for (const modId of [...resolved]) {
|
|
152
|
+
const mod = MODULES.find((m) => m.id === modId);
|
|
153
|
+
if (!mod) continue;
|
|
154
|
+
for (const dep of mod.dependencies) {
|
|
155
|
+
if (!resolved.has(dep)) {
|
|
156
|
+
resolved.add(dep);
|
|
157
|
+
autoAdded.push({ module: modId, dependency: dep });
|
|
158
|
+
changed = true;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return { resolved: [...resolved], autoAdded };
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// ─── Install Module ─────────────────────────────────────────
|
|
168
|
+
function installModule(moduleId) {
|
|
169
|
+
const mod = MODULES.find((m) => m.id === moduleId);
|
|
170
|
+
if (!mod) throw new Error(`Unknown module: ${moduleId}`);
|
|
171
|
+
|
|
172
|
+
const srcDir = path.join(PACKAGE_DIR, 'modules', moduleId);
|
|
173
|
+
const destDir = path.join(ACCEL_HOME, 'modules', moduleId);
|
|
174
|
+
const commandsDir = path.join(CLAUDE_HOME, 'commands', moduleId);
|
|
175
|
+
|
|
176
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
177
|
+
fs.mkdirSync(commandsDir, { recursive: true });
|
|
178
|
+
|
|
179
|
+
copyRecursive(srcDir, destDir);
|
|
180
|
+
|
|
181
|
+
// Module-specific command paths (each module has different structure)
|
|
182
|
+
const cmdSrcDirs = [
|
|
183
|
+
'commands', 'tasks', 'src/commands', 'src/tasks',
|
|
184
|
+
// Forge: commands live in skillsmith/ subdir
|
|
185
|
+
'skillsmith/tasks', 'skillsmith',
|
|
186
|
+
// Mission Control: commands live in mission-control/ subdir
|
|
187
|
+
'mission-control/tasks', 'mission-control',
|
|
188
|
+
];
|
|
189
|
+
for (const cmdDir of cmdSrcDirs) {
|
|
190
|
+
const cmdSrc = path.join(srcDir, cmdDir);
|
|
191
|
+
if (fs.existsSync(cmdSrc)) {
|
|
192
|
+
// Only copy .md files from top-level of dir (not recursing into subdirs for entry points)
|
|
193
|
+
const entries = fs.readdirSync(cmdSrc);
|
|
194
|
+
for (const entry of entries) {
|
|
195
|
+
const entryPath = path.join(cmdSrc, entry);
|
|
196
|
+
if (entry.endsWith('.md') && fs.statSync(entryPath).isFile()) {
|
|
197
|
+
fs.copyFileSync(entryPath, path.join(commandsDir, entry));
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (mod.hasHooks) {
|
|
204
|
+
const hooksSrc = path.join(srcDir, 'hooks');
|
|
205
|
+
const srcHooks = path.join(srcDir, 'src', 'hooks');
|
|
206
|
+
const hooksDir = fs.existsSync(hooksSrc) ? hooksSrc : fs.existsSync(srcHooks) ? srcHooks : null;
|
|
207
|
+
if (hooksDir) {
|
|
208
|
+
const hooksDest = path.join(CLAUDE_HOME, 'hooks');
|
|
209
|
+
fs.mkdirSync(hooksDest, { recursive: true });
|
|
210
|
+
copyRecursive(hooksDir, hooksDest);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (mod.hasMcp) {
|
|
215
|
+
const mcpSrc = path.join(srcDir, 'mcp');
|
|
216
|
+
const pkgMcp = path.join(srcDir, 'src', 'packages', `${moduleId}-mcp`);
|
|
217
|
+
const mcpDir = fs.existsSync(mcpSrc) ? mcpSrc : fs.existsSync(pkgMcp) ? pkgMcp : null;
|
|
218
|
+
if (mcpDir) {
|
|
219
|
+
const mcpDest = path.join(ACCEL_HOME, 'mcp', moduleId);
|
|
220
|
+
fs.mkdirSync(mcpDest, { recursive: true });
|
|
221
|
+
copyRecursive(mcpDir, mcpDest);
|
|
222
|
+
if (fs.existsSync(path.join(mcpDest, 'package.json'))) {
|
|
223
|
+
try {
|
|
224
|
+
execFileSync('npm', ['install', '--production', '--silent'], { cwd: mcpDest, stdio: 'pipe' });
|
|
225
|
+
} catch (e) {
|
|
226
|
+
console.log(` ${c.yellow}Warning: MCP dependencies for ${mod.name} failed to install${c.reset}`);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function copyRecursive(src, dest) {
|
|
236
|
+
if (!fs.existsSync(src)) return;
|
|
237
|
+
const stat = fs.statSync(src);
|
|
238
|
+
if (stat.isDirectory()) {
|
|
239
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
240
|
+
for (const item of fs.readdirSync(src)) {
|
|
241
|
+
if (item === '.git' || item === 'node_modules') continue;
|
|
242
|
+
copyRecursive(path.join(src, item), path.join(dest, item));
|
|
243
|
+
}
|
|
244
|
+
} else {
|
|
245
|
+
fs.copyFileSync(src, dest);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// ─── Manifest ───────────────────────────────────────────────
|
|
250
|
+
function writeManifest(installedModules) {
|
|
251
|
+
const manifest = {
|
|
252
|
+
schemaVersion: 1,
|
|
253
|
+
version: '1.0.0',
|
|
254
|
+
brand: BRAND,
|
|
255
|
+
author: AUTHOR,
|
|
256
|
+
installedAt: new Date().toISOString(),
|
|
257
|
+
modules: {},
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
for (const modId of installedModules) {
|
|
261
|
+
const mod = MODULES.find((m) => m.id === modId);
|
|
262
|
+
manifest.modules[modId] = {
|
|
263
|
+
name: mod.name,
|
|
264
|
+
installed: true,
|
|
265
|
+
installedAt: new Date().toISOString(),
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
fs.mkdirSync(path.dirname(MANIFEST_PATH), { recursive: true });
|
|
270
|
+
fs.writeFileSync(MANIFEST_PATH, JSON.stringify(manifest, null, 2));
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// ─── CLAUDE.md Block ────────────────────────────────────────
|
|
274
|
+
function installClaudeMdBlock() {
|
|
275
|
+
const claudeMdPath = path.join(process.cwd(), 'CLAUDE.md');
|
|
276
|
+
const START_MARKER = '<!-- ACCELERATE START -->';
|
|
277
|
+
const END_MARKER = '<!-- ACCELERATE END -->';
|
|
278
|
+
|
|
279
|
+
const block = `${START_MARKER}
|
|
280
|
+
## Accelerate by ${AUTHOR}
|
|
281
|
+
|
|
282
|
+
This project uses **Accelerate** — a unified Claude Code agent framework.
|
|
283
|
+
|
|
284
|
+
Available module commands:
|
|
285
|
+
- \`/vector:help\` — Rules engine
|
|
286
|
+
- \`/momentum:pulse\` — Workspace health check
|
|
287
|
+
- \`/momentum:scaffold\` — Setup workspace
|
|
288
|
+
- \`/drive:progress\` — Check plan progress
|
|
289
|
+
- \`/drive:resume\` — Resume where you left off
|
|
290
|
+
- \`/ignition\` — Start a new project
|
|
291
|
+
- \`/radar:audit\` — Run security audit
|
|
292
|
+
- \`/forge\` — Build custom skills
|
|
293
|
+
- \`/accel status\` — See what's installed
|
|
294
|
+
- \`/accel help\` — See all commands
|
|
295
|
+
|
|
296
|
+
Learn more: https://${WEBSITE}/accelerate
|
|
297
|
+
${END_MARKER}`;
|
|
298
|
+
|
|
299
|
+
if (fs.existsSync(claudeMdPath)) {
|
|
300
|
+
let content = fs.readFileSync(claudeMdPath, 'utf8');
|
|
301
|
+
if (content.includes(START_MARKER)) {
|
|
302
|
+
const regex = new RegExp(`${START_MARKER}[\\s\\S]*?${END_MARKER}`, 'g');
|
|
303
|
+
content = content.replace(regex, block);
|
|
304
|
+
} else {
|
|
305
|
+
content += '\n\n' + block;
|
|
306
|
+
}
|
|
307
|
+
fs.writeFileSync(claudeMdPath, content);
|
|
308
|
+
} else {
|
|
309
|
+
fs.writeFileSync(claudeMdPath, block + '\n');
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// ─── MCP Server Registration ────────────────────────────────
|
|
314
|
+
const MCP_CONFIG_PATH = path.join(os.homedir(), '.mcp.json');
|
|
315
|
+
|
|
316
|
+
const MCP_SERVERS = {
|
|
317
|
+
vector: {
|
|
318
|
+
name: 'vector-mcp',
|
|
319
|
+
command: 'node',
|
|
320
|
+
args: [path.join(ACCEL_HOME, 'mcp', 'vector', 'index.js')],
|
|
321
|
+
type: 'stdio',
|
|
322
|
+
},
|
|
323
|
+
momentum: {
|
|
324
|
+
name: 'momentum-mcp',
|
|
325
|
+
command: 'node',
|
|
326
|
+
args: [path.join(ACCEL_HOME, 'mcp', 'momentum', 'index.js')],
|
|
327
|
+
type: 'stdio',
|
|
328
|
+
},
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
function registerMcpServers(installedModules) {
|
|
332
|
+
let mcpConfig = { mcpServers: {} };
|
|
333
|
+
|
|
334
|
+
// Read existing config if present
|
|
335
|
+
if (fs.existsSync(MCP_CONFIG_PATH)) {
|
|
336
|
+
try {
|
|
337
|
+
mcpConfig = JSON.parse(fs.readFileSync(MCP_CONFIG_PATH, 'utf8'));
|
|
338
|
+
if (!mcpConfig.mcpServers) mcpConfig.mcpServers = {};
|
|
339
|
+
} catch {
|
|
340
|
+
// If the file is malformed, start fresh but preserve it
|
|
341
|
+
console.log(` ${c.yellow}Warning: ~/.mcp.json was malformed, merging cautiously${c.reset}`);
|
|
342
|
+
mcpConfig = { mcpServers: {} };
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
let registered = 0;
|
|
347
|
+
for (const modId of installedModules) {
|
|
348
|
+
const serverDef = MCP_SERVERS[modId];
|
|
349
|
+
if (!serverDef) continue;
|
|
350
|
+
|
|
351
|
+
mcpConfig.mcpServers[serverDef.name] = {
|
|
352
|
+
command: serverDef.command,
|
|
353
|
+
args: serverDef.args,
|
|
354
|
+
type: serverDef.type,
|
|
355
|
+
};
|
|
356
|
+
registered++;
|
|
357
|
+
console.log(` ${c.green}\u2713${c.reset} MCP server registered: ${serverDef.name}`);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (registered > 0) {
|
|
361
|
+
fs.writeFileSync(MCP_CONFIG_PATH, JSON.stringify(mcpConfig, null, 2));
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
return registered;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// ─── Hook Registration ──────────────────────────────────────
|
|
368
|
+
const SETTINGS_PATH = path.join(CLAUDE_HOME, 'settings.json');
|
|
369
|
+
|
|
370
|
+
// Marker used to identify hooks managed by Accelerate
|
|
371
|
+
const ACCEL_HOOK_MARKER = '__accelerate';
|
|
372
|
+
|
|
373
|
+
const HOOK_DEFINITIONS = {
|
|
374
|
+
vector: [
|
|
375
|
+
{ event: 'UserPromptSubmit', script: 'vector-hook.py' },
|
|
376
|
+
],
|
|
377
|
+
momentum: [
|
|
378
|
+
{ event: 'UserPromptSubmit', script: 'active-hook.py' },
|
|
379
|
+
{ event: 'UserPromptSubmit', script: 'backlog-hook.py' },
|
|
380
|
+
{ event: 'UserPromptSubmit', script: 'momentum-pulse-check.py' },
|
|
381
|
+
{ event: 'UserPromptSubmit', script: 'psmm-injector.py' },
|
|
382
|
+
{ event: 'UserPromptSubmit', script: 'satellite-detection.py' },
|
|
383
|
+
{ event: 'UserPromptSubmit', script: 'operator.py' },
|
|
384
|
+
{ event: 'UserPromptSubmit', script: 'apex-insights.py' },
|
|
385
|
+
],
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
function registerHooks(installedModules) {
|
|
389
|
+
let settings = {};
|
|
390
|
+
|
|
391
|
+
// Read existing settings.json or start fresh
|
|
392
|
+
if (fs.existsSync(SETTINGS_PATH)) {
|
|
393
|
+
try {
|
|
394
|
+
settings = JSON.parse(fs.readFileSync(SETTINGS_PATH, 'utf8'));
|
|
395
|
+
} catch {
|
|
396
|
+
console.log(` ${c.yellow}Warning: ${SETTINGS_PATH} was malformed, merging cautiously${c.reset}`);
|
|
397
|
+
settings = {};
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if (!settings.hooks) settings.hooks = {};
|
|
402
|
+
|
|
403
|
+
// First, remove any existing Accelerate hooks (to avoid duplicates on reinstall)
|
|
404
|
+
for (const eventName of Object.keys(settings.hooks)) {
|
|
405
|
+
if (Array.isArray(settings.hooks[eventName])) {
|
|
406
|
+
settings.hooks[eventName] = settings.hooks[eventName].filter(
|
|
407
|
+
(h) => !h[ACCEL_HOOK_MARKER]
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
let registered = 0;
|
|
413
|
+
const hooksDir = path.join(CLAUDE_HOME, 'hooks');
|
|
414
|
+
|
|
415
|
+
for (const modId of installedModules) {
|
|
416
|
+
const hookDefs = HOOK_DEFINITIONS[modId];
|
|
417
|
+
if (!hookDefs) continue;
|
|
418
|
+
|
|
419
|
+
for (const def of hookDefs) {
|
|
420
|
+
const hookPath = path.join(hooksDir, def.script);
|
|
421
|
+
const hookEntry = {
|
|
422
|
+
type: 'command',
|
|
423
|
+
command: `python3 ${hookPath}`,
|
|
424
|
+
[ACCEL_HOOK_MARKER]: true,
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
if (!Array.isArray(settings.hooks[def.event])) {
|
|
428
|
+
settings.hooks[def.event] = [];
|
|
429
|
+
}
|
|
430
|
+
settings.hooks[def.event].push(hookEntry);
|
|
431
|
+
registered++;
|
|
432
|
+
console.log(` ${c.green}\u2713${c.reset} Hook registered: ${def.script} (${def.event})`);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
if (registered > 0) {
|
|
437
|
+
fs.mkdirSync(path.dirname(SETTINGS_PATH), { recursive: true });
|
|
438
|
+
fs.writeFileSync(SETTINGS_PATH, JSON.stringify(settings, null, 2));
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
return registered;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
function deregisterHooks() {
|
|
445
|
+
if (!fs.existsSync(SETTINGS_PATH)) return;
|
|
446
|
+
|
|
447
|
+
let settings;
|
|
448
|
+
try {
|
|
449
|
+
settings = JSON.parse(fs.readFileSync(SETTINGS_PATH, 'utf8'));
|
|
450
|
+
} catch {
|
|
451
|
+
return; // Can't parse, nothing to clean
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
if (!settings.hooks) return;
|
|
455
|
+
|
|
456
|
+
let changed = false;
|
|
457
|
+
for (const eventName of Object.keys(settings.hooks)) {
|
|
458
|
+
if (!Array.isArray(settings.hooks[eventName])) continue;
|
|
459
|
+
const before = settings.hooks[eventName].length;
|
|
460
|
+
settings.hooks[eventName] = settings.hooks[eventName].filter(
|
|
461
|
+
(h) => !h[ACCEL_HOOK_MARKER]
|
|
462
|
+
);
|
|
463
|
+
if (settings.hooks[eventName].length !== before) changed = true;
|
|
464
|
+
// Remove empty arrays to keep settings tidy
|
|
465
|
+
if (settings.hooks[eventName].length === 0) {
|
|
466
|
+
delete settings.hooks[eventName];
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
// Remove empty hooks object
|
|
470
|
+
if (Object.keys(settings.hooks).length === 0) {
|
|
471
|
+
delete settings.hooks;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
if (changed) {
|
|
475
|
+
fs.writeFileSync(SETTINGS_PATH, JSON.stringify(settings, null, 2));
|
|
476
|
+
console.log(` ${c.green}\u2713${c.reset} Accelerate hooks removed from settings.json`);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// ─── Event Bus Setup ────────────────────────────────────────
|
|
481
|
+
function setupEventBus() {
|
|
482
|
+
const eventsDir = path.join(ACCEL_HOME, 'events');
|
|
483
|
+
fs.mkdirSync(path.join(eventsDir, 'archive'), { recursive: true });
|
|
484
|
+
fs.mkdirSync(path.join(eventsDir, 'errors'), { recursive: true });
|
|
485
|
+
fs.mkdirSync(path.join(eventsDir, 'schemas'), { recursive: true });
|
|
486
|
+
|
|
487
|
+
const schemasSrc = path.join(PACKAGE_DIR, 'shared', 'events', 'schemas');
|
|
488
|
+
if (fs.existsSync(schemasSrc)) {
|
|
489
|
+
copyRecursive(schemasSrc, path.join(eventsDir, 'schemas'));
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// ─── Interactive Module Selector ────────────────────────────
|
|
494
|
+
async function selectModules() {
|
|
495
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
496
|
+
const question = (q) => new Promise((resolve) => rl.question(q, resolve));
|
|
497
|
+
|
|
498
|
+
console.log(`\n ${c.cyan}${c.bold}Welcome to ${BRAND} by ${AUTHOR}!${c.reset}\n`);
|
|
499
|
+
console.log(` Select modules to install:\n`);
|
|
500
|
+
|
|
501
|
+
for (const mod of MODULES) {
|
|
502
|
+
const tag = mod.recommended ? ` ${c.green}RECOMMENDED${c.reset}` : '';
|
|
503
|
+
const deps = mod.dependencies.length
|
|
504
|
+
? ` ${c.dim}(requires: ${mod.dependencies.join(', ')})${c.reset}`
|
|
505
|
+
: '';
|
|
506
|
+
console.log(` [x] ${c.bold}${mod.name}${c.reset} — ${mod.desc}${tag}${deps}`);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
console.log(`\n ${c.dim}Press Enter to install all (recommended), or type module names to toggle${c.reset}`);
|
|
510
|
+
|
|
511
|
+
const answer = await question(`\n ${c.cyan}>${c.reset} `);
|
|
512
|
+
rl.close();
|
|
513
|
+
|
|
514
|
+
if (answer.trim() === '') {
|
|
515
|
+
return MODULES.map((m) => m.id);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
const selected = new Set(MODULES.map((m) => m.id));
|
|
519
|
+
const toggles = answer.toLowerCase().split(/[,\s]+/).filter(Boolean);
|
|
520
|
+
for (const toggle of toggles) {
|
|
521
|
+
const mod = MODULES.find(
|
|
522
|
+
(m) => m.id === toggle || m.name.toLowerCase() === toggle
|
|
523
|
+
);
|
|
524
|
+
if (mod) {
|
|
525
|
+
if (selected.has(mod.id)) selected.delete(mod.id);
|
|
526
|
+
else selected.add(mod.id);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
return [...selected];
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
// ─── Main ───────────────────────────────────────────────────
|
|
534
|
+
async function main() {
|
|
535
|
+
const args = process.argv.slice(2);
|
|
536
|
+
const nonInteractive = args.includes('--all') || args.includes('--non-interactive');
|
|
537
|
+
const isStatus = args.includes('status');
|
|
538
|
+
const isUninstall = args.includes('uninstall');
|
|
539
|
+
const isUpdate = args.includes('update');
|
|
540
|
+
|
|
541
|
+
if (isStatus) {
|
|
542
|
+
if (!fs.existsSync(MANIFEST_PATH)) {
|
|
543
|
+
console.log(`\n ${c.yellow}No modules installed. Run \`npx @accel/cli\` to get started.${c.reset}\n`);
|
|
544
|
+
process.exit(0);
|
|
545
|
+
}
|
|
546
|
+
const manifest = JSON.parse(fs.readFileSync(MANIFEST_PATH, 'utf8'));
|
|
547
|
+
console.log(`\n ${c.cyan}${c.bold}${BRAND} v${manifest.version}${c.reset}\n`);
|
|
548
|
+
for (const [id, info] of Object.entries(manifest.modules)) {
|
|
549
|
+
console.log(` ${c.green}\u2713${c.reset} ${info.name} (${id})`);
|
|
550
|
+
}
|
|
551
|
+
console.log(`\n ${c.dim}Installed: ${manifest.installedAt}${c.reset}\n`);
|
|
552
|
+
process.exit(0);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
if (isUninstall) {
|
|
556
|
+
console.log(`\n ${c.yellow}Uninstalling ${BRAND}...${c.reset}`);
|
|
557
|
+
if (fs.existsSync(ACCEL_HOME)) fs.rmSync(ACCEL_HOME, { recursive: true, force: true });
|
|
558
|
+
for (const mod of MODULES) {
|
|
559
|
+
const cmdDir = path.join(CLAUDE_HOME, 'commands', mod.id);
|
|
560
|
+
if (fs.existsSync(cmdDir)) fs.rmSync(cmdDir, { recursive: true, force: true });
|
|
561
|
+
}
|
|
562
|
+
deregisterHooks();
|
|
563
|
+
console.log(` ${c.green}\u2713${c.reset} ${BRAND} uninstalled.\n`);
|
|
564
|
+
process.exit(0);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
if (fs.existsSync(MANIFEST_PATH) && !isUpdate && !nonInteractive) {
|
|
568
|
+
const manifest = JSON.parse(fs.readFileSync(MANIFEST_PATH, 'utf8'));
|
|
569
|
+
const modCount = Object.keys(manifest.modules).length;
|
|
570
|
+
console.log(`\n ${c.yellow}${BRAND} is already installed (v${manifest.version}, ${modCount} modules).${c.reset}`);
|
|
571
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
572
|
+
const answer = await new Promise((resolve) =>
|
|
573
|
+
rl.question(` Update / Reinstall / Cancel? [u/r/C] `, resolve)
|
|
574
|
+
);
|
|
575
|
+
rl.close();
|
|
576
|
+
if (answer.toLowerCase() === 'c' || answer.trim() === '') {
|
|
577
|
+
console.log(' Cancelled.\n');
|
|
578
|
+
process.exit(0);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
let selectedModules;
|
|
583
|
+
if (nonInteractive) {
|
|
584
|
+
selectedModules = MODULES.map((m) => m.id);
|
|
585
|
+
} else {
|
|
586
|
+
selectedModules = await selectModules();
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
const { resolved, autoAdded } = resolveDependencies(selectedModules);
|
|
590
|
+
for (const { module: mod, dependency: dep } of autoAdded) {
|
|
591
|
+
const modName = MODULES.find((m) => m.id === mod)?.name;
|
|
592
|
+
const depName = MODULES.find((m) => m.id === dep)?.name;
|
|
593
|
+
console.log(` ${c.cyan}${modName} requires ${depName} \u2014 adding automatically${c.reset}`);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
const issues = checkPrerequisites(resolved);
|
|
597
|
+
if (issues.length > 0) {
|
|
598
|
+
console.log(`\n ${c.red}${c.bold}Prerequisites not met:${c.reset}`);
|
|
599
|
+
for (const issue of issues) {
|
|
600
|
+
console.log(` ${c.red}\u2717${c.reset} ${issue}`);
|
|
601
|
+
}
|
|
602
|
+
process.exit(1);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
console.log(`\n ${c.bold}Installing ${BRAND}...${c.reset}\n`);
|
|
606
|
+
|
|
607
|
+
const installed = [];
|
|
608
|
+
const failed = [];
|
|
609
|
+
|
|
610
|
+
const installOrder = [];
|
|
611
|
+
const added = new Set();
|
|
612
|
+
function addWithDeps(modId) {
|
|
613
|
+
if (added.has(modId)) return;
|
|
614
|
+
const mod = MODULES.find((m) => m.id === modId);
|
|
615
|
+
if (!mod) return;
|
|
616
|
+
for (const dep of mod.dependencies) addWithDeps(dep);
|
|
617
|
+
installOrder.push(modId);
|
|
618
|
+
added.add(modId);
|
|
619
|
+
}
|
|
620
|
+
for (const modId of resolved) addWithDeps(modId);
|
|
621
|
+
|
|
622
|
+
for (const modId of installOrder) {
|
|
623
|
+
const mod = MODULES.find((m) => m.id === modId);
|
|
624
|
+
try {
|
|
625
|
+
installModule(modId);
|
|
626
|
+
installed.push(modId);
|
|
627
|
+
console.log(` ${c.green}\u2713${c.reset} ${mod.name} installed (${mod.desc.split('\u2014')[0].trim()})`);
|
|
628
|
+
} catch (e) {
|
|
629
|
+
failed.push({ id: modId, error: e.message });
|
|
630
|
+
console.log(` ${c.red}\u2717${c.reset} ${mod.name} failed: ${e.message}`);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
setupEventBus();
|
|
635
|
+
|
|
636
|
+
if (installed.length > 0) {
|
|
637
|
+
writeManifest(installed);
|
|
638
|
+
installClaudeMdBlock();
|
|
639
|
+
registerMcpServers(installed);
|
|
640
|
+
registerHooks(installed);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
console.log('');
|
|
644
|
+
if (failed.length > 0) {
|
|
645
|
+
console.log(` ${c.yellow}${installed.length}/${installOrder.length} modules installed. Run \`npx @accel/cli repair\` to retry.${c.reset}`);
|
|
646
|
+
for (const f of failed) {
|
|
647
|
+
console.log(` ${c.red}\u2717${c.reset} ${f.id}: ${f.error}`);
|
|
648
|
+
}
|
|
649
|
+
} else {
|
|
650
|
+
console.log(` ${c.green}${c.bold}${BRAND} is ready!${c.reset} Restart Claude Code and try:`);
|
|
651
|
+
console.log(` ${c.cyan}/accel status${c.reset} \u2014 see what's installed`);
|
|
652
|
+
console.log(` ${c.cyan}/accel help${c.reset} \u2014 see all commands`);
|
|
653
|
+
console.log(` ${c.cyan}/ignition${c.reset} \u2014 start a new project`);
|
|
654
|
+
}
|
|
655
|
+
console.log('');
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
main().catch((e) => {
|
|
659
|
+
console.error(`${c.red}Error: ${e.message}${c.reset}`);
|
|
660
|
+
process.exit(1);
|
|
661
|
+
});
|