@daniellins/power-claude 0.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @daniellins/power-claude might be problematic. Click here for more details.
- package/LICENSE +21 -0
- package/README.md +121 -0
- package/bin/cli.js +124 -0
- package/installer/__tests__/doctor-ready-oracles.test.cjs +140 -0
- package/installer/__tests__/merge-settings.test.cjs +330 -0
- package/installer/adopt.js +161 -0
- package/installer/copy.js +203 -0
- package/installer/doctor.js +266 -0
- package/installer/install.js +155 -0
- package/installer/manifest.js +102 -0
- package/installer/motor-scripts.js +50 -0
- package/installer/motor-scripts.json +39 -0
- package/installer/uninstall.js +99 -0
- package/installer/update.js +376 -0
- package/installer/util.js +113 -0
- package/installer/wizard.js +64 -0
- package/package.json +26 -0
- package/scripts/__fixtures__/anti-path-demo/agents/ap-writer.md +13 -0
- package/scripts/__fixtures__/anti-path-demo/templates/write-tmpl.md +7 -0
- package/scripts/__fixtures__/anti-path-demo/workflows/wf-ap.smoke.json +10 -0
- package/scripts/__fixtures__/anti-path-demo/workflows/wf-ap.yaml +25 -0
- package/scripts/__fixtures__/assess-tier/retrofit-leve/pod/agents/content-chief.md +1 -0
- package/scripts/__fixtures__/assess-tier/retrofit-leve/pod/workflows/wf-criacao-redteam.yaml +3 -0
- package/scripts/__fixtures__/assess-tier/retrofit-leve/pod-spec.json +13 -0
- package/scripts/__fixtures__/fidelity/fake-green-average-in-band.yaml +21 -0
- package/scripts/__fixtures__/fidelity/fake-green-average.yaml +18 -0
- package/scripts/__fixtures__/fidelity/fake-green-denominator.yaml +19 -0
- package/scripts/__fixtures__/fidelity/fake-green-missing-evidence.yaml +18 -0
- package/scripts/__fixtures__/fidelity/fake-green-threshold.yaml +18 -0
- package/scripts/__fixtures__/fidelity/fake-green-weight.yaml +18 -0
- package/scripts/__fixtures__/fidelity/golden.yaml +31 -0
- package/scripts/__fixtures__/fidelity/trindade-incoherent.yaml +15 -0
- package/scripts/__fixtures__/forge-canonical/pod-spec-example.json +37 -0
- package/scripts/__fixtures__/migrate-squad/authored/agents/offer-engineer.md +17 -0
- package/scripts/__fixtures__/migrate-squad/authored/knowledge/no-source.md +7 -0
- package/scripts/__fixtures__/migrate-squad/authored/knowledge/value-stack-method.md +8 -0
- package/scripts/__fixtures__/migrate-squad/authored/specs/wf-sample.smoke.json +24 -0
- package/scripts/__fixtures__/migrate-squad/authored/specs/wf-sample.spec.json +45 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/HEADLINE.md +3 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/README.md +4 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/agents/hormozi-offer.md +14 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/checklists/dead-redundant.md +4 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/checklists/method-guide.md +6 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/checklists/veto-screen.md +4 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/config/config.yaml +2 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/data/case-library.md +3 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/scripts/validate-mvn.py +16 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/sops/sop-sample.md +3 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/squad-io.yaml +14 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/tasks/gather-context.md +7 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/templates/output-tmpl.md +5 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/workflows/wf-sample.yaml +24 -0
- package/scripts/__fixtures__/pipeline/pipelines/pipeline-checkpoint.yaml +21 -0
- package/scripts/__fixtures__/pipeline/pipelines/pipeline-demo.yaml +22 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-a/agents/maker.md +13 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-a/memory/learnings.consolidated.md +8 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-a/memory/learnings.jsonl +83 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-a/templates/make-tmpl.md +8 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-a/workflows/wf-a.yaml +16 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-b/agents/user.md +13 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-b/memory/learnings.consolidated.md +8 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-b/memory/learnings.jsonl +14 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-b/templates/use-tmpl.md +6 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-b/workflows/wf-b.yaml +16 -0
- package/scripts/__fixtures__/pod-run/agents/forge-chief.md +13 -0
- package/scripts/__fixtures__/pod-run/agents/pod-critic.md +13 -0
- package/scripts/__fixtures__/pod-run/templates/build-tmpl.md +8 -0
- package/scripts/__fixtures__/pod-run/templates/gate-tmpl.md +6 -0
- package/scripts/__fixtures__/pod-run/workflows/wf-min.yaml +43 -0
- package/scripts/__fixtures__/pod-run/workflows/wf-skip-modes.yaml +50 -0
- package/scripts/__fixtures__/pod-workflow/invalid-checkpoint-all-skippable.yaml +30 -0
- package/scripts/__fixtures__/pod-workflow/invalid-checkpoint-criteria-escalar-de-bloco.yaml +40 -0
- package/scripts/__fixtures__/pod-workflow/invalid-checkpoint-skip-mode-desconhecido.yaml +30 -0
- package/scripts/__fixtures__/pod-workflow/invalid-checkpoint-unknown-key.yaml +29 -0
- package/scripts/__fixtures__/pod-workflow/invalid-cycle.yaml +26 -0
- package/scripts/__fixtures__/pod-workflow/invalid-fix-loop-backedge.yaml +29 -0
- package/scripts/__fixtures__/pod-workflow/invalid-fix-loop-forward.yaml +29 -0
- package/scripts/__fixtures__/pod-workflow/invalid-handoff-open.yaml +27 -0
- package/scripts/__fixtures__/pod-workflow/invalid-knowledge-shape.yaml +18 -0
- package/scripts/__fixtures__/pod-workflow/invalid-missing-agent.yaml +15 -0
- package/scripts/__fixtures__/pod-workflow/invalid-missing-outputs.yaml +15 -0
- package/scripts/__fixtures__/pod-workflow/invalid-missing-template.yaml +15 -0
- package/scripts/__fixtures__/pod-workflow/invalid-missing-veto.yaml +13 -0
- package/scripts/__fixtures__/pod-workflow/invalid-template-not-on-disk.yaml +16 -0
- package/scripts/__fixtures__/pod-workflow/invalid-veto-prose.yaml +17 -0
- package/scripts/__fixtures__/pod-workflow/knowledge/a.md +4 -0
- package/scripts/__fixtures__/pod-workflow/knowledge/b.md +4 -0
- package/scripts/__fixtures__/pod-workflow/knowledge/c.md +4 -0
- package/scripts/__fixtures__/pod-workflow/templates/step-tmpl.md +7 -0
- package/scripts/__fixtures__/pod-workflow/valid-checkpoint-skip-modes.yaml +29 -0
- package/scripts/__fixtures__/pod-workflow/valid-fix-loop.yaml +30 -0
- package/scripts/__fixtures__/pod-workflow/valid-knowledge.yaml +30 -0
- package/scripts/__fixtures__/pod-workflow/valid-veto-always-true.yaml +20 -0
- package/scripts/__fixtures__/pod-workflow/valid.yaml +27 -0
- package/scripts/__fixtures__/smoke-canary/agents/canary-reporter.md +13 -0
- package/scripts/__fixtures__/smoke-canary/agents/canary-researcher.md +13 -0
- package/scripts/__fixtures__/smoke-canary/agents/canary-synth.md +13 -0
- package/scripts/__fixtures__/smoke-canary/memory/learnings.consolidated.md +10 -0
- package/scripts/__fixtures__/smoke-canary/memory/learnings.jsonl +448 -0
- package/scripts/__fixtures__/smoke-canary/templates/report-tmpl.md +9 -0
- package/scripts/__fixtures__/smoke-canary/templates/research-tmpl.md +7 -0
- package/scripts/__fixtures__/smoke-canary/templates/synth-tmpl.md +9 -0
- package/scripts/__fixtures__/smoke-canary/workflows/wf-canary.smoke.json +11 -0
- package/scripts/__fixtures__/smoke-canary/workflows/wf-canary.yaml +53 -0
- package/scripts/__fixtures__/source-audit/fake-green-bronze-unsignaled.yaml +10 -0
- package/scripts/__fixtures__/source-audit/fake-green-counts.yaml +9 -0
- package/scripts/__fixtures__/source-audit/fake-green-missing-evidence.yaml +9 -0
- package/scripts/__fixtures__/source-audit/fake-green-unclassified.yaml +10 -0
- package/scripts/__fixtures__/source-audit/fake-green-verdict.yaml +10 -0
- package/scripts/__fixtures__/source-audit/golden-blocked.yaml +10 -0
- package/scripts/__fixtures__/source-audit/golden.yaml +11 -0
- package/scripts/__fixtures__/sweep-forms/agents/forms-count.md +13 -0
- package/scripts/__fixtures__/sweep-forms/agents/forms-field.md +13 -0
- package/scripts/__fixtures__/sweep-forms/agents/forms-fileref.md +13 -0
- package/scripts/__fixtures__/sweep-forms/agents/forms-json.md +13 -0
- package/scripts/__fixtures__/sweep-forms/agents/forms-section.md +13 -0
- package/scripts/__fixtures__/sweep-forms/specs/wf-forms.spec.json +5 -0
- package/scripts/__fixtures__/sweep-forms/templates/t_count.md +5 -0
- package/scripts/__fixtures__/sweep-forms/templates/t_field.md +3 -0
- package/scripts/__fixtures__/sweep-forms/templates/t_fileref.md +3 -0
- package/scripts/__fixtures__/sweep-forms/templates/t_json.md +0 -0
- package/scripts/__fixtures__/sweep-forms/templates/t_section.md +3 -0
- package/scripts/__fixtures__/sweep-forms/workflows/wf-forms.smoke.json +13 -0
- package/scripts/__fixtures__/sweep-forms/workflows/wf-forms.yaml +67 -0
- package/scripts/__fixtures__/validate-story-acs-corpus/corpus-1-noop-state-json.fixture.md +18 -0
- package/scripts/__fixtures__/validate-story-acs-corpus/corpus-2-crash-buildworkflowyaml.fixture.md +26 -0
- package/scripts/__fixtures__/validate-story-acs-corpus/corpus-3-nasce-verde-skip-modes.fixture.md +29 -0
- package/scripts/__fixtures__/validate-story-acs-corpus/corpus-4-guarda-sem-irmao.fixture.md +17 -0
- package/scripts/__fixtures__/validate-story-acs-corpus/corpus-5a-diff-stat-sem-guarda.fixture.md +17 -0
- package/scripts/__fixtures__/validate-story-acs-corpus/corpus-5b-test-f-sobre-diretorio.fixture.md +20 -0
- package/scripts/__fixtures__/veto-checks/copy-clean.md +4 -0
- package/scripts/__fixtures__/veto-checks/copy-dashes.md +4 -0
- package/scripts/__fixtures__/veto-checks/n8n-bad.md +18 -0
- package/scripts/__fixtures__/veto-checks/n8n-ok.md +22 -0
- package/scripts/__fixtures__/veto-checks/page-bad.html +7 -0
- package/scripts/__fixtures__/veto-checks/phash/copy.png +0 -0
- package/scripts/__fixtures__/veto-checks/phash/distinct.png +0 -0
- package/scripts/__fixtures__/veto-checks/phash/distinct2.png +0 -0
- package/scripts/__fixtures__/veto-checks/phash/make-fixtures.cjs +203 -0
- package/scripts/__fixtures__/veto-checks/phash/ref.png +0 -0
- package/scripts/__fixtures__/veto-checks/slide-ok.html +15 -0
- package/scripts/__fixtures__/veto-checks/slide-overflow.html +14 -0
- package/scripts/__fixtures__/veto-checks/sweep-pod/agents/vc-checker.md +13 -0
- package/scripts/__fixtures__/veto-checks/sweep-pod/templates/check-tmpl.md +6 -0
- package/scripts/__fixtures__/veto-checks/sweep-pod/workflows/wf-vc.smoke.json +10 -0
- package/scripts/__fixtures__/veto-checks/sweep-pod/workflows/wf-vc.yaml +19 -0
- package/scripts/__fixtures__/voz-do-dono/README.md +23 -0
- package/scripts/__fixtures__/voz-do-dono/dono-escalar.yaml +9 -0
- package/scripts/__fixtures__/voz-do-dono/dono-guia.yaml +10 -0
- package/scripts/__fixtures__/voz-do-dono/peca-3a-pessoa.md +6 -0
- package/scripts/__fixtures__/voz-do-dono/peca-com-lexico-proibido.md +6 -0
- package/scripts/__fixtures__/voz-do-dono/peca-limpa-1a-pessoa.md +6 -0
- package/scripts/__tests__/derive-ready-transitions.test.cjs +269 -0
- package/scripts/__tests__/enforce-cycle-authority.test.cjs +869 -0
- package/scripts/__tests__/enforce-git-push-authority.test.cjs +701 -0
- package/scripts/__tests__/enforce-ready-oracles.test.cjs +745 -0
- package/scripts/__tests__/motor-scripts.test.cjs +339 -0
- package/scripts/__tests__/pc-run-pod-counter.test.cjs +58 -0
- package/scripts/__tests__/pc-run-pod.test.cjs +578 -0
- package/scripts/__tests__/validate-pod-workflow.test.cjs +90 -0
- package/scripts/__tests__/validate-story-acs.test.cjs +607 -0
- package/scripts/anti-path.test.cjs +163 -0
- package/scripts/arena.cjs +514 -0
- package/scripts/arena.test.cjs +213 -0
- package/scripts/brief-leitura-obrigatoria.test.cjs +364 -0
- package/scripts/consolidate-knowledge-runner.test.cjs +249 -0
- package/scripts/default-funcional.test.cjs +153 -0
- package/scripts/derive-ready-transitions.cjs +325 -0
- package/scripts/forge-additive.test.cjs +158 -0
- package/scripts/forge-assess-tier.cjs +205 -0
- package/scripts/forge-assess-tier.test.cjs +114 -0
- package/scripts/forge-canonical.test.cjs +624 -0
- package/scripts/forge-generate.cjs +1303 -0
- package/scripts/forge-harden-learning.cjs +921 -0
- package/scripts/forge-harden-learning.test.cjs +242 -0
- package/scripts/forge-ingest-memory.cjs +136 -0
- package/scripts/forge-upgrade-pod.cjs +368 -0
- package/scripts/forge.test.cjs +609 -0
- package/scripts/harden-knowledge.test.cjs +612 -0
- package/scripts/harness-g5-lite.cjs +243 -0
- package/scripts/harness-g5-lite.test.cjs +134 -0
- package/scripts/hn-carousel-contrato-entrada.test.cjs +96 -0
- package/scripts/migrate-squad-orchestration.test.cjs +146 -0
- package/scripts/migration-manifest-sf3.2.test.cjs +382 -0
- package/scripts/migration-manifest-sf3.3.test.cjs +170 -0
- package/scripts/migration-manifest-sf5.5.test.cjs +189 -0
- package/scripts/migration-manifest.cjs +1146 -0
- package/scripts/migration-manifest.test.cjs +186 -0
- package/scripts/npm-scope-invocation.test.cjs +194 -0
- package/scripts/owner-layer.cjs +442 -0
- package/scripts/owner-layer.test.cjs +358 -0
- package/scripts/pc-run-pipeline.cjs +289 -0
- package/scripts/pc-run-pipeline.test.cjs +256 -0
- package/scripts/pc-run-pod-countgte.test.cjs +66 -0
- package/scripts/pc-run-pod.cjs +1355 -0
- package/scripts/phash-gate.test.cjs +433 -0
- package/scripts/pod-export-compile.cjs +487 -0
- package/scripts/pod-export-compile.test.cjs +312 -0
- package/scripts/pod-export-executor.cjs +678 -0
- package/scripts/pod-export-executor.test.cjs +1341 -0
- package/scripts/pod-export-hardening.test.cjs +531 -0
- package/scripts/pod-export-postprocess.cjs +427 -0
- package/scripts/pod-export-postprocess.test.cjs +558 -0
- package/scripts/pod-export-queue-race.test.cjs +865 -0
- package/scripts/pod-export-release.cjs +473 -0
- package/scripts/pod-export-release.test.cjs +267 -0
- package/scripts/pod-export-service.cjs +1297 -0
- package/scripts/pod-export-service.test.cjs +489 -0
- package/scripts/pod-export-tools.cjs +470 -0
- package/scripts/pod-export-ui.cjs +805 -0
- package/scripts/pod-export-ui.test.cjs +301 -0
- package/scripts/pod-memory-budget.test.cjs +309 -0
- package/scripts/pod-memory-note.cjs +357 -0
- package/scripts/pod-memory-note.test.cjs +452 -0
- package/scripts/pod-memory.cjs +1252 -0
- package/scripts/pod-memory.test.cjs +951 -0
- package/scripts/render-png.test.cjs +307 -0
- package/scripts/smoke-isolation.test.cjs +100 -0
- package/scripts/smoke-pod-workflow.cjs +755 -0
- package/scripts/smoke-sweep.test.cjs +170 -0
- package/scripts/validate-adopt.js +235 -0
- package/scripts/validate-branding.js +84 -0
- package/scripts/validate-budgets.js +140 -0
- package/scripts/validate-fidelity-output.cjs +267 -0
- package/scripts/validate-fidelity-output.test.cjs +101 -0
- package/scripts/validate-install.js +230 -0
- package/scripts/validate-no-clone.cjs +220 -0
- package/scripts/validate-no-clone.test.cjs +77 -0
- package/scripts/validate-pipeline.cjs +145 -0
- package/scripts/validate-pod-workflow.cjs +878 -0
- package/scripts/validate-source-audit.cjs +170 -0
- package/scripts/validate-source-audit.test.cjs +90 -0
- package/scripts/validate-story-acs.cjs +862 -0
- package/scripts/validate-update-scope-motor.js +421 -0
- package/scripts/veto-checks/html-valid.cjs +92 -0
- package/scripts/veto-checks/lexical-check.cjs +62 -0
- package/scripts/veto-checks/phash-gate.cjs +589 -0
- package/scripts/veto-checks/render-gate.cjs +165 -0
- package/scripts/veto-checks/render-png.cjs +358 -0
- package/scripts/veto-checks.test.cjs +219 -0
- package/scripts/watcher-audit.cjs +178 -0
- package/template/.claude/CLAUDE.md +103 -0
- package/template/.claude/agents/pc-analyst.md +100 -0
- package/template/.claude/agents/pc-architect.md +32 -0
- package/template/.claude/agents/pc-dev.md +27 -0
- package/template/.claude/agents/pc-devops.md +45 -0
- package/template/.claude/agents/pc-planner.md +32 -0
- package/template/.claude/agents/pc-po.md +25 -0
- package/template/.claude/agents/pc-qa.md +25 -0
- package/template/.claude/commands/power/academy.md +9 -0
- package/template/.claude/commands/power/automation.md +9 -0
- package/template/.claude/commands/power/content-carousel.md +267 -0
- package/template/.claude/commands/power/content.md +9 -0
- package/template/.claude/commands/power/dev.md +9 -0
- package/template/.claude/commands/power/forge.md +224 -0
- package/template/.claude/commands/power/hormozi.md +221 -0
- package/template/.claude/commands/power/modo.md +57 -0
- package/template/.claude/hooks/README.md +114 -0
- package/template/.claude/hooks/context-budget.cjs +64 -0
- package/template/.claude/hooks/enforce-cycle-authority.cjs +457 -0
- package/template/.claude/hooks/enforce-git-push-authority.cjs +925 -0
- package/template/.claude/hooks/enforce-ready-oracles.cjs +502 -0
- package/template/.claude/rules/authority.md +76 -0
- package/template/.claude/rules/curadoria-de-conhecimento.md +30 -0
- package/template/.claude/rules/model-matrix.md +34 -0
- package/template/.claude/rules/orchestration.md +133 -0
- package/template/.claude/settings.json +50 -0
- package/template/.claude/skills/pc-apply-qa-fixes/SKILL.md +108 -0
- package/template/.claude/skills/pc-apply-qa-fixes/references/fix-loop.md +40 -0
- package/template/.claude/skills/pc-apply-qa-fixes/references/fix-request-template.md +70 -0
- package/template/.claude/skills/pc-arena/SKILL.md +96 -0
- package/template/.claude/skills/pc-close-story/SKILL.md +105 -0
- package/template/.claude/skills/pc-commit/SKILL.md +108 -0
- package/template/.claude/skills/pc-develop-story/SKILL.md +116 -0
- package/template/.claude/skills/pc-full-cycle/SKILL.md +150 -0
- package/template/.claude/skills/pc-pipeline/SKILL.md +63 -0
- package/template/.claude/skills/pc-pipeline/references/gate-templates.md +46 -0
- package/template/.claude/skills/pc-review-story/SKILL.md +129 -0
- package/template/.claude/skills/pc-review-story/references/false-positive-detection.md +50 -0
- package/template/.claude/skills/pc-review-story/references/nfr-assess.md +47 -0
- package/template/.claude/skills/pc-review-story/references/risk-profile.md +75 -0
- package/template/.claude/skills/pc-review-story/references/security-checklist.md +69 -0
- package/template/.claude/skills/pc-review-story/references/test-design.md +37 -0
- package/template/.claude/skills/pc-review-story/references/trace-requirements.md +46 -0
- package/template/.claude/skills/pc-run-pod/SKILL.md +123 -0
- package/template/.claude/skills/pc-validate-story/SKILL.md +114 -0
- package/template/.claude/skills/pc-wave/SKILL.md +133 -0
- package/template/.env.example +10 -0
- package/template/knowledge/analyst/brainstorming.md +40 -0
- package/template/knowledge/analyst/brief-skeleton.md +32 -0
- package/template/knowledge/analyst/competitor-skeleton.md +39 -0
- package/template/knowledge/analyst/elicitation-menu.md +49 -0
- package/template/knowledge/analyst/market-research-skeleton.md +36 -0
- package/template/knowledge/analyst/research-prompt-structure.md +48 -0
- package/template/knowledge/analyst/roi-skeleton.md +51 -0
- package/template/knowledge/voice-dna/README.md +99 -0
- package/template/knowledge/voice-dna/voice-dna.example.yaml +157 -0
- package/template/pods/README.md +64 -0
- package/template/pods/academy/README.md +37 -0
- package/template/pods/academy/agents/academy-chief.md +27 -0
- package/template/pods/academy/examples/palestra.example.md +142 -0
- package/template/pods/academy/pod-spec.json +44 -0
- package/template/pods/academy/templates/materiais-tmpl.md +17 -0
- package/template/pods/academy/templates/revisao-didatica-tmpl.md +20 -0
- package/template/pods/academy/workflows/wf-materiais-revisao.yaml +30 -0
- package/template/pods/authority-content/README.md +43 -0
- package/template/pods/authority-content/agents/content-chief.md +28 -0
- package/template/pods/authority-content/pod-spec.json +45 -0
- package/template/pods/authority-content/templates/criacao-na-voz-tmpl.md +17 -0
- package/template/pods/authority-content/templates/red-team-factual-tmpl.md +23 -0
- package/template/pods/authority-content/workflows/wf-criacao-redteam.yaml +30 -0
- package/template/pods/automation/README.md +37 -0
- package/template/pods/automation/agents/langgraph-architect.md +30 -0
- package/template/pods/automation/agents/n8n-architect.md +30 -0
- package/template/pods/automation/examples/README.md +46 -0
- package/template/pods/automation/examples/n8n-content-radar.example.json +380 -0
- package/template/pods/automation/knowledge/langgraph-patterns.md +126 -0
- package/template/pods/automation/knowledge/n8n-patterns.md +131 -0
- package/template/pods/automation/memory/README.md +16 -0
- package/template/pods/automation/memory/learnings.consolidated.md +8 -0
- package/template/pods/automation/memory/learnings.jsonl +0 -0
- package/template/pods/automation/pod-spec.json +109 -0
- package/template/pods/automation/specs/wf-langgraph-build.spec.json +107 -0
- package/template/pods/automation/squad-io.yaml +28 -0
- package/template/pods/automation/templates/lg-build-tmpl.md +17 -0
- package/template/pods/automation/templates/lg-design-tmpl.md +23 -0
- package/template/pods/automation/templates/lg-discover-tmpl.md +20 -0
- package/template/pods/automation/templates/lg-handoff-tmpl.md +20 -0
- package/template/pods/automation/templates/lg-test-tmpl.md +20 -0
- package/template/pods/automation/templates/n8n-build-tmpl.md +14 -0
- package/template/pods/automation/templates/n8n-design-tmpl.md +23 -0
- package/template/pods/automation/templates/n8n-discover-tmpl.md +20 -0
- package/template/pods/automation/templates/n8n-handoff-tmpl.md +20 -0
- package/template/pods/automation/templates/n8n-test-tmpl.md +20 -0
- package/template/pods/automation/workflows/wf-langgraph-build.smoke.json +11 -0
- package/template/pods/automation/workflows/wf-langgraph-build.yaml +64 -0
- package/template/pods/automation/workflows/wf-n8n-build.smoke.json +11 -0
- package/template/pods/automation/workflows/wf-n8n-build.yaml +65 -0
- package/template/pods/content-carousel/README.md +91 -0
- package/template/pods/content-carousel/agents/carousel-builder.md +28 -0
- package/template/pods/content-carousel/agents/carousel-visual.md +24 -0
- package/template/pods/content-carousel/agents/hn-curator.md +74 -0
- package/template/pods/content-carousel/config/heuristic-watcher-rubric.yaml +59 -0
- package/template/pods/content-carousel/knowledge/aquisicao-ancora.md +443 -0
- package/template/pods/content-carousel/knowledge/cta-brief.md +25 -0
- package/template/pods/content-carousel/knowledge/dono.example.yaml +45 -0
- package/template/pods/content-carousel/knowledge/identidade-visual-mascote.md +62 -0
- package/template/pods/content-carousel/knowledge/image-generation.md +62 -0
- package/template/pods/content-carousel/knowledge/selecao-de-ancora.md +60 -0
- package/template/pods/content-carousel/knowledge/slides-html.md +56 -0
- package/template/pods/content-carousel/memory/README.md +18 -0
- package/template/pods/content-carousel/memory/learnings.consolidated.md +6 -0
- package/template/pods/content-carousel/memory/learnings.jsonl +0 -0
- package/template/pods/content-carousel/pod-spec.json +100 -0
- package/template/pods/content-carousel/squad-io.yaml +10 -0
- package/template/pods/content-carousel/templates/assembly-tmpl.md +23 -0
- package/template/pods/content-carousel/templates/digest-tmpl.md +29 -0
- package/template/pods/content-carousel/templates/visuals-tmpl.md +20 -0
- package/template/pods/content-carousel/workflows/wf-content-carousel.smoke.json +23 -0
- package/template/pods/content-carousel/workflows/wf-content-carousel.yaml +80 -0
- package/template/pods/dev-ia/README.md +45 -0
- package/template/pods/dev-ia/agents/db-architect.md +33 -0
- package/template/pods/dev-ia/agents/ux-architect.md +29 -0
- package/template/pods/dev-ia/knowledge/db/migration-protocol.md +95 -0
- package/template/pods/dev-ia/knowledge/db/rls-patterns.md +101 -0
- package/template/pods/dev-ia/knowledge/db/schema-review-checklist.md +76 -0
- package/template/pods/dev-ia/memory/README.md +16 -0
- package/template/pods/dev-ia/memory/learnings.consolidated.md +8 -0
- package/template/pods/dev-ia/memory/learnings.jsonl +0 -0
- package/template/pods/dev-ia/pod-spec.json +34 -0
- package/template/pods/dev-ia/templates/schema-review-tmpl.md +23 -0
- package/template/pods/dev-ia/templates/ux-flow-review-tmpl.md +23 -0
- package/template/pods/dev-ia/tools/db-ops/backup-manager.sh +321 -0
- package/template/pods/dev-ia/tools/db-ops/best-practices-auditor.sh +534 -0
- package/template/pods/dev-ia/tools/db-ops/bootstrap-runner.sh +255 -0
- package/template/pods/dev-ia/tools/db-ops/data-loader.sh +616 -0
- package/template/pods/dev-ia/tools/db-ops/detect-database.sh +113 -0
- package/template/pods/dev-ia/tools/db-ops/explain-analyzer.sh +285 -0
- package/template/pods/dev-ia/tools/db-ops/health-checker.sh +323 -0
- package/template/pods/dev-ia/tools/db-ops/migration-runner.sh +308 -0
- package/template/pods/dev-ia/tools/db-ops/postgresql-schema-loader.sh +334 -0
- package/template/pods/dev-ia/tools/db-ops/query-runner.sh +171 -0
- package/template/pods/dev-ia/tools/db-ops/rls-policy-installer.sh +480 -0
- package/template/pods/dev-ia/tools/db-ops/rls-test-suite.sh +172 -0
- package/template/pods/dev-ia/tools/db-ops/schema-context-loader.sh +176 -0
- package/template/pods/hormozi-method/README.md +52 -0
- package/template/pods/hormozi-method/agents/acquisition-strategist.md +33 -0
- package/template/pods/hormozi-method/agents/conversion-copywriter.md +34 -0
- package/template/pods/hormozi-method/agents/monetization-architect.md +35 -0
- package/template/pods/hormozi-method/agents/offer-engineer.md +37 -0
- package/template/pods/hormozi-method/knowledge/core-four-leads.md +51 -0
- package/template/pods/hormozi-method/knowledge/grand-slam-offer.md +66 -0
- package/template/pods/hormozi-method/knowledge/growth-decision.md +38 -0
- package/template/pods/hormozi-method/knowledge/hooks-and-ads.md +56 -0
- package/template/pods/hormozi-method/knowledge/launch-email.md +31 -0
- package/template/pods/hormozi-method/knowledge/money-model.md +46 -0
- package/template/pods/hormozi-method/knowledge/opportunity-screening.md +44 -0
- package/template/pods/hormozi-method/knowledge/pages.md +25 -0
- package/template/pods/hormozi-method/knowledge/pos-lancamento-leads.md +56 -0
- package/template/pods/hormozi-method/knowledge/pricing.md +36 -0
- package/template/pods/hormozi-method/knowledge/retention-ltv.md +37 -0
- package/template/pods/hormozi-method/knowledge/scale-roadmap.md +35 -0
- package/template/pods/hormozi-method/knowledge/swipefiles-curados.md +44 -0
- package/template/pods/hormozi-method/knowledge/value-equation-diagnostic.md +77 -0
- package/template/pods/hormozi-method/memory/README.md +16 -0
- package/template/pods/hormozi-method/memory/learnings.consolidated.md +6 -0
- package/template/pods/hormozi-method/memory/learnings.jsonl +0 -0
- package/template/pods/hormozi-method/pod-spec.json +50 -0
- package/template/pods/hormozi-method/specs/wf-full-launch-sequence.spec.json +149 -0
- package/template/pods/hormozi-method/specs/wf-lead-magnet-pipeline.spec.json +125 -0
- package/template/pods/hormozi-method/specs/wf-money-model-design.spec.json +117 -0
- package/template/pods/hormozi-method/specs/wf-paid-ads-campaign.spec.json +132 -0
- package/template/pods/hormozi-method/specs/wf-scaling-diagnostic.spec.json +121 -0
- package/template/pods/hormozi-method/squad-io.yaml +43 -0
- package/template/pods/hormozi-method/templates/conversion-copywriter-tmpl.md +20 -0
- package/template/pods/hormozi-method/templates/launch-execucao-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/launch-fechamento-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/launch-pos-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/launch-preparacao-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/lm-copy-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/lm-distribuicao-tmpl.md +18 -0
- package/template/pods/hormozi-method/templates/lm-estrategia-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/mm-arquitetura-tmpl.md +18 -0
- package/template/pods/hormozi-method/templates/mm-copy-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/mm-diagnostico-tmpl.md +14 -0
- package/template/pods/hormozi-method/templates/monetization-architect-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/offer-engineer-tmpl.md +20 -0
- package/template/pods/hormozi-method/templates/paid-criativos-tmpl.md +19 -0
- package/template/pods/hormozi-method/templates/paid-fundacao-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/paid-teste-escala-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/scaling-diagnostico-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/scaling-priorizacao-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/scaling-roadmap-tmpl.md +17 -0
- package/template/pods/hormozi-method/workflows/wf-full-launch-sequence.smoke.json +12 -0
- package/template/pods/hormozi-method/workflows/wf-full-launch-sequence.yaml +56 -0
- package/template/pods/hormozi-method/workflows/wf-grand-slam-offer.smoke.json +11 -0
- package/template/pods/hormozi-method/workflows/wf-grand-slam-offer.yaml +45 -0
- package/template/pods/hormozi-method/workflows/wf-lead-magnet-pipeline.smoke.json +9 -0
- package/template/pods/hormozi-method/workflows/wf-lead-magnet-pipeline.yaml +45 -0
- package/template/pods/hormozi-method/workflows/wf-money-model-design.smoke.json +11 -0
- package/template/pods/hormozi-method/workflows/wf-money-model-design.yaml +45 -0
- package/template/pods/hormozi-method/workflows/wf-paid-ads-campaign.smoke.json +9 -0
- package/template/pods/hormozi-method/workflows/wf-paid-ads-campaign.yaml +46 -0
- package/template/pods/hormozi-method/workflows/wf-scaling-diagnostic.smoke.json +11 -0
- package/template/pods/hormozi-method/workflows/wf-scaling-diagnostic.yaml +44 -0
- package/template/pods/squad-forge/README.md +53 -0
- package/template/pods/squad-forge/agents/forge-chief.md +31 -0
- package/template/pods/squad-forge/agents/mind-extractor.md +29 -0
- package/template/pods/squad-forge/agents/pod-critic.md +26 -0
- package/template/pods/squad-forge/config/heuristic-watcher-rubric.yaml +74 -0
- package/template/pods/squad-forge/knowledge/fidelity-rubric.yaml +176 -0
- package/template/pods/squad-forge/knowledge/g6-memory-check.md +17 -0
- package/template/pods/squad-forge/knowledge/memory-ingest.md +16 -0
- package/template/pods/squad-forge/knowledge/source-audit-rubric.yaml +60 -0
- package/template/pods/squad-forge/memory/README.md +16 -0
- package/template/pods/squad-forge/memory/learnings.consolidated.md +8 -0
- package/template/pods/squad-forge/memory/learnings.jsonl +0 -0
- package/template/pods/squad-forge/pod-spec.json +166 -0
- package/template/pods/squad-forge/squad-io.yaml +13 -0
- package/template/pods/squad-forge/tasks/pipeline.md +158 -0
- package/template/pods/squad-forge/templates/discovery-tmpl.md +40 -0
- package/template/pods/squad-forge/templates/generation-tmpl.md +18 -0
- package/template/pods/squad-forge/templates/red-team-tmpl.md +17 -0
- package/template/pods/squad-forge/templates/register-tmpl.md +17 -0
- package/template/pods/squad-forge/templates/workflow-tmpl.yaml +101 -0
- package/template/pods/squad-forge/workflows/wf-forge.smoke.json +12 -0
- package/template/pods/squad-forge/workflows/wf-forge.yaml +60 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* doctor.js — diagnóstico da instalação POWER CLAUDE no cwd.
|
|
4
|
+
*
|
|
5
|
+
* Checa:
|
|
6
|
+
* 1. Manifest existe e está íntegro (hashes conferem); `frameworkRoot` registrado
|
|
7
|
+
* ainda hospeda um `bin/cli.js` (AVISO, nunca FALHA — SF11.1).
|
|
8
|
+
* 2. Hook registrado no .claude/settings.json (e arquivo do hook presente).
|
|
9
|
+
* 3. .gitignore cobre .env.
|
|
10
|
+
* 4. scripts/validate-budgets.js do projeto passa (se pods/ presente).
|
|
11
|
+
* 5. Estimativa de tokens do .claude/CLAUDE.md (bytes/4) — alerta se > 2.000.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const fs = require('node:fs');
|
|
15
|
+
const path = require('node:path');
|
|
16
|
+
const { spawnSync } = require('node:child_process');
|
|
17
|
+
const { readManifest, sha256OfFile, frameworkCliPath } = require('./manifest');
|
|
18
|
+
const { motorEntries, ownerInstalled } = require('./motor-scripts');
|
|
19
|
+
|
|
20
|
+
const CLAUDE_MD_TOKEN_ALERT = 2000;
|
|
21
|
+
|
|
22
|
+
function check(label, ok, detail) {
|
|
23
|
+
const mark = ok === true ? 'OK ' : ok === 'warn' ? 'AVISO' : 'FALHA';
|
|
24
|
+
console.log(`[${mark}] ${label}${detail ? ` — ${detail}` : ''}`);
|
|
25
|
+
return ok === true || ok === 'warn';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function doctor() {
|
|
29
|
+
const destDir = process.cwd();
|
|
30
|
+
let allOk = true;
|
|
31
|
+
console.log(`POWER CLAUDE doctor — ${destDir}\n`);
|
|
32
|
+
|
|
33
|
+
// SF10.20 — comandos de correção CONCRETOS. O `doctor` roda a partir do framework,
|
|
34
|
+
// então `pkgRoot` é fato, não palpite. Nunca prescrever `npx power-claude` nem
|
|
35
|
+
// `power-claude <cmd>` nu: numa instalação sem package.json/node_modules/PATH, o
|
|
36
|
+
// primeiro resolve pelo registry público (onde o nome é de um pacote de TERCEIRO)
|
|
37
|
+
// e o segundo simplesmente não existe. Comando prescrito tem que ser executável.
|
|
38
|
+
const pkgRoot = path.resolve(__dirname, '..');
|
|
39
|
+
const frameworkVersion = require(path.join(pkgRoot, 'package.json')).version;
|
|
40
|
+
const cliPath = frameworkCliPath(pkgRoot);
|
|
41
|
+
const cmd = (sub) => (cliPath ? `node ${cliPath} ${sub}` : `"${sub}" a partir do repositório do POWER CLAUDE`);
|
|
42
|
+
const fixCmd = `${cmd('adopt')} && ${cmd('update --scope motor')}`;
|
|
43
|
+
|
|
44
|
+
// 1. Manifest
|
|
45
|
+
let manifest = null;
|
|
46
|
+
try {
|
|
47
|
+
manifest = readManifest(destDir);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
allOk = check('Manifest legível', false, error.message) && allOk;
|
|
50
|
+
}
|
|
51
|
+
if (manifest === null) {
|
|
52
|
+
allOk = check('Manifest presente (.power-claude/manifest.json)', false, `não encontrado — rode ${cmd('install')}`) && allOk;
|
|
53
|
+
} else {
|
|
54
|
+
check('Manifest presente (.power-claude/manifest.json)', true, `versão ${manifest.version}, ${manifest.files.length} arquivos`);
|
|
55
|
+
let intact = 0;
|
|
56
|
+
let modified = 0;
|
|
57
|
+
let missing = 0;
|
|
58
|
+
for (const entry of manifest.files) {
|
|
59
|
+
const p = path.join(destDir, ...entry.path.split('/'));
|
|
60
|
+
if (!fs.existsSync(p)) missing++;
|
|
61
|
+
else if (sha256OfFile(p) === entry.sha256) intact++;
|
|
62
|
+
else modified++;
|
|
63
|
+
}
|
|
64
|
+
const detail = `${intact} íntegros, ${modified} modificados, ${missing} ausentes`;
|
|
65
|
+
allOk = check('Integridade dos arquivos do manifest', missing === 0 ? (modified === 0 ? true : 'warn') : false, detail) && allOk;
|
|
66
|
+
|
|
67
|
+
// 1b. SF11.1 — guard PROATIVO do `frameworkRoot`.
|
|
68
|
+
//
|
|
69
|
+
// O campo é o único elo entre a árvore instalada e o framework (manifest.js): é ele
|
|
70
|
+
// que faz o comando de correção da SF10.20 sair concreto em vez de placeholder. Como
|
|
71
|
+
// é registro e não oráculo, envelhece calado — um checkout efêmero (worktree, pasta
|
|
72
|
+
// temporária) que sumiu depois só se manifesta no pior momento, dentro de uma rodada
|
|
73
|
+
// já quebrada. Aqui a mesma verificação que `correctionCommand()` faz sob pressão
|
|
74
|
+
// roda ANTES, fora de banda.
|
|
75
|
+
//
|
|
76
|
+
// Nível AVISO, nunca FALHA, deliberadamente: um `frameworkRoot` que não resolve não
|
|
77
|
+
// degrada nada do que o projeto FAZ (nenhum caminho de execução o consome), e o
|
|
78
|
+
// próprio `doctor` que reporta o problema já é a prova de que existe um framework
|
|
79
|
+
// vivo para reancorar. Tratar registro como oráculo transformaria uma instalação
|
|
80
|
+
// perfeitamente funcional em "doente".
|
|
81
|
+
const recordedRoot = typeof manifest.frameworkRoot === 'string' ? manifest.frameworkRoot : null;
|
|
82
|
+
if (!recordedRoot) {
|
|
83
|
+
check('frameworkRoot do manifest', 'warn', `não registrado (manifest anterior à SF10.20) — rode ${cmd('update --scope motor')} a partir do framework para carimbá-lo`);
|
|
84
|
+
} else if (frameworkCliPath(recordedRoot)) {
|
|
85
|
+
check('frameworkRoot do manifest', true, `${recordedRoot} (bin/cli.js presente)`);
|
|
86
|
+
} else {
|
|
87
|
+
check(
|
|
88
|
+
'frameworkRoot do manifest',
|
|
89
|
+
'warn',
|
|
90
|
+
`aponta "${recordedRoot}", que não hospeda bin/cli.js — o framework foi movido/apagado. ` +
|
|
91
|
+
`O comando de correção do motor sai como placeholder até reancorar: rode ${cmd('update --scope motor')} a partir do framework atual`
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// 2. Hook no settings.json
|
|
97
|
+
const settingsPath = path.join(destDir, '.claude', 'settings.json');
|
|
98
|
+
const hookPath = path.join(destDir, '.claude', 'hooks', 'enforce-git-push-authority.cjs');
|
|
99
|
+
if (!fs.existsSync(settingsPath)) {
|
|
100
|
+
allOk = check('settings.json presente (.claude/settings.json)', false) && allOk;
|
|
101
|
+
} else {
|
|
102
|
+
try {
|
|
103
|
+
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
|
104
|
+
const hasHooks = settings.hooks && typeof settings.hooks === 'object' && Object.keys(settings.hooks).length > 0;
|
|
105
|
+
const registersEnforce = JSON.stringify(settings.hooks || {}).includes('enforce-git-push-authority');
|
|
106
|
+
allOk = check('Hooks registrados no settings.json', Boolean(hasHooks), hasHooks ? undefined : 'chave "hooks" ausente ou vazia') && allOk;
|
|
107
|
+
allOk = check('Hook enforce-git-push-authority registrado', registersEnforce) && allOk;
|
|
108
|
+
|
|
109
|
+
// 2b. SF13.2 (`ADR-032` `DF-SF13.2-4`) — acoplamento de distribuição da
|
|
110
|
+
// trava de `Ready`. O hook e o validador viajam por canais
|
|
111
|
+
// DIFERENTES: `enforce-ready-oracles.cjs` só sabe avaliar os 5
|
|
112
|
+
// predicados porque `require`a as funções puras de
|
|
113
|
+
// `scripts/validate-story-acs.cjs`. Numa instalação em skew
|
|
114
|
+
// (`ADR-019`) o hook chega e o script não — e aí a trava degrada
|
|
115
|
+
// para `ask` em TODA transição `Draft`→`Ready`, para sempre. Guard
|
|
116
|
+
// que sempre pergunta é guard desligado com uma tecla a mais: a
|
|
117
|
+
// checagem existe para que esse `ask` seja transitório e tenha
|
|
118
|
+
// conserto nomeado, não crônico.
|
|
119
|
+
//
|
|
120
|
+
// Condicional ao hook estar registrado, de propósito (mesmo
|
|
121
|
+
// precedente literal de `Workflows de pod`, :172-177): numa
|
|
122
|
+
// instalação sem a trava, exigir o validador seria FALHA inventada.
|
|
123
|
+
const registersReadyOracles = JSON.stringify(settings.hooks || {}).includes('enforce-ready-oracles');
|
|
124
|
+
const acValidatorPath = path.join(destDir, 'scripts', 'validate-story-acs.cjs');
|
|
125
|
+
const READY_ORACLES_LABEL = 'Validador de ACs presente (exigido pela trava de Ready)';
|
|
126
|
+
if (!registersReadyOracles) {
|
|
127
|
+
check(READY_ORACLES_LABEL, 'warn', 'hook enforce-ready-oracles.cjs não registrado no settings.json — checagem pulada');
|
|
128
|
+
} else if (!fs.existsSync(acValidatorPath)) {
|
|
129
|
+
allOk = check(
|
|
130
|
+
READY_ORACLES_LABEL,
|
|
131
|
+
false,
|
|
132
|
+
`scripts/validate-story-acs.cjs ausente no projeto, mas o hook da trava de Ready está registrado — toda transição Draft→Ready vai pedir aprovação até isto ser resolvido: ${fixCmd}`
|
|
133
|
+
) && allOk;
|
|
134
|
+
} else {
|
|
135
|
+
allOk = check(READY_ORACLES_LABEL, true, 'scripts/validate-story-acs.cjs presente') && allOk;
|
|
136
|
+
}
|
|
137
|
+
} catch (error) {
|
|
138
|
+
allOk = check('settings.json parseável', false, error.message) && allOk;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
allOk = check('Arquivo do hook presente (.claude/hooks/enforce-git-push-authority.cjs)', fs.existsSync(hookPath)) && allOk;
|
|
142
|
+
|
|
143
|
+
// 3. .gitignore cobre .env
|
|
144
|
+
const gitignorePath = path.join(destDir, '.gitignore');
|
|
145
|
+
if (!fs.existsSync(gitignorePath)) {
|
|
146
|
+
allOk = check('.gitignore cobre .env', false, '.gitignore não existe') && allOk;
|
|
147
|
+
} else {
|
|
148
|
+
const lines = fs.readFileSync(gitignorePath, 'utf8').split(/\r?\n/).map((l) => l.trim());
|
|
149
|
+
allOk = check('.gitignore cobre .env', lines.includes('.env')) && allOk;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// 4. validate-budgets.js do projeto
|
|
153
|
+
const budgetScript = path.join(destDir, 'scripts', 'validate-budgets.js');
|
|
154
|
+
const podsDir = path.join(destDir, 'pods');
|
|
155
|
+
if (!fs.existsSync(podsDir)) {
|
|
156
|
+
check('Gate de budgets (pods/)', 'warn', 'pods/ não presente — checagem pulada');
|
|
157
|
+
} else if (!fs.existsSync(budgetScript)) {
|
|
158
|
+
allOk = check('Gate de budgets (scripts/validate-budgets.js)', false, 'script não encontrado no projeto') && allOk;
|
|
159
|
+
} else {
|
|
160
|
+
const result = spawnSync(process.execPath, [budgetScript], { cwd: destDir, encoding: 'utf8' });
|
|
161
|
+
const passed = result.status === 0;
|
|
162
|
+
allOk = check('Gate de budgets passa', passed, passed ? undefined : 'rode "node scripts/validate-budgets.js" para detalhes') && allOk;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// 4b. Scripts do motor presentes (ADR-007): um check por entrada do manifest,
|
|
166
|
+
// condicional por owner — owner ausente → check pulado (warn); owner
|
|
167
|
+
// presente e script ausente → FALHA diagnosticável.
|
|
168
|
+
for (const { path: rel, owner } of motorEntries()) {
|
|
169
|
+
if (!ownerInstalled(destDir, owner)) {
|
|
170
|
+
check(`Motor: ${rel}`, 'warn', `owner ${owner} não instalado — checagem pulada`);
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
const present = fs.existsSync(path.join(destDir, ...rel.split('/')));
|
|
174
|
+
allOk = check(`Motor: ${rel}`, present, present ? `owner ${owner}` : `ausente com owner ${owner} presente — rode ${cmd('update --scope motor')}`) && allOk;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// 4c. SF10.20 / ADR-019 `DF-SF10.20-4` — detector de skew FORA DE BANDA.
|
|
178
|
+
//
|
|
179
|
+
// Fecha o furo de bootstrap do item (1) daquela decisão: uma instalação velha demais
|
|
180
|
+
// para carregar a mensagem de atribuição nova ainda é diagnosticável por um `doctor`
|
|
181
|
+
// de framework atual, sem que o dono precise tentar rodar o pod e perder a rodada.
|
|
182
|
+
//
|
|
183
|
+
// (i) AVISO de versão — é a ÚNICA comparação de versão de todo o desenho, e vive do
|
|
184
|
+
// lado que conhece as DUAS pontas (o framework sabe o que existe lá fora; a
|
|
185
|
+
// instalação, não). Nunca é o gate bloqueante (`DF-SF10.20-3`).
|
|
186
|
+
if (manifest) {
|
|
187
|
+
const behind = compareVersions(manifest.version, frameworkVersion) < 0;
|
|
188
|
+
check(
|
|
189
|
+
'Versão da instalação vs. framework',
|
|
190
|
+
behind ? 'warn' : true,
|
|
191
|
+
behind
|
|
192
|
+
? `instalação em ${manifest.version}, framework em ${frameworkVersion} — ${fixCmd}`
|
|
193
|
+
: `instalação em ${manifest.version}, framework em ${frameworkVersion}`
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// (ii) FALHA quando um `wf` instalado não é carregável pelo motor INSTALADO. A
|
|
198
|
+
// assimetria é deliberada: o `doctor` roda do framework, mas EXECUTA o binário
|
|
199
|
+
// do projeto (spawnSync) — é a única forma de a checagem falar sobre a
|
|
200
|
+
// instalação e não sobre o framework validando a si mesmo (`DF-SF10.20-1`).
|
|
201
|
+
const installedValidator = path.join(destDir, 'scripts', 'validate-pod-workflow.cjs');
|
|
202
|
+
const podWorkflows = listInstalledPodWorkflows(destDir);
|
|
203
|
+
if (podWorkflows.length === 0) {
|
|
204
|
+
check('Workflows de pod executáveis pelo motor instalado', 'warn', 'nenhum wf-*.yaml de pod encontrado — checagem pulada');
|
|
205
|
+
} else if (!fs.existsSync(installedValidator)) {
|
|
206
|
+
allOk = check('Workflows de pod executáveis pelo motor instalado', false, `scripts/validate-pod-workflow.cjs ausente no projeto — ${fixCmd}`) && allOk;
|
|
207
|
+
} else {
|
|
208
|
+
for (const rel of podWorkflows) {
|
|
209
|
+
const result = spawnSync(process.execPath, [installedValidator, rel], { cwd: destDir, encoding: 'utf8' });
|
|
210
|
+
const passed = result.status === 0;
|
|
211
|
+
const firstLine = String(result.stderr || result.stdout || '').split('\n').find((l) => l.trim()) || '';
|
|
212
|
+
allOk = check(
|
|
213
|
+
`wf executável pelo motor instalado: ${rel}`,
|
|
214
|
+
passed,
|
|
215
|
+
passed ? undefined : `o motor deste projeto NÃO carrega este wf — ${firstLine.trim()} · corrija com: ${fixCmd}`
|
|
216
|
+
) && allOk;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// 5. Estimativa de tokens do CLAUDE.md
|
|
221
|
+
const claudeMdPath = path.join(destDir, '.claude', 'CLAUDE.md');
|
|
222
|
+
if (!fs.existsSync(claudeMdPath)) {
|
|
223
|
+
allOk = check('.claude/CLAUDE.md presente', false) && allOk;
|
|
224
|
+
} else {
|
|
225
|
+
const bytes = fs.statSync(claudeMdPath).size;
|
|
226
|
+
const estTokens = Math.ceil(bytes / 4);
|
|
227
|
+
const within = estTokens <= CLAUDE_MD_TOKEN_ALERT;
|
|
228
|
+
allOk =
|
|
229
|
+
check(
|
|
230
|
+
'Budget do CLAUDE.md',
|
|
231
|
+
within ? true : 'warn',
|
|
232
|
+
`~${estTokens} tokens estimados (alerta se > ${CLAUDE_MD_TOKEN_ALERT})`
|
|
233
|
+
) && allOk;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
console.log(allOk ? '\nDiagnóstico: saudável.' : '\nDiagnóstico: problemas encontrados (veja FALHA acima).');
|
|
237
|
+
return allOk ? 0 : 1;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** Compara versões `a.b.c` numericamente. <0 se `a` é anterior a `b`. */
|
|
241
|
+
function compareVersions(a, b) {
|
|
242
|
+
const pa = String(a || '0').split('.').map((n) => parseInt(n, 10) || 0);
|
|
243
|
+
const pb = String(b || '0').split('.').map((n) => parseInt(n, 10) || 0);
|
|
244
|
+
for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
|
|
245
|
+
const d = (pa[i] || 0) - (pb[i] || 0);
|
|
246
|
+
if (d !== 0) return d < 0 ? -1 : 1;
|
|
247
|
+
}
|
|
248
|
+
return 0;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/** `pods/<pod>/workflows/*.yaml` instalados no projeto (paths relativos ao destDir). */
|
|
252
|
+
function listInstalledPodWorkflows(destDir) {
|
|
253
|
+
const out = [];
|
|
254
|
+
const podsDir = path.join(destDir, 'pods');
|
|
255
|
+
if (!fs.existsSync(podsDir)) return out;
|
|
256
|
+
for (const pod of fs.readdirSync(podsDir)) {
|
|
257
|
+
const wfDir = path.join(podsDir, pod, 'workflows');
|
|
258
|
+
if (!fs.existsSync(wfDir) || !fs.statSync(wfDir).isDirectory()) continue;
|
|
259
|
+
for (const f of fs.readdirSync(wfDir)) {
|
|
260
|
+
if (/\.ya?ml$/.test(f)) out.push(`pods/${pod}/workflows/${f}`);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return out.sort();
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
module.exports = { doctor, compareVersions, listInstalledPodWorkflows };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* install.js — orquestra a instalação do POWER CLAUDE no cwd.
|
|
4
|
+
*
|
|
5
|
+
* Fluxo: wizard → cópia do template → cópia do validate-budgets.js →
|
|
6
|
+
* garantia de .gitignore cobrindo .env → manifest → git init (opcional).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const fs = require('node:fs');
|
|
10
|
+
const path = require('node:path');
|
|
11
|
+
const { execFileSync } = require('node:child_process');
|
|
12
|
+
|
|
13
|
+
const { runWizard } = require('./wizard');
|
|
14
|
+
const { copyTemplate, listPods } = require('./copy');
|
|
15
|
+
const { readManifest, writeManifest, sha256OfFile } = require('./manifest');
|
|
16
|
+
const { createPrompter, ensureParentDir } = require('./util');
|
|
17
|
+
const { motorEntries } = require('./motor-scripts');
|
|
18
|
+
|
|
19
|
+
async function install({ yes = false } = {}) {
|
|
20
|
+
const destDir = process.cwd();
|
|
21
|
+
const pkgRoot = path.resolve(__dirname, '..');
|
|
22
|
+
const templateDir = path.join(pkgRoot, 'template');
|
|
23
|
+
const pkg = require(path.join(pkgRoot, 'package.json'));
|
|
24
|
+
|
|
25
|
+
if (path.resolve(destDir) === path.resolve(pkgRoot)) {
|
|
26
|
+
throw new Error('Não instale o POWER CLAUDE dentro do próprio repositório do framework. Rode em outro diretório.');
|
|
27
|
+
}
|
|
28
|
+
if (!fs.existsSync(templateDir)) {
|
|
29
|
+
throw new Error(`Template não encontrado em ${templateDir}. Pacote corrompido?`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const existing = readManifest(destDir);
|
|
33
|
+
if (existing) {
|
|
34
|
+
console.log(`POWER CLAUDE ${existing.version} já instalado neste projeto (em ${existing.installedAt}).`);
|
|
35
|
+
console.log('Use "power-claude update" para atualizar ou "power-claude uninstall" para remover.');
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
console.log(`POWER CLAUDE ${pkg.version} — instalação em ${destDir}\n`);
|
|
40
|
+
|
|
41
|
+
const pods = listPods(templateDir);
|
|
42
|
+
const prompter = yes ? null : createPrompter();
|
|
43
|
+
let report;
|
|
44
|
+
let entries;
|
|
45
|
+
let wizardResult;
|
|
46
|
+
try {
|
|
47
|
+
wizardResult = await runWizard({ yes, pods, destDir, prompter });
|
|
48
|
+
({ entries, report } = await copyTemplate({
|
|
49
|
+
templateDir,
|
|
50
|
+
destDir,
|
|
51
|
+
yes,
|
|
52
|
+
selectedPods: wizardResult.selectedPods,
|
|
53
|
+
prompter,
|
|
54
|
+
}));
|
|
55
|
+
} finally {
|
|
56
|
+
if (prompter) prompter.close();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Copia os scripts do motor (`.cjs`/`.js` fora de template/) que as skills e o
|
|
60
|
+
// pod squad-forge instalados referenciam — manifest versionado (ADR-007).
|
|
61
|
+
copyMotorScripts(pkgRoot, destDir, entries, report);
|
|
62
|
+
|
|
63
|
+
// Garante que .gitignore cobre .env.
|
|
64
|
+
ensureGitignoreCoversEnv(destDir, entries, report);
|
|
65
|
+
|
|
66
|
+
writeManifest(destDir, { version: pkg.version, files: entries });
|
|
67
|
+
|
|
68
|
+
if (wizardResult.initGit) {
|
|
69
|
+
initGitRepo(destDir);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
printReport(report, entries.length);
|
|
73
|
+
console.log('\nInstalação concluída. Manifesto em .power-claude/manifest.json');
|
|
74
|
+
return 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function copyMotorScripts(pkgRoot, destDir, entries, report) {
|
|
78
|
+
// Cópia incondicional (não filtra por owner — arquivos inertes; o `owner` do
|
|
79
|
+
// manifest filtra só o diagnóstico do doctor). MESMO contrato de conflito do
|
|
80
|
+
// template: ausente → copia+registra; idêntico → registra; diferente → kept.
|
|
81
|
+
for (const { path: rel } of motorEntries()) {
|
|
82
|
+
const src = path.join(pkgRoot, ...rel.split('/'));
|
|
83
|
+
if (!fs.existsSync(src)) continue;
|
|
84
|
+
const dest = path.join(destDir, ...rel.split('/'));
|
|
85
|
+
if (fs.existsSync(dest)) {
|
|
86
|
+
if (sha256OfFile(dest) === sha256OfFile(src)) {
|
|
87
|
+
entries.push({ path: rel, sha256: sha256OfFile(dest) });
|
|
88
|
+
} else {
|
|
89
|
+
report.kept.push(rel);
|
|
90
|
+
}
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
ensureParentDir(dest);
|
|
94
|
+
fs.copyFileSync(src, dest);
|
|
95
|
+
entries.push({ path: rel, sha256: sha256OfFile(dest) });
|
|
96
|
+
report.installed.push(rel);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function ensureGitignoreCoversEnv(destDir, entries, report) {
|
|
101
|
+
const gitignorePath = path.join(destDir, '.gitignore');
|
|
102
|
+
if (!fs.existsSync(gitignorePath)) {
|
|
103
|
+
const content = '# POWER CLAUDE\n.env\n.env.*\n!.env.example\n';
|
|
104
|
+
fs.writeFileSync(gitignorePath, content, 'utf8');
|
|
105
|
+
entries.push({ path: '.gitignore', sha256: sha256OfFile(gitignorePath) });
|
|
106
|
+
report.installed.push('.gitignore');
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const content = fs.readFileSync(gitignorePath, 'utf8');
|
|
110
|
+
const lines = content.split(/\r?\n/).map((l) => l.trim());
|
|
111
|
+
if (!lines.includes('.env')) {
|
|
112
|
+
const appended = content.replace(/\n*$/, '\n') + '\n# POWER CLAUDE\n.env\n.env.*\n!.env.example\n';
|
|
113
|
+
fs.writeFileSync(gitignorePath, appended, 'utf8');
|
|
114
|
+
report.merged.push('.gitignore (linha .env adicionada)');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function initGitRepo(destDir) {
|
|
119
|
+
try {
|
|
120
|
+
execFileSync('git', ['init'], { cwd: destDir, stdio: 'pipe' });
|
|
121
|
+
execFileSync('git', ['add', '-A'], { cwd: destDir, stdio: 'pipe' });
|
|
122
|
+
try {
|
|
123
|
+
execFileSync('git', ['commit', '-m', 'chore: bootstrap POWER CLAUDE framework'], {
|
|
124
|
+
cwd: destDir,
|
|
125
|
+
stdio: 'pipe',
|
|
126
|
+
});
|
|
127
|
+
console.log('\nRepositório git inicializado com commit inicial.');
|
|
128
|
+
} catch {
|
|
129
|
+
console.warn('\nAviso: git init ok, mas o commit inicial falhou (configure user.name/user.email do git e commite manualmente).');
|
|
130
|
+
}
|
|
131
|
+
} catch (error) {
|
|
132
|
+
console.warn(`\nAviso: falha ao inicializar git: ${error.message}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function printReport(report, totalManaged) {
|
|
137
|
+
console.log('\n--- Relatório de instalação ---');
|
|
138
|
+
console.log(`Arquivos instalados: ${report.installed.length}`);
|
|
139
|
+
if (report.merged.length > 0) {
|
|
140
|
+
console.log(`Mesclados (aditivo em hooks/permissions): ${report.merged.join(', ')}`);
|
|
141
|
+
}
|
|
142
|
+
if (report.kept.length > 0) {
|
|
143
|
+
console.log('Preservados (já existiam com conteúdo próprio — NÃO sobrescritos):');
|
|
144
|
+
for (const f of report.kept) console.log(` - ${f}`);
|
|
145
|
+
}
|
|
146
|
+
if (report.overwritten.length > 0) {
|
|
147
|
+
console.log(`Sobrescritos (com sua confirmação): ${report.overwritten.join(', ')}`);
|
|
148
|
+
}
|
|
149
|
+
if (report.skippedPods.length > 0) {
|
|
150
|
+
console.log(`Pods não instalados (sua escolha): ${report.skippedPods.join(', ')}`);
|
|
151
|
+
}
|
|
152
|
+
console.log(`Total de arquivos gerenciados no manifest: ${totalManaged}`);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
module.exports = { install };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* manifest.js — leitura/escrita do manifest de instalação do POWER CLAUDE.
|
|
4
|
+
*
|
|
5
|
+
* O manifest vive em `.power-claude/manifest.json` no projeto destino:
|
|
6
|
+
* { version, frameworkRoot, installedAt, files: [{ path, sha256, origin? }] }
|
|
7
|
+
*
|
|
8
|
+
* - `path`: relativo à raiz do projeto, separadores POSIX.
|
|
9
|
+
* - `sha256`: hash do conteúdo NO MOMENTO da instalação/atualização.
|
|
10
|
+
* - `origin`: opcional; "merged" marca arquivos mesclados com conteúdo do
|
|
11
|
+
* usuário (ex.: .claude/settings.json) — nunca removidos automaticamente.
|
|
12
|
+
* - `frameworkRoot` (SF10.20): caminho ABSOLUTO do framework que escreveu este
|
|
13
|
+
* manifest. É a única forma de a árvore instalada saber onde o framework está —
|
|
14
|
+
* uma instalação não tem `package.json` nem `node_modules` do POWER CLAUDE, e
|
|
15
|
+
* `npx power-claude` resolveria pelo REGISTRY PÚBLICO, onde esse nome pertence a
|
|
16
|
+
* um pacote de terceiro. Um comando de correção que baixasse código de estranho
|
|
17
|
+
* no repo do usuário seria pior do que não imprimir comando nenhum.
|
|
18
|
+
*
|
|
19
|
+
* É registro, NÃO oráculo: pode envelhecer (o framework pode ser movido/apagado).
|
|
20
|
+
* Todo consumidor VERIFICA a existência do executável antes de imprimir o caminho,
|
|
21
|
+
* e degrada para instrução genérica quando não confere. Nunca é condição de falha.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
const fs = require('node:fs');
|
|
25
|
+
const path = require('node:path');
|
|
26
|
+
const crypto = require('node:crypto');
|
|
27
|
+
|
|
28
|
+
const MANIFEST_DIR = '.power-claude';
|
|
29
|
+
const MANIFEST_FILE = 'manifest.json';
|
|
30
|
+
|
|
31
|
+
function sha256OfBuffer(buf) {
|
|
32
|
+
return crypto.createHash('sha256').update(buf).digest('hex');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function sha256OfFile(filePath) {
|
|
36
|
+
return sha256OfBuffer(fs.readFileSync(filePath));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function manifestPath(destRoot) {
|
|
40
|
+
return path.join(destRoot, MANIFEST_DIR, MANIFEST_FILE);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Lê o manifest do projeto. Retorna null se não existir. Lança se corrompido. */
|
|
44
|
+
function readManifest(destRoot) {
|
|
45
|
+
const p = manifestPath(destRoot);
|
|
46
|
+
if (!fs.existsSync(p)) return null;
|
|
47
|
+
let parsed;
|
|
48
|
+
try {
|
|
49
|
+
parsed = JSON.parse(fs.readFileSync(p, 'utf8'));
|
|
50
|
+
} catch (error) {
|
|
51
|
+
throw new Error(`Manifest corrompido em ${p}: ${error.message}`);
|
|
52
|
+
}
|
|
53
|
+
if (!parsed || !Array.isArray(parsed.files)) {
|
|
54
|
+
throw new Error(`Manifest inválido em ${p}: campo "files" ausente.`);
|
|
55
|
+
}
|
|
56
|
+
return parsed;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Raiz do framework que está escrevendo o manifest. Correto por construção: todo o
|
|
61
|
+
* `installer/` só executa a partir do próprio pacote do framework (não é distribuído
|
|
62
|
+
* para instalações — ver ADR-019 `DF-SF10.20-6`).
|
|
63
|
+
*/
|
|
64
|
+
function frameworkRoot() {
|
|
65
|
+
return path.resolve(__dirname, '..');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Caminho do CLI do framework, ou null se `root` não hospeda um CLI utilizável. */
|
|
69
|
+
function frameworkCliPath(root) {
|
|
70
|
+
if (!root || typeof root !== 'string') return null;
|
|
71
|
+
const cli = path.join(root, 'bin', 'cli.js');
|
|
72
|
+
return fs.existsSync(cli) ? cli : null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Escreve o manifest. `files` = [{ path, sha256, origin? }]. */
|
|
76
|
+
function writeManifest(destRoot, { version, files, installedAt, updatedAt }) {
|
|
77
|
+
const manifest = {
|
|
78
|
+
version,
|
|
79
|
+
// SF10.20: carimbado aqui, e não em cada caller, para que install/adopt/update
|
|
80
|
+
// não possam divergir sobre de onde a instalação veio.
|
|
81
|
+
frameworkRoot: frameworkRoot(),
|
|
82
|
+
installedAt: installedAt || new Date().toISOString(),
|
|
83
|
+
...(updatedAt ? { updatedAt } : {}),
|
|
84
|
+
files: [...files].sort((a, b) => a.path.localeCompare(b.path)),
|
|
85
|
+
};
|
|
86
|
+
const p = manifestPath(destRoot);
|
|
87
|
+
fs.mkdirSync(path.dirname(p), { recursive: true });
|
|
88
|
+
fs.writeFileSync(p, JSON.stringify(manifest, null, 2) + '\n', 'utf8');
|
|
89
|
+
return manifest;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
module.exports = {
|
|
93
|
+
MANIFEST_DIR,
|
|
94
|
+
MANIFEST_FILE,
|
|
95
|
+
manifestPath,
|
|
96
|
+
readManifest,
|
|
97
|
+
writeManifest,
|
|
98
|
+
sha256OfFile,
|
|
99
|
+
sha256OfBuffer,
|
|
100
|
+
frameworkRoot,
|
|
101
|
+
frameworkCliPath,
|
|
102
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* motor-scripts.js — fonte única do contrato de distribuição dos scripts do
|
|
4
|
+
* motor (ADR-007). Lê `installer/motor-scripts.json` (23 entradas + exclude) e
|
|
5
|
+
* expõe helpers consumidos por install/update/adopt/doctor e pelo teste-guarda.
|
|
6
|
+
*
|
|
7
|
+
* `owner`/`reason` por entrada NÃO filtram a cópia (que é incondicional, como o
|
|
8
|
+
* precedente `validate-budgets.js`); `owner` filtra apenas o DIAGNÓSTICO do
|
|
9
|
+
* doctor (Decisão 3 do ADR-007).
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const MANIFEST = require('./motor-scripts.json');
|
|
13
|
+
|
|
14
|
+
/** Objeto do manifest (scripts[] + exclude[]). */
|
|
15
|
+
function loadManifest() {
|
|
16
|
+
return MANIFEST;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Entradas do motor: [{ path, owner, reason, requiredBy? }]. */
|
|
20
|
+
function motorEntries() {
|
|
21
|
+
return MANIFEST.scripts;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Só os paths relativos (repo-root, prefixo `scripts/`). */
|
|
25
|
+
function motorRels() {
|
|
26
|
+
return MANIFEST.scripts.map((e) => e.path);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Padrões de exclusão do teste-guarda. */
|
|
30
|
+
function excludePatterns() {
|
|
31
|
+
return MANIFEST.exclude;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* True se o owner de um script do motor está instalado no projeto — o diagnóstico só
|
|
36
|
+
* cobra o script se o dono (pod ou skill) que o referencia estiver presente (ADR-007
|
|
37
|
+
* Decisão 3). Fonte única: consumido pelo `doctor` e pelo `update --scope motor`
|
|
38
|
+
* (SF10.20) — duas cópias desta regra divergiriam e o escopo do sync deixaria de bater
|
|
39
|
+
* com o escopo do diagnóstico.
|
|
40
|
+
*/
|
|
41
|
+
function ownerInstalled(destDir, owner) {
|
|
42
|
+
const fs = require('node:fs');
|
|
43
|
+
const path = require('node:path');
|
|
44
|
+
if (owner.startsWith('skill:')) return fs.existsSync(path.join(destDir, '.claude', 'skills', owner.slice('skill:'.length)));
|
|
45
|
+
if (owner.startsWith('pod:')) return fs.existsSync(path.join(destDir, 'pods', owner.slice('pod:'.length)));
|
|
46
|
+
if (owner === 'pods:*') return fs.existsSync(path.join(destDir, 'pods'));
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
module.exports = { loadManifest, motorEntries, motorRels, excludePatterns, ownerInstalled };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scripts": [
|
|
3
|
+
{ "path": "scripts/pc-run-pod.cjs", "owner": "skill:pc-run-pod", "reason": "referenced" },
|
|
4
|
+
{ "path": "scripts/pod-memory.cjs", "owner": "skill:pc-run-pod", "reason": "referenced" },
|
|
5
|
+
{ "path": "scripts/pod-memory-note.cjs", "owner": "skill:pc-run-pod", "reason": "referenced", "requiredBy": "skill:pc-run-pod" },
|
|
6
|
+
{ "path": "scripts/validate-pod-workflow.cjs", "owner": "pod:squad-forge", "reason": "referenced" },
|
|
7
|
+
{ "path": "scripts/smoke-pod-workflow.cjs", "owner": "pod:squad-forge", "reason": "referenced" },
|
|
8
|
+
{ "path": "scripts/harness-g5-lite.cjs", "owner": "pod:squad-forge", "reason": "referenced" },
|
|
9
|
+
{ "path": "scripts/migration-manifest.cjs", "owner": "pod:squad-forge", "reason": "referenced" },
|
|
10
|
+
{ "path": "scripts/watcher-audit.cjs", "owner": "pod:squad-forge", "reason": "referenced" },
|
|
11
|
+
{ "path": "scripts/validate-no-clone.cjs", "owner": "pod:squad-forge", "reason": "referenced" },
|
|
12
|
+
{ "path": "scripts/forge-assess-tier.cjs", "owner": "pod:squad-forge", "reason": "referenced" },
|
|
13
|
+
{ "path": "scripts/validate-fidelity-output.cjs", "owner": "squad-forge/mind-extractor", "reason": "referenced" },
|
|
14
|
+
{ "path": "scripts/validate-source-audit.cjs", "owner": "squad-forge/mind-extractor", "reason": "referenced" },
|
|
15
|
+
{ "path": "scripts/arena.cjs", "owner": "skill:pc-arena", "reason": "referenced" },
|
|
16
|
+
{ "path": "scripts/forge-generate.cjs", "owner": "pod:squad-forge", "reason": "referenced" },
|
|
17
|
+
{ "path": "scripts/forge-ingest-memory.cjs", "owner": "pod:squad-forge", "reason": "referenced" },
|
|
18
|
+
{ "path": "scripts/forge-upgrade-pod.cjs", "owner": "pod:squad-forge", "reason": "referenced" },
|
|
19
|
+
{ "path": "scripts/forge-harden-learning.cjs", "owner": "pod:squad-forge", "reason": "referenced" },
|
|
20
|
+
{ "path": "scripts/validate-branding.js", "owner": "pod:squad-forge", "reason": "require-dependency", "requiredBy": "scripts/validate-no-clone.cjs" },
|
|
21
|
+
{ "path": "scripts/validate-budgets.js", "owner": "pods:*", "reason": "referenced" },
|
|
22
|
+
{ "path": "scripts/veto-checks/lexical-check.cjs", "owner": "veto:command_check", "reason": "referenced", "requiredBy": "scripts/pc-run-pod.cjs" },
|
|
23
|
+
{ "path": "scripts/veto-checks/html-valid.cjs", "owner": "veto:command_check", "reason": "referenced", "requiredBy": "scripts/pc-run-pod.cjs" },
|
|
24
|
+
{ "path": "scripts/veto-checks/render-gate.cjs", "owner": "veto:command_check", "reason": "referenced", "requiredBy": "scripts/pc-run-pod.cjs" },
|
|
25
|
+
{ "path": "scripts/veto-checks/phash-gate.cjs", "owner": "veto:command_check", "reason": "referenced", "requiredBy": "scripts/pc-run-pod.cjs" },
|
|
26
|
+
{ "path": "scripts/veto-checks/render-png.cjs", "owner": "veto:command_check", "reason": "referenced", "requiredBy": "scripts/pc-run-pod.cjs" },
|
|
27
|
+
{ "path": "scripts/pc-run-pipeline.cjs", "owner": "skill:pc-pipeline", "reason": "referenced", "requiredBy": "skill:pc-pipeline" },
|
|
28
|
+
{ "path": "scripts/validate-pipeline.cjs", "owner": "skill:pc-pipeline", "reason": "require-dependency", "requiredBy": "scripts/pc-run-pipeline.cjs" },
|
|
29
|
+
{ "path": "scripts/pod-export-compile.cjs", "owner": "skill:pc-export", "reason": "referenced", "requiredBy": "skill:pc-export" },
|
|
30
|
+
{ "path": "scripts/pod-export-executor.cjs", "owner": "skill:pc-export", "reason": "referenced", "requiredBy": "skill:pc-export" },
|
|
31
|
+
{ "path": "scripts/pod-export-release.cjs", "owner": "skill:pc-export", "reason": "referenced", "requiredBy": "skill:pc-export" },
|
|
32
|
+
{ "path": "scripts/pod-export-tools.cjs", "owner": "skill:pc-export", "reason": "require-dependency", "requiredBy": "scripts/pod-export-executor.cjs" },
|
|
33
|
+
{ "path": "scripts/pod-export-postprocess.cjs", "owner": "skill:pc-export", "reason": "require-dependency", "requiredBy": "scripts/pod-export-executor.cjs" },
|
|
34
|
+
{ "path": "scripts/pod-export-service.cjs", "owner": "skill:pc-export", "reason": "referenced", "requiredBy": "skill:pc-export" },
|
|
35
|
+
{ "path": "scripts/pod-export-ui.cjs", "owner": "skill:pc-export", "reason": "referenced", "requiredBy": "skill:pc-export" },
|
|
36
|
+
{ "path": "scripts/validate-story-acs.cjs", "owner": "skill:pc-validate-story", "reason": "referenced" }
|
|
37
|
+
],
|
|
38
|
+
"exclude": ["*.test.cjs", "__tests__/", "__fixtures__/", "validate-install.js", "validate-adopt.js", "validate-update-scope-motor.js", "owner-layer.cjs", "derive-ready-transitions.cjs"]
|
|
39
|
+
}
|