@aibyzero/cm-workflow 0.10.5
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/.codex-plugin/plugin.json +30 -0
- package/AGENTS.md +74 -0
- package/CONTRIBUTING.md +62 -0
- package/LICENSE +21 -0
- package/README.md +263 -0
- package/SECURITY.md +49 -0
- package/THIRD_PARTY_NOTICES.md +29 -0
- package/VERSION +1 -0
- package/agents/cm-backend-agent.md +34 -0
- package/agents/cm-contract-agent.md +34 -0
- package/agents/cm-database-agent.md +34 -0
- package/agents/cm-frontend-agent.md +33 -0
- package/agents/cm-miniprogram-agent.md +33 -0
- package/agents/cm-ui-agent.md +34 -0
- package/assets/docs/command-picker-mobile.svg +56 -0
- package/assets/docs/command-picker.svg +56 -0
- package/assets/docs/user-guide-hero-mobile.svg +35 -0
- package/assets/docs/user-guide-hero.svg +36 -0
- package/assets/readme/delivery-flow.svg +86 -0
- package/assets/readme/hero.svg +77 -0
- package/assets/readme/recovery-record.svg +73 -0
- package/assets/readme/test-evidence.svg +64 -0
- package/compat/claude-commands/cm-ai.md +3 -0
- package/compat/claude-commands/cm-check.md +3 -0
- package/compat/claude-commands/cm-fix.md +3 -0
- package/compat/claude-commands/cm-idea.md +3 -0
- package/compat/claude-commands/cm-init.md +3 -0
- package/compat/claude-commands/cm-prd.md +3 -0
- package/compat/claude-commands/cm-refactor.md +3 -0
- package/compat/claude-commands/cm-test.md +3 -0
- package/docs/architecture.md +155 -0
- package/docs/fixes/.reviews/fix-cancel-throw-T-FIX-cancel-throw-a1-handoff.json +57 -0
- package/docs/fixes/.reviews/fix-cancel-throw-T-FIX-cancel-throw-a2-handoff.json +58 -0
- package/docs/fixes/.reviews/fix-cancel-throw-T-FIX-cancel-throw-r1.md +121 -0
- package/docs/fixes/.reviews/fix-cancel-throw-v2-T-FIX-cancel-throw-v2-a1-handoff.json +56 -0
- package/docs/fixes/.reviews/fix-cancel-throw-v2-T-FIX-cancel-throw-v2-r1.md +100 -0
- package/docs/fixes/.reviews/fix-cm-js-n1n2-admission-successor-T-FIX-cm-js-n1n2-admission-successor-a1-handoff.json +61 -0
- package/docs/fixes/.reviews/fix-cm-js-n1n2-admission-successor-T-FIX-cm-js-n1n2-admission-successor-a2-handoff.json +63 -0
- package/docs/fixes/.reviews/fix-cm-js-n1n2-admission-successor-T-FIX-cm-js-n1n2-admission-successor-r1.md +58 -0
- package/docs/fixes/.reviews/fix-cm-js-n1n2-admission-successor-T-FIX-cm-js-n1n2-admission-successor-r2.md +55 -0
- package/docs/fixes/.reviews/fix-f01-dual-failure-terminal-T-FIX-f01-dual-failure-terminal-a1-handoff.json +65 -0
- package/docs/fixes/.reviews/fix-f01-dual-failure-terminal-T-FIX-f01-dual-failure-terminal-r1.md +88 -0
- package/docs/fixes/.reviews/fix-manifest-runtime-checkbox-drift-r1.md +33 -0
- package/docs/fixes/.reviews/fix-manifest-runtime-checkbox-drift-r2.md +31 -0
- package/docs/fixes/.reviews/fix-model-call-boundary-identity-T-FIX-model-call-boundary-identity-a1-handoff.json +56 -0
- package/docs/fixes/.reviews/fix-model-call-boundary-identity-T-FIX-model-call-boundary-identity-a2-handoff.json +85 -0
- package/docs/fixes/.reviews/fix-model-call-boundary-identity-T-FIX-model-call-boundary-identity-r1.md +53 -0
- package/docs/fixes/.reviews/fix-model-call-boundary-identity-T-FIX-model-call-boundary-identity-r2.md +80 -0
- package/docs/fixes/.reviews/fix-review-evidence-scope-honesty-T-FIX-review-evidence-scope-honesty-a1-handoff.json +35 -0
- package/docs/fixes/.reviews/fix-review-evidence-scope-honesty-T-FIX-review-evidence-scope-honesty-r1.md +33 -0
- package/docs/fixes/.reviews/fix-windows-cp1252-log-output-r1.md +30 -0
- package/docs/fixes/.reviews/fix-windows-cp1252-log-output-r2.md +16 -0
- package/docs/fixes/.reviews/openai-compatible-depth-fixture-T-FIX-openai-compatible-depth-fixture-a1-handoff.json +40 -0
- package/docs/fixes/.reviews/openai-compatible-depth-fixture-T-FIX-openai-compatible-depth-fixture-r1.md +30 -0
- package/docs/fixes/20260729-windows-cp1252-log-output.md +65 -0
- package/docs/fixes/20260804-manifest-runtime-checkbox-drift.md +67 -0
- package/docs/fixes/20260806-model-call-boundary-identity.md +80 -0
- package/docs/fixes/20260807-prelanding-integrity.md +58 -0
- package/docs/fixes/20260826-openai-compatible-depth-fixture.md +39 -0
- package/docs/fixes/20260903-cm-js-n1n2-admission-r1.md +64 -0
- package/docs/fixes/20260903-cm-js-n1n2-admission-successor.md +83 -0
- package/docs/fixes/20260903-s4c1b-v3-cancel-throw.md +89 -0
- package/docs/fixes/20260904-f01-codex-dual-failure-terminal.md +89 -0
- package/docs/fixes/20260907-wip-triage-log.md +44 -0
- package/docs/installation.md +202 -0
- package/docs/js-workflow-control.md +1010 -0
- package/docs/sample-prd/prd-funding-rate-alert.md +42 -0
- package/docs/sample-specs/docs//351/234/200/346/261/202/347/244/272/344/276/213.md +24 -0
- package/docs/user-guide.md +526 -0
- package/docs//351/207/215/346/236/204/346/265/201/347/250/213/350/256/276/350/256/241/README.md +19 -0
- package/docs//351/207/215/346/236/204/346/265/201/347/250/213/350/256/276/350/256/241/refactor-flow.excalidraw +3650 -0
- package/docs//351/207/215/346/236/204/346/265/201/347/250/213/350/256/276/350/256/241/refactor-flow.mp4 +0 -0
- package/docs//351/207/215/346/236/204/346/265/201/347/250/213/350/256/276/350/256/241/refactor-flow.png +0 -0
- package/docs//351/207/215/346/236/204/346/265/201/347/250/213/350/256/276/350/256/241/refactor-flow.spec.json +223 -0
- package/install-codex.sh +184 -0
- package/install.ps1 +206 -0
- package/install.sh +244 -0
- package/package.json +58 -0
- package/runtime/external-expert.md +302 -0
- package/runtime/js/cm-ai/accepted-fix.mjs +28 -0
- package/runtime/js/cm-ai/claude-developer-adapter.mjs +6 -0
- package/runtime/js/cm-ai/claude-review-adapter.mjs +16 -0
- package/runtime/js/cm-ai/claude-review-stream.mjs +53 -0
- package/runtime/js/cm-ai/claude-tool-preview.mjs +107 -0
- package/runtime/js/cm-ai/cm-ai-admission.mjs +353 -0
- package/runtime/js/cm-ai/cm-ai-context-refresh.mjs +217 -0
- package/runtime/js/cm-ai/cm-ai-conversation-entry.mjs +538 -0
- package/runtime/js/cm-ai/cm-ai-learning-handoff-writer.mjs +119 -0
- package/runtime/js/cm-ai/cm-ai-learning-writer.mjs +172 -0
- package/runtime/js/cm-ai/cm-ai-qa-log.mjs +320 -0
- package/runtime/js/cm-ai/cm-ai-run-finalizer.mjs +107 -0
- package/runtime/js/cm-ai/code-projects.mjs +85 -0
- package/runtime/js/cm-ai/codex-config.mjs +48 -0
- package/runtime/js/cm-ai/codex-developer-adapter.mjs +5 -0
- package/runtime/js/cm-ai/codex-developer-basic-output.schema.json +6 -0
- package/runtime/js/cm-ai/codex-developer-output.schema.json +37 -0
- package/runtime/js/cm-ai/codex-review-adapter.mjs +73 -0
- package/runtime/js/cm-ai/contracts.mjs +156 -0
- package/runtime/js/cm-ai/developer-adapter.mjs +93 -0
- package/runtime/js/cm-ai/durable-runner-state.mjs +504 -0
- package/runtime/js/cm-ai/effect-contract.mjs +102 -0
- package/runtime/js/cm-ai/execution-platform.mjs +7 -0
- package/runtime/js/cm-ai/execution-store.mjs +211 -0
- package/runtime/js/cm-ai/fix-code-association.mjs +40 -0
- package/runtime/js/cm-ai/gate-bridge.mjs +25 -0
- package/runtime/js/cm-ai/host-bootstrap.mjs +170 -0
- package/runtime/js/cm-ai/host-check.mjs +89 -0
- package/runtime/js/cm-ai/host-conversation-execution.mjs +125 -0
- package/runtime/js/cm-ai/host-documentation.mjs +40 -0
- package/runtime/js/cm-ai/host-handoff.mjs +71 -0
- package/runtime/js/cm-ai/host-project-execution.mjs +58 -0
- package/runtime/js/cm-ai/host-qa-executor.mjs +238 -0
- package/runtime/js/cm-ai/host-qa-fix-owner.mjs +131 -0
- package/runtime/js/cm-ai/host-qa-fix.mjs +30 -0
- package/runtime/js/cm-ai/host-qa-policy.mjs +70 -0
- package/runtime/js/cm-ai/host-review-authority.mjs +36 -0
- package/runtime/js/cm-ai/host-review-file.mjs +56 -0
- package/runtime/js/cm-ai/host-role-routing.mjs +41 -0
- package/runtime/js/cm-ai/host-session.mjs +96 -0
- package/runtime/js/cm-ai/host-tool-bridge.mjs +53 -0
- package/runtime/js/cm-ai/host-workflow-capabilities.mjs +45 -0
- package/runtime/js/cm-ai/host.mjs +20 -0
- package/runtime/js/cm-ai/index.mjs +7 -0
- package/runtime/js/cm-ai/provider-review-observation.mjs +86 -0
- package/runtime/js/cm-ai/qa-fix-definition.mjs +21 -0
- package/runtime/js/cm-ai/review-evidence-file.mjs +38 -0
- package/runtime/js/cm-ai/review-package.mjs +426 -0
- package/runtime/js/cm-ai/review-result.schema.json +40 -0
- package/runtime/js/cm-ai/review-runner.mjs +35 -0
- package/runtime/js/cm-ai/task-commit-codec.mjs +54 -0
- package/runtime/js/cm-ai/task-commit.mjs +201 -0
- package/runtime/js/cm-ai/task-owner.mjs +97 -0
- package/runtime/js/cm-ai/task-runner.mjs +766 -0
- package/runtime/js/cm-ai/tool-preview.mjs +205 -0
- package/runtime/js/cm-ai/worker-claude.mjs +104 -0
- package/runtime/js/cm-ai/worker-codex-developer.mjs +124 -0
- package/runtime/js/cm-ai/worker-codex.mjs +143 -0
- package/runtime/js/cm-check/host.mjs +101 -0
- package/runtime/js/cm-fix/baseline.mjs +70 -0
- package/runtime/js/cm-fix/cause-evidence.mjs +24 -0
- package/runtime/js/cm-fix/cause-invocation.mjs +40 -0
- package/runtime/js/cm-fix/cause-package.mjs +68 -0
- package/runtime/js/cm-fix/dossier.mjs +140 -0
- package/runtime/js/cm-fix/execution.mjs +1549 -0
- package/runtime/js/cm-fix/final-review-evidence.mjs +20 -0
- package/runtime/js/cm-fix/final-review.mjs +156 -0
- package/runtime/js/cm-fix/finish.mjs +124 -0
- package/runtime/js/cm-fix/handoff.mjs +64 -0
- package/runtime/js/cm-fix/host-review.mjs +38 -0
- package/runtime/js/cm-fix/host.mjs +96 -0
- package/runtime/js/cm-fix/investigation.mjs +25 -0
- package/runtime/js/cm-fix/layout.mjs +17 -0
- package/runtime/js/cm-fix/learning-writeback.mjs +86 -0
- package/runtime/js/cm-fix/learning.mjs +31 -0
- package/runtime/js/cm-fix/metrics.mjs +75 -0
- package/runtime/js/cm-fix/progress.mjs +64 -0
- package/runtime/js/cm-fix/protected-edits.mjs +95 -0
- package/runtime/js/cm-fix/qa-source.mjs +58 -0
- package/runtime/js/cm-fix/red-test.mjs +92 -0
- package/runtime/js/cm-fix/regression-evidence.mjs +64 -0
- package/runtime/js/cm-fix/regression.mjs +41 -0
- package/runtime/js/cm-fix/repair.mjs +95 -0
- package/runtime/js/cm-fix/reproduce.mjs +54 -0
- package/runtime/js/cm-fix/retrospective.mjs +41 -0
- package/runtime/js/cm-fix/review-baseline.mjs +47 -0
- package/runtime/js/cm-fix/start.mjs +49 -0
- package/runtime/js/cm-fix/test-author.mjs +63 -0
- package/runtime/js/cm-fix/visual.mjs +72 -0
- package/runtime/js/cm-fix/walkthrough.mjs +126 -0
- package/runtime/js/cm-idea/session.mjs +79 -0
- package/runtime/js/cm-init/draft-generation.mjs +66 -0
- package/runtime/js/cm-init/draft-inspection.mjs +70 -0
- package/runtime/js/cm-init/project-analysis.mjs +60 -0
- package/runtime/js/cm-init/project-scan.mjs +55 -0
- package/runtime/js/cm-init/review-evidence.mjs +80 -0
- package/runtime/js/cm-prd/accepted-design.mjs +46 -0
- package/runtime/js/cm-prd/analysis.mjs +260 -0
- package/runtime/js/cm-prd/change.mjs +268 -0
- package/runtime/js/cm-prd/correction-check.mjs +49 -0
- package/runtime/js/cm-prd/design-risk.mjs +30 -0
- package/runtime/js/cm-prd/disposition-plan.mjs +33 -0
- package/runtime/js/cm-prd/draft-save.mjs +122 -0
- package/runtime/js/cm-prd/draft.mjs +70 -0
- package/runtime/js/cm-prd/materials.mjs +48 -0
- package/runtime/js/cm-prd/review-correction.mjs +158 -0
- package/runtime/js/cm-prd/review-disposition.mjs +96 -0
- package/runtime/js/cm-prd/review-findings.mjs +36 -0
- package/runtime/js/cm-prd/review-host.mjs +48 -0
- package/runtime/js/cm-prd/review-preparation.mjs +49 -0
- package/runtime/js/cm-prd/review-publication.mjs +56 -0
- package/runtime/js/cm-prd/self-check.mjs +75 -0
- package/runtime/js/cm-prd/session.mjs +74 -0
- package/runtime/js/cm-prd/summary.mjs +133 -0
- package/runtime/js/cm-refactor/host.mjs +2 -0
- package/runtime/js/cm-refactor/records.mjs +86 -0
- package/runtime/js/cm-refactor/workflow.mjs +478 -0
- package/runtime/js/cm-test/declared-command.mjs +32 -0
- package/runtime/js/cm-test/host.mjs +319 -0
- package/runtime/js/cm-test/logic-results.mjs +39 -0
- package/runtime/js/cm-test/recovery.mjs +58 -0
- package/runtime/js/cm-test/session.mjs +56 -0
- package/runtime/js/cm-test/source-snapshot.mjs +136 -0
- package/runtime/logging.md +207 -0
- package/runtime/model-efficiency.md +201 -0
- package/runtime/orchestration.md +113 -0
- package/runtime/project-context.md +43 -0
- package/runtime/project-learning.md +49 -0
- package/runtime/review.md +140 -0
- package/runtime/steelman-review.md +111 -0
- package/runtime/task-gates.md +283 -0
- package/runtime/task-handoff.schema.json +103 -0
- package/runtime/test-contract.md +212 -0
- package/runtime/workflow-config.md +118 -0
- package/runtime/workflow-routing.md +82 -0
- package/scripts/cm-ai-admission.mjs +50 -0
- package/scripts/cm-ai-admission.test.mjs +38 -0
- package/scripts/cm-ai-batch-host.mjs +77 -0
- package/scripts/cm-ai-batch-host.test.mjs +155 -0
- package/scripts/cm-ai-batch-run.mjs +136 -0
- package/scripts/cm-ai-batch-run.test.mjs +128 -0
- package/scripts/cm-ai-bootstrap.test.mjs +228 -0
- package/scripts/cm-ai-fix-integration.test.mjs +233 -0
- package/scripts/cm-ai-host.mjs +175 -0
- package/scripts/cm-ai-host.test.mjs +368 -0
- package/scripts/cm-ai-multi-root.test.mjs +289 -0
- package/scripts/cm-ai-nested-execution.test.mjs +313 -0
- package/scripts/cm-ai-run.mjs +293 -0
- package/scripts/cm-ai-run.test.mjs +336 -0
- package/scripts/cm-check-entry.mjs +120 -0
- package/scripts/cm-check-host.mjs +29 -0
- package/scripts/cm-check-host.test.mjs +71 -0
- package/scripts/cm-check-runtime.ps1 +69 -0
- package/scripts/cm-check-runtime.sh +910 -0
- package/scripts/cm-claude-probe.test.mjs +54 -0
- package/scripts/cm-claude-review-stream.test.mjs +45 -0
- package/scripts/cm-claude-worker.test.mjs +92 -0
- package/scripts/cm-codex-developer-adapter.test.mjs +85 -0
- package/scripts/cm-codex-developer-worker.test.mjs +128 -0
- package/scripts/cm-codex-review-progress.test.mjs +96 -0
- package/scripts/cm-execution-platform.test.mjs +47 -0
- package/scripts/cm-fix-cause-invocation.test.mjs +72 -0
- package/scripts/cm-fix-cause-package.test.mjs +68 -0
- package/scripts/cm-fix-code-association.test.mjs +55 -0
- package/scripts/cm-fix-entry.mjs +132 -0
- package/scripts/cm-fix-execution.test.mjs +63 -0
- package/scripts/cm-fix-final-review.test.mjs +124 -0
- package/scripts/cm-fix-host-review-assembly.test.mjs +34 -0
- package/scripts/cm-fix-host-review.test.mjs +261 -0
- package/scripts/cm-fix-host-sequence.test.mjs +26 -0
- package/scripts/cm-fix-host.mjs +89 -0
- package/scripts/cm-fix-host.test.mjs +105 -0
- package/scripts/cm-fix-learning-writeback.test.mjs +73 -0
- package/scripts/cm-fix-learning.test.mjs +66 -0
- package/scripts/cm-fix-metrics.test.mjs +58 -0
- package/scripts/cm-fix-no-existing-tests.test.mjs +92 -0
- package/scripts/cm-fix-observation-dossier.test.mjs +452 -0
- package/scripts/cm-fix-progress.test.mjs +45 -0
- package/scripts/cm-fix-protected-edits.test.mjs +54 -0
- package/scripts/cm-fix-qa-source.test.mjs +206 -0
- package/scripts/cm-fix-red-owner.test.mjs +143 -0
- package/scripts/cm-fix-red-test.test.mjs +38 -0
- package/scripts/cm-fix-regression.test.mjs +57 -0
- package/scripts/cm-fix-repair-owner.test.mjs +370 -0
- package/scripts/cm-fix-repair.test.mjs +68 -0
- package/scripts/cm-fix-reproduce.test.mjs +31 -0
- package/scripts/cm-fix-retrospective.test.mjs +46 -0
- package/scripts/cm-fix-review-baseline.test.mjs +54 -0
- package/scripts/cm-fix-review-recovery.test.mjs +197 -0
- package/scripts/cm-fix-test-author.test.mjs +105 -0
- package/scripts/cm-fix-visual-bare.test.mjs +171 -0
- package/scripts/cm-fix-walkthrough.test.mjs +45 -0
- package/scripts/cm-host-check.test.mjs +113 -0
- package/scripts/cm-host-documentation.test.mjs +45 -0
- package/scripts/cm-host-handoff.test.mjs +58 -0
- package/scripts/cm-host-qa-executor.test.mjs +156 -0
- package/scripts/cm-host-qa-policy.test.mjs +59 -0
- package/scripts/cm-host-review-authority.test.mjs +60 -0
- package/scripts/cm-host-role-routing.test.mjs +33 -0
- package/scripts/cm-idea-entry.mjs +104 -0
- package/scripts/cm-idea-host.mjs +144 -0
- package/scripts/cm-idea-host.test.mjs +75 -0
- package/scripts/cm-idea-recovery.test.mjs +90 -0
- package/scripts/cm-init-analysis-host.test.mjs +50 -0
- package/scripts/cm-init-draft-generation.test.mjs +52 -0
- package/scripts/cm-init-draft-inspection.test.mjs +41 -0
- package/scripts/cm-init-entry.mjs +170 -0
- package/scripts/cm-init-host.mjs +284 -0
- package/scripts/cm-init-host.test.mjs +231 -0
- package/scripts/cm-init-project-analysis.test.mjs +47 -0
- package/scripts/cm-init-project-scan.test.mjs +41 -0
- package/scripts/cm-init-revision-host.test.mjs +61 -0
- package/scripts/cm-init-session.test.mjs +122 -0
- package/scripts/cm-log-event.mjs +538 -0
- package/scripts/cm-log-event.py +133 -0
- package/scripts/cm-log-event.test.mjs +70 -0
- package/scripts/cm-openai-compatible-call.py +661 -0
- package/scripts/cm-prd-analysis.test.mjs +67 -0
- package/scripts/cm-prd-completion.test.mjs +190 -0
- package/scripts/cm-prd-design-phase.test.mjs +296 -0
- package/scripts/cm-prd-draft-save.test.mjs +63 -0
- package/scripts/cm-prd-draft.test.mjs +39 -0
- package/scripts/cm-prd-entry.mjs +245 -0
- package/scripts/cm-prd-host.mjs +273 -0
- package/scripts/cm-prd-host.test.mjs +169 -0
- package/scripts/cm-prd-materials.test.mjs +41 -0
- package/scripts/cm-prd-review-claim.test.mjs +42 -0
- package/scripts/cm-prd-review-disposition.test.mjs +196 -0
- package/scripts/cm-prd-review-gate.mjs +194 -0
- package/scripts/cm-prd-review-gate.py +26 -0
- package/scripts/cm-prd-review-host.test.mjs +30 -0
- package/scripts/cm-prd-review-preparation.test.mjs +69 -0
- package/scripts/cm-prd-review-publication.test.mjs +95 -0
- package/scripts/cm-prd-revision.test.mjs +32 -0
- package/scripts/cm-prd-self-check.test.mjs +23 -0
- package/scripts/cm-prd-sources.test.mjs +76 -0
- package/scripts/cm-prd-timing.py +272 -0
- package/scripts/cm-refactor-entry.mjs +145 -0
- package/scripts/cm-refactor-host.mjs +26 -0
- package/scripts/cm-refactor-host.test.mjs +201 -0
- package/scripts/cm-review-dependency-snapshot.test.mjs +67 -0
- package/scripts/cm-review-inventory.test.mjs +109 -0
- package/scripts/cm-spec-manifest.mjs +104 -0
- package/scripts/cm-spec-manifest.py +26 -0
- package/scripts/cm-task-gate.mjs +879 -0
- package/scripts/cm-task-gate.py +312 -0
- package/scripts/cm-task-gate.test.mjs +202 -0
- package/scripts/cm-test-declared-command.test.mjs +18 -0
- package/scripts/cm-test-entry.mjs +231 -0
- package/scripts/cm-test-host.mjs +40 -0
- package/scripts/cm-test-host.test.mjs +169 -0
- package/scripts/cm-test-logic-results.test.mjs +26 -0
- package/scripts/cm-test-session.test.mjs +138 -0
- package/scripts/cm-usage-report.py +516 -0
- package/scripts/cm-workflow-config.mjs +463 -0
- package/scripts/cm-workflow-config.test.mjs +181 -0
- package/scripts/cm-workflow.mjs +36 -0
- package/scripts/cm-workflow.test.mjs +51 -0
- package/scripts/cm_workflow_config.py +52 -0
- package/scripts/fixtures/claude-review-process.mjs +35 -0
- package/scripts/fixtures/codex-review-process.mjs +22 -0
- package/scripts/fixtures/prd-review-gate-python-oracle.py +320 -0
- package/scripts/fixtures/spec-manifest-python-oracle.py +172 -0
- package/scripts/scan-public-safety.py +117 -0
- package/scripts/test-cm-log-event.py +1213 -0
- package/scripts/test-cm-openai-compatible-call.py +1185 -0
- package/scripts/test-cm-prd-review-gate.py +272 -0
- package/scripts/test-cm-prd-timing.py +168 -0
- package/scripts/test-cm-usage-report.py +584 -0
- package/scripts/test-npm-install.py +171 -0
- package/scripts/test-scan-public-safety.py +76 -0
- package/scripts/test-shell-compat.sh +365 -0
- package/scripts/test-spec-manifest.py +263 -0
- package/scripts/test-task-gate.py +46 -0
- package/scripts/test-workflow-config.py +30 -0
- package/scripts/validate-public-repo.py +245 -0
- package/scripts/validate-test-cases.mjs +71 -0
- package/scripts/validate-test-cases.py +27 -0
- package/scripts/validate-test-cases.test.mjs +36 -0
- package/skills/cm-ai/SKILL.md +137 -0
- package/skills/cm-ai/references/N1-init.md +108 -0
- package/skills/cm-ai/references/N2-enter-feature.md +38 -0
- package/skills/cm-ai/references/N3-execute-task.md +123 -0
- package/skills/cm-ai/references/N4-review.md +103 -0
- package/skills/cm-ai/references/N5-mark-done.md +117 -0
- package/skills/cm-ai/references/N6-qa-eval.md +102 -0
- package/skills/cm-ai/references/N7-context.md +23 -0
- package/skills/cm-ai/references/N8-finish.md +103 -0
- package/skills/cm-ai/references/js-host.md +126 -0
- package/skills/cm-backend-engineer/SKILL.md +100 -0
- package/skills/cm-check/SKILL.md +52 -0
- package/skills/cm-check/references/js-host.md +44 -0
- package/skills/cm-contract-engineer/SKILL.md +136 -0
- package/skills/cm-database-engineer/SKILL.md +89 -0
- package/skills/cm-devops-engineer/SKILL.md +137 -0
- package/skills/cm-doc-syncer/SKILL.md +150 -0
- package/skills/cm-finance-expert/SKILL.md +85 -0
- package/skills/cm-fix/SKILL.md +199 -0
- package/skills/cm-fix/references/cross-boundary-debugging.md +44 -0
- package/skills/cm-fix/references/js-host.md +135 -0
- package/skills/cm-frontend-engineer/SKILL.md +127 -0
- package/skills/cm-idea/SKILL.md +55 -0
- package/skills/cm-idea/references/domains/trading.md +97 -0
- package/skills/cm-idea/references/example-prd.md +92 -0
- package/skills/cm-idea/references/idea-to-prd.md +282 -0
- package/skills/cm-idea/references/js-host.md +63 -0
- package/skills/cm-init/SKILL.md +191 -0
- package/skills/cm-init/references/js-host.md +123 -0
- package/skills/cm-miniprogram-engineer/SKILL.md +141 -0
- package/skills/cm-miniprogram-engineer/references/platform-readiness.md +58 -0
- package/skills/cm-miniprogram-engineer/references/release-checklist.md +59 -0
- package/skills/cm-prd/SKILL.md +548 -0
- package/skills/cm-prd/references/brownfield.md +13 -0
- package/skills/cm-prd/references/change-mode.md +145 -0
- package/skills/cm-prd/references/context-scope.md +62 -0
- package/skills/cm-prd/references/greenfield.md +80 -0
- package/skills/cm-prd/references/js-change-recovery.md +57 -0
- package/skills/cm-prd/references/js-host.md +98 -0
- package/skills/cm-prd/references/phase-timing.md +68 -0
- package/skills/cm-prd/references/spec-self-check.md +22 -0
- package/skills/cm-product-manager/SKILL.md +83 -0
- package/skills/cm-qa-engineer/SKILL.md +142 -0
- package/skills/cm-refactor/SKILL.md +236 -0
- package/skills/cm-refactor/references/js-batch.md +75 -0
- package/skills/cm-refactor/references/js-host.md +78 -0
- package/skills/cm-test/SKILL.md +288 -0
- package/skills/cm-test/references/js-host.md +118 -0
- package/skills/cm-ui-engineer/SKILL.md +105 -0
- package/skills/codebase-context/SKILL.md +489 -0
- package/skills/darwin-skill/NOTICE.md +26 -0
- package/skills/darwin-skill/README.md +272 -0
- package/skills/darwin-skill/SKILL.md +492 -0
- package/skills/darwin-skill/references/runtime-neutrality.md +68 -0
- package/skills/darwin-skill/references/skilllens-evidence.md +142 -0
- package/skills/darwin-skill/scripts/screenshot.mjs +71 -0
- package/skills/darwin-skill/templates/result-card-dark.html +698 -0
- package/skills/darwin-skill/templates/result-card-white.html +444 -0
- package/skills/darwin-skill/templates/result-card.html +616 -0
- package/skills/external-expert/SKILL.md +250 -0
- package/templates/arch-reference.md +68 -0
- package/templates/auto-update/cm-announce.sh +19 -0
- package/templates/auto-update/cm-update.sh +274 -0
- package/templates/cm-workflow.yml +52 -0
- package/templates/dashboard/dashboard.html +153 -0
- package/templates/dashboard/serve.sh +10 -0
- package/templates/hooks/pre-commit-cm-task-check +67 -0
- package/templates/pixel/cm-pixel.html +388 -0
- package/templates/pixel/cm-pixel.sh +212 -0
- package/templates/pixel/dev/README.md +20 -0
- package/templates/pixel/dev/atlas-preview.png +0 -0
- package/templates/pixel/dev/build.py +55 -0
- package/templates/pixel/dev/sheets/roguelikeChar_transparent.png +0 -0
- package/templates/pixel/dev/sheets/roguelikeCity_tilemap.png +0 -0
- package/templates/pixel/dev/sheets/roguelikeIndoor_transparent.png +0 -0
- package/templates/pixel/dev/template.html +388 -0
- package/templates/pixel/serve.sh +12 -0
- package/templates/refactor/cm-refactor-denies.json +14 -0
- package/templates/rules/backend-api.md +36 -0
- package/templates/rules/coding-style.md +44 -0
- package/templates/rules/database.md +27 -0
- package/templates/rules/finance.md +32 -0
- package/templates/rules/frontend.md +32 -0
- package/templates/rules/git-workflow.md +25 -0
- package/templates/rules/miniprogram.md +31 -0
- package/templates/rules/security.md +31 -0
- package/templates/rules/smart-contract.md +28 -0
- package/templates/rules/testing.md +36 -0
- package/templates/statusline/cm-statusline.sh +73 -0
- package/templates/ui-lens/cm-ui-lens-extract.mjs +55 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# cm-check JS 会话接线
|
|
2
|
+
|
|
3
|
+
控制器只串联原机械检查、八组语义检查与输出,不引入provider或自动修复。当前宿主使用现有终端/文件读取能力;没有后台审计、持久化记录或任务完成权限。
|
|
4
|
+
|
|
5
|
+
## 启动
|
|
6
|
+
|
|
7
|
+
按主Skill启动`cm-check-host.mjs serve --skill-dir PATH --project PATH [--config PATH]`,保持stdin/stdout双向。
|
|
8
|
+
Windows PowerShell使用`node "{CM_WORKFLOW_ROOT}\scripts\cm-check-host.mjs" serve --skill-dir "{CM_WORKFLOW_ROOT}\skills\cm-check" --project (Get-Location).Path`。
|
|
9
|
+
host_ready后发送`{"requestId":"check-1","operation":"start"}`;状态用status,取消用cancel,最后发送`{type:"host_close",sessionId:"原值"}`。
|
|
10
|
+
不重发start;断开或缺宿主能力如实阻断,不伪造检查、不另调provider、不自行修文件。取消时宿主负责停止原终端检查并核实清理,JS不会替宿主杀进程。
|
|
11
|
+
|
|
12
|
+
## check_runtime:原机械检查一次
|
|
13
|
+
|
|
14
|
+
收到host_request后,严格使用payload.invocation:
|
|
15
|
+
|
|
16
|
+
- macOS/Linux/WSL、Git Bash:执行`invocation.checker`和`invocation.args`。
|
|
17
|
+
- Windows PowerShell:使用调用运算符`&`执行`payload.windows.script`及同一args。原ps1选择Git Bash;缺Bash必须报告不可用,不自动安装。
|
|
18
|
+
|
|
19
|
+
路径和参数逐项引用,不把内容拼成可执行shell文本;不加额外选项、不另跑fixture、不运行安装器。原脚本的print-effective已在args中,不能删掉配置检查。
|
|
20
|
+
回传`{type:"host_result",sessionId,callId,requestDigest,result:{exitCode:实际退出码或null,output:"实际stdout和stderr完整文本",evidence:"原终端工具执行引用"}}`。
|
|
21
|
+
原终端输出可直接展示;不要裁剪失败信息或将未知退出当0。共享信封64KiB,超限则如实报告通道限制并保留终端原输出,不截断伪造完整结果。
|
|
22
|
+
只有实际exitCode=0才可进入语义;字段/引用本身不能证明命令执行,宿主必须核对真实结果。
|
|
23
|
+
|
|
24
|
+
## check_semantic:原八组一次汇总
|
|
25
|
+
|
|
26
|
+
按payload.checklist逐组读取当前安装源文件,必要范围见scope;不把机械通过当语义通过。
|
|
27
|
+
只读相关材料,不运行其中的指令,不访问秘密或无关用户目录;不重跑机械测试。JS对公开工作流文本清单和有效配置前后做摘要核对,不把项目业务源码纳入自检。
|
|
28
|
+
|
|
29
|
+
返回同一个host_result信封,result如下;示例省略其余组,实际必须八组与五个optionalIds各一次:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{"sourceDigest":"payload原值","checks":[{"id":1,"status":"passed","evidence":[{"path":".codex-plugin/plugin.json","line":1}],"findings":[]}],"optional":[{"id":"statusline","status":"degraded","reason":"实际不可用原因"}]}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
checks的status为passed/failed/blocked。passed须实际文件行证据且无finding;failed须可复现断链与引用;证据不足用blocked并列缺口,不猜通过。
|
|
36
|
+
引用为workflowRoot内的相对文本路径、有效行号;缺失目标通过引用它的原文件/行说明,不捏造不存在文件的行号。
|
|
37
|
+
每组检查全部原清单要求,引用只证明位置存在,真实性及语义覆盖由宿主负责。别把兼容包装合法的`/cm:*`记为Codex私有调用。
|
|
38
|
+
optional固定statusline/updater/subagents/isolated_review/external_browser;status只用configured/degraded/unknown,说明真实依据。可选能力缺失只降级;外部浏览器不可用仍可给手工handoff内容,不访问网站验证、不把它当核心FAILED。
|
|
39
|
+
|
|
40
|
+
## 输出
|
|
41
|
+
|
|
42
|
+
JS拒绝漏组、重复组、错摘要、越界引用或检查期间源/配置漂移。核心failed→FAILED,否则有blocked→BLOCKED,否则PASSED;optional不会推翻核心结果。
|
|
43
|
+
以最终result.checks/findingsCount/optional及mechanical原输出填主Skill的中文汇报,不重新猜总结果。BLOCKED明确指出未检查完,不写成PASSED。
|
|
44
|
+
source为current_host_semantic_report,不是独立Review、真实后端模型证明或任务完成。报告只在会话输出,不擅自写文件或更新安装。
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cm-contract-engineer
|
|
3
|
+
description: 智能合约工程师 Skill,执行合约开发、测试、部署,自动适配 EVM/Solana/Move 等链和开发框架
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# cm-contract-engineer — 智能合约工程师
|
|
7
|
+
|
|
8
|
+
执行智能合约开发任务。自动识别链类型和开发框架。
|
|
9
|
+
|
|
10
|
+
## 触发条件
|
|
11
|
+
|
|
12
|
+
由 `/cm-ai` 自动调用,当 task 涉及智能合约开发时触发。
|
|
13
|
+
|
|
14
|
+
## 工作流程
|
|
15
|
+
|
|
16
|
+
### 1. 识别技术栈
|
|
17
|
+
|
|
18
|
+
自动检测,不做硬编码假设:
|
|
19
|
+
|
|
20
|
+
- **链/VM**:EVM(Ethereum/Base/Arbitrum/BSC...)/ Solana / Aptos / Sui / TON / Cosmos
|
|
21
|
+
- **语言**:Solidity / Rust / Move / Vyper / FunC / Cairo
|
|
22
|
+
- **框架**:Foundry / Hardhat / Anchor / Truffle / Brownie / Ape
|
|
23
|
+
- **检测方式**:`foundry.toml` / `hardhat.config.*` / `Anchor.toml` / `truffle-config.js` / `Move.toml` / `contracts/` 目录
|
|
24
|
+
|
|
25
|
+
### 2. 读取上下文
|
|
26
|
+
|
|
27
|
+
- `.claude/rules/smart-contract.md`、`.claude/rules/security.md`(如存在)
|
|
28
|
+
- design.md 中的合约接口设计
|
|
29
|
+
- 现有合约代码和部署配置
|
|
30
|
+
- 已有的测试文件和部署脚本
|
|
31
|
+
|
|
32
|
+
### 3. 开发
|
|
33
|
+
|
|
34
|
+
**合约编写:**
|
|
35
|
+
|
|
36
|
+
- 遵循项目已有的合约组织方式(单文件/模块化/Diamond 模式等)
|
|
37
|
+
- 接口(interface)先行,实现后补
|
|
38
|
+
- 使用成熟的库(OpenZeppelin / Solmate / SPL 等)而非手写基础功能
|
|
39
|
+
- NatSpec / Rust doc 注释覆盖所有 public 函数
|
|
40
|
+
|
|
41
|
+
**安全优先(EVM/Solidity 重点):**
|
|
42
|
+
|
|
43
|
+
- 重入防护:使用 ReentrancyGuard 或 checks-effects-interactions 模式
|
|
44
|
+
- 整数溢出:Solidity ≥0.8 内置检查,低版本用 SafeMath
|
|
45
|
+
- 权限控制:Ownable / AccessControl / 多签,避免单点控制
|
|
46
|
+
- 外部调用:不信任外部合约返回值,限制 gas 转发
|
|
47
|
+
- 闪电贷攻击:价格预言机用 TWAP 而非即时价格
|
|
48
|
+
- 前端运行(MEV):commit-reveal 或时间锁机制
|
|
49
|
+
|
|
50
|
+
**安全优先(Solana/Anchor 重点):**
|
|
51
|
+
|
|
52
|
+
- 账户验证:每个 instruction 都要验证 account owner 和 signer
|
|
53
|
+
- PDA 派生:种子要唯一,避免碰撞
|
|
54
|
+
- CPI 调用:验证目标 program_id
|
|
55
|
+
- 整数溢出:用 checked_add / checked_mul
|
|
56
|
+
|
|
57
|
+
**Gas/资源优化:**
|
|
58
|
+
|
|
59
|
+
- 存储变量打包(EVM slot packing)
|
|
60
|
+
- 减少 SSTORE/SLOAD 操作
|
|
61
|
+
- 批量操作代替循环中的单次调用
|
|
62
|
+
- Solana: 减少账户数量,合理使用 zero-copy
|
|
63
|
+
|
|
64
|
+
### 4. 测试
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Foundry
|
|
68
|
+
forge test -vvv
|
|
69
|
+
forge coverage
|
|
70
|
+
|
|
71
|
+
# Hardhat
|
|
72
|
+
npx hardhat test
|
|
73
|
+
npx hardhat coverage
|
|
74
|
+
|
|
75
|
+
# Anchor
|
|
76
|
+
anchor test
|
|
77
|
+
|
|
78
|
+
# Move
|
|
79
|
+
aptos move test
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**测试要求:**
|
|
83
|
+
|
|
84
|
+
- 正常流程覆盖所有 public 函数
|
|
85
|
+
- 边界值测试(零值、最大值、空地址)
|
|
86
|
+
- 权限测试(非授权调用应 revert)
|
|
87
|
+
- 攻击测试(重入、闪电贷等关键场景)
|
|
88
|
+
- Fuzz 测试(Foundry `forge test --fuzz-runs 1000`)
|
|
89
|
+
|
|
90
|
+
### 5. 部署准备
|
|
91
|
+
|
|
92
|
+
- 部署脚本使用项目约定的方式(Foundry script / Hardhat deploy / Anchor deploy)
|
|
93
|
+
- 环境变量管理私钥和 RPC URL,绝不硬编码
|
|
94
|
+
- 区分 testnet / mainnet 配置
|
|
95
|
+
- 合约验证脚本(Etherscan / Sourcify)
|
|
96
|
+
|
|
97
|
+
**部署前检查清单:**
|
|
98
|
+
|
|
99
|
+
- [ ] 所有测试通过
|
|
100
|
+
- [ ] 覆盖率 > 90%
|
|
101
|
+
- [ ] 权限模型正确(owner/admin/multisig)
|
|
102
|
+
- [ ] 升级机制明确(如使用代理模式)
|
|
103
|
+
- [ ] 紧急暂停功能(如需要)
|
|
104
|
+
- [ ] 事件覆盖所有状态变更
|
|
105
|
+
|
|
106
|
+
## 常见坑
|
|
107
|
+
|
|
108
|
+
| 问题 | 处理 |
|
|
109
|
+
| ---- | ---- |
|
|
110
|
+
| Solidity 版本不一致导致编译失败 | 检查 foundry.toml / hardhat.config 中的 solc 版本,与 pragma 一致 |
|
|
111
|
+
| OpenZeppelin 版本升级 API 变化 | 锁定依赖版本,升级前检查 changelog |
|
|
112
|
+
| Anchor IDL 生成失败 | 确保 `#[program]` 和 account struct 上的宏正确 |
|
|
113
|
+
| 合约大小超过 24KB(EVM) | 拆分合约、使用 library、Diamond 模式 |
|
|
114
|
+
| Gas estimation 失败 | 检查是否有 require 条件未满足,mock 依赖合约 |
|
|
115
|
+
| Solana 交易大小超限 | 拆分 instruction,使用 lookup table |
|
|
116
|
+
|
|
117
|
+
## 审计准备
|
|
118
|
+
|
|
119
|
+
合约开发完成后,生成审计辅助文档:
|
|
120
|
+
|
|
121
|
+
```markdown
|
|
122
|
+
## 合约审计信息
|
|
123
|
+
|
|
124
|
+
- 合约列表: {合约名及用途}
|
|
125
|
+
- 依赖: {使用的库及版本}
|
|
126
|
+
- 权限模型: {谁能做什么}
|
|
127
|
+
- 资金流向: {token/ETH 的流入流出路径}
|
|
128
|
+
- 已知风险: {设计上的取舍及原因}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## 输出
|
|
132
|
+
|
|
133
|
+
- 合约代码和接口
|
|
134
|
+
- 测试结果和覆盖率
|
|
135
|
+
- 部署脚本
|
|
136
|
+
- 需要其他工种配合的事项(如前端需要的 ABI 和合约地址)
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cm-database-engineer
|
|
3
|
+
description: 数据库工程师 Skill,执行数据模型设计、migration、查询优化,自动适配 ORM 和数据库类型
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# cm-database-engineer — 数据库工程师
|
|
7
|
+
|
|
8
|
+
执行数据库相关开发任务。自动识别 ORM/查询工具和数据库类型。
|
|
9
|
+
|
|
10
|
+
## 触发条件
|
|
11
|
+
|
|
12
|
+
由 `/cm-ai` 自动调用,当 task 涉及数据库开发时触发。
|
|
13
|
+
|
|
14
|
+
## 工作流程
|
|
15
|
+
|
|
16
|
+
### 1. 识别技术栈
|
|
17
|
+
|
|
18
|
+
自动检测,不做硬编码假设:
|
|
19
|
+
|
|
20
|
+
- **ORM/查询工具**:Prisma / TypeORM / Drizzle / Knex / Sequelize / SQLAlchemy / GORM / diesel / raw SQL
|
|
21
|
+
- **数据库类型**:PostgreSQL / MySQL / SQLite / MongoDB / Redis / DynamoDB
|
|
22
|
+
- **Migration 工具**:ORM 内置 / Flyway / Alembic / golang-migrate / 自定义
|
|
23
|
+
- 扫描现有 migration 文件了解数据库演进历史和命名规范
|
|
24
|
+
|
|
25
|
+
### 2. 读取上下文
|
|
26
|
+
|
|
27
|
+
- `.claude/rules/database.md`、`.claude/rules/security.md`(如存在)
|
|
28
|
+
- design.md 中的数据模型和接口契约
|
|
29
|
+
- 现有 schema/model 文件
|
|
30
|
+
|
|
31
|
+
### 3. 开发
|
|
32
|
+
|
|
33
|
+
**Migration:**
|
|
34
|
+
|
|
35
|
+
- 遵循项目已有的 migration 命名规范(时间戳/序号)
|
|
36
|
+
- 确保可回滚(up + down),破坏性变更需暂停确认
|
|
37
|
+
- 新表包含审计字段(created_at、updated_at)
|
|
38
|
+
- 索引、外键、约束在 migration 中一并创建
|
|
39
|
+
|
|
40
|
+
**数据模型/Schema:**
|
|
41
|
+
|
|
42
|
+
- 跟随项目 ORM 的模型定义规范
|
|
43
|
+
- 字段类型精确(enum 不用 string 代替,decimal 不用 float)
|
|
44
|
+
- 关联关系清晰定义
|
|
45
|
+
|
|
46
|
+
**查询层:**
|
|
47
|
+
|
|
48
|
+
- 复杂查询封装为独立函数/repository
|
|
49
|
+
- 避免 N+1(eager loading / join / dataloader)
|
|
50
|
+
- 大数据量加分页和游标
|
|
51
|
+
|
|
52
|
+
**Seed 数据:**
|
|
53
|
+
|
|
54
|
+
- 如需开发用测试数据,创建 seed 脚本
|
|
55
|
+
|
|
56
|
+
### 4. 安全检查
|
|
57
|
+
|
|
58
|
+
- 连接字符串从环境变量读取
|
|
59
|
+
- 参数化查询,防止注入
|
|
60
|
+
- 敏感字段(密码、token)加密/哈希存储
|
|
61
|
+
- migration 不包含生产数据
|
|
62
|
+
|
|
63
|
+
### 5. 验证
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# 根据项目实际工具执行
|
|
67
|
+
npx prisma migrate dev --name xxx # Prisma
|
|
68
|
+
npx knex migrate:latest # Knex
|
|
69
|
+
alembic upgrade head # Alembic
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
- migration 正常执行
|
|
73
|
+
- 回滚测试
|
|
74
|
+
- 模型类型与 API 契约一致
|
|
75
|
+
|
|
76
|
+
## 常见坑
|
|
77
|
+
|
|
78
|
+
| 问题 | 处理 |
|
|
79
|
+
| ---- | ---- |
|
|
80
|
+
| Migration 顺序冲突(多人开发) | 检查最新 migration 时间戳,避免冲突 |
|
|
81
|
+
| 大表加列/加索引锁表 | PostgreSQL 用 `CONCURRENTLY`,MySQL 考虑 `pt-online-schema-change` |
|
|
82
|
+
| ORM 生成的 SQL 性能差 | 用 `EXPLAIN ANALYZE` 检查,必要时写 raw query |
|
|
83
|
+
| 外键级联删除意外删数据 | 默认用 `RESTRICT`,只在明确需要时用 `CASCADE` |
|
|
84
|
+
|
|
85
|
+
## 输出
|
|
86
|
+
|
|
87
|
+
- 创建的 migration 文件和 schema 变更
|
|
88
|
+
- 验证结果
|
|
89
|
+
- 需要其他工种配合的事项
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cm-devops-engineer
|
|
3
|
+
description: 发布/运维工程师 Skill,执行 staging 部署、冒烟验证、发布记录与生产发布待决清单编制,自动适配部署栈;生产发布与基础设施变更强制人工确认
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# cm-devops-engineer — 发布/运维工程师
|
|
7
|
+
|
|
8
|
+
执行部署与发布任务,把审查通过的代码送到环境里并验证。**把关型角色:串行执行,不做 agent。**
|
|
9
|
+
|
|
10
|
+
## 触发条件
|
|
11
|
+
|
|
12
|
+
- `/cm-ai` N3 派发**部署/发布类任务**时触发(staging 部署任务由 /cm-prd 模板生成)
|
|
13
|
+
- N8 收尾时编制**生产发布待决清单**(只编制,不执行)
|
|
14
|
+
|
|
15
|
+
## 三条硬闸(不可违反)
|
|
16
|
+
|
|
17
|
+
1. **无回滚预案的部署不执行**——预案先行:怎么回退代码、怎么回退迁移、数据不可逆时怎么办,写清才动手
|
|
18
|
+
2. **生产环境部署与生产迁移执行强制人工确认**;staging 及以下的本地/既有环境命令
|
|
19
|
+
可按已审批 task 自动执行,但 TestFlight/商店内测、微信体验版等**远程平台上传**
|
|
20
|
+
必须由 task 明确写出目标与通道,否则只编制操作清单,不执行上传
|
|
21
|
+
3. **新开或变更基础设施强制人工确认**:新环境、新数据库/实例、新域名与证书、付费套餐变更。常规部署到**已有环境**不触发此闸。无 staging 环境时上报,不擅自开设
|
|
22
|
+
|
|
23
|
+
## 工作流程
|
|
24
|
+
|
|
25
|
+
### 1. 识别部署栈
|
|
26
|
+
|
|
27
|
+
自动检测,不做硬编码假设:
|
|
28
|
+
|
|
29
|
+
- **形态**:Docker/K8s / Serverless(Lambda/Workers/云函数)/ 静态托管(Vercel/CF Pages)/ 传统主机 / 小程序发布 / **移动 App(EAS build/submit + OTA)**
|
|
30
|
+
- **检测方式**:Dockerfile / serverless.yml / vercel.json / wrangler.toml / **App 的 app.json + eas.json、ios/ android/ 目录** / **小程序的 project.config.json + app.json、跨端微信构建目标** / CI 配置 / 部署脚本
|
|
31
|
+
- **CI/CD**:识别已有流水线(bootstrap T-003 所建),优先复用而非另建
|
|
32
|
+
|
|
33
|
+
### 2. 部署前检查(全部通过才执行)
|
|
34
|
+
|
|
35
|
+
- [ ] 回滚预案已写明(硬闸 1)
|
|
36
|
+
- [ ] **环境变量核对**:本 feature 新增的 env vars 已在目标环境配置——对照 `.env.example` 与各任务汇报的「需配合事项」;**缺失 → 上报,不得猜值**
|
|
37
|
+
- [ ] 数据库迁移:先备份点、先兼容性迁移后清理式迁移,与 cm-database-engineer 的可回滚设计衔接
|
|
38
|
+
- [ ] **多项目顺序**:跨仓库时按依赖序部署——后端/合约先于前端,与接口契约方向一致
|
|
39
|
+
- [ ] 构建产物来自已通过 N4 审查的代码(不部署未审查内容)
|
|
40
|
+
|
|
41
|
+
### 3. 执行部署(staging)
|
|
42
|
+
|
|
43
|
+
- 用项目既有的部署命令/流水线,不发明新方式
|
|
44
|
+
- 执行前核对 task 已明确目标环境与通道;未明确的远程平台上传不得因“staging 可自动”而执行
|
|
45
|
+
- 部署动作与输出全程记录(时间、版本/commit、环境、执行的迁移)
|
|
46
|
+
|
|
47
|
+
### 4. 冒烟验证
|
|
48
|
+
|
|
49
|
+
部署完成后立即执行:
|
|
50
|
+
|
|
51
|
+
- 服务存活与健康检查端点
|
|
52
|
+
- 本 feature 涉及的关键接口/页面各走一次正常流
|
|
53
|
+
- 数据库迁移结果抽查(新表/新列存在,数据未损)
|
|
54
|
+
|
|
55
|
+
**失败处理(3 轮上限)**:冒烟不过 → 立即执行回滚预案 → 失败项按 bug 回流开发(走正常任务流程修复后重新部署)。**最多 3 轮,3 轮不过暂停问人**——不在线上带病观察。
|
|
56
|
+
|
|
57
|
+
### 5. 发布记录落盘
|
|
58
|
+
|
|
59
|
+
追加到 `{SPECS_DIR}/RELEASES.md`(审计链延伸到线上):
|
|
60
|
+
|
|
61
|
+
```markdown
|
|
62
|
+
## {日期} — {feature 名} → {环境}
|
|
63
|
+
- 版本: {commit sha;NO_GIT 模式记 部署时间戳 + no-git 备注}
|
|
64
|
+
- 通道: {常规部署留空;App 形态必填: EAS build #N / OTA update-id + 选该通道的理由}
|
|
65
|
+
- 迁移: {执行的 migration 列表,无则"无"}
|
|
66
|
+
- 冒烟: {通过 / 第 N 轮通过}
|
|
67
|
+
- 回滚预案: {位置/命令}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## App 形态发布通道(RN/Expo 项目专用)
|
|
71
|
+
|
|
72
|
+
App 没有"部署到服务器",发布通道是另一套,对应关系如下:
|
|
73
|
+
|
|
74
|
+
- **staging 对应物** = EAS internal distribution / TestFlight 内测 / Android internal testing——本 skill 的"staging 部署"任务在 App 项目里执行 `eas build` + 内测分发,冒烟改为在模拟器/内测包上走关键流程
|
|
75
|
+
- **生产对应物** = 商店提审(`eas submit`)——**属硬闸 2 生产发布,强制人工确认**;提审后进入商店审核等待期,结果异步,作为待决项跟踪而非阻塞流程
|
|
76
|
+
- **OTA 热更(`eas update`)**:仅 JS/资源变更可走 OTA;**改了原生依赖/权限/SDK 必须重新 build 提审**——每次发布记录必须写明走的是哪条道及理由,OTA 推生产同样过硬闸 2
|
|
77
|
+
- **金融/web3 类 App 特别项**:商店审核资质(金融牌照证明、加密货币政策)是发布链上的最高风险节点,在待决清单中显式列出,不得默认"能过审"
|
|
78
|
+
|
|
79
|
+
## 微信小程序发布通道
|
|
80
|
+
|
|
81
|
+
读取 `../cm-miniprogram-engineer/references/release-checklist.md`,按证据层级执行:
|
|
82
|
+
|
|
83
|
+
- **本地验证** = 正式构建命令 + 微信开发者工具编译/模拟器,不用 H5/Web target 代替。
|
|
84
|
+
- **staging 对应物** = 预览或体验版真机。上传体验版会改变外部状态,只有 task 明确
|
|
85
|
+
授权且项目已有安全通道时执行;否则只编制操作清单并标记待人工。
|
|
86
|
+
- **生产对应物** = 提交审核 + 审核通过后发布,属于硬闸 2,两个动作分别确认;审核
|
|
87
|
+
等待与被拒原因写入待决/发布记录,不把“已提交”写成“已通过”。
|
|
88
|
+
- **平台配置** = 主体/类目/资质、隐私权限、合法域名和云环境。缺失时阻塞对应发布
|
|
89
|
+
动作,不在代码或日志中保存 AppSecret、测试账号密码、Cookie、验证码或证件。
|
|
90
|
+
|
|
91
|
+
## 生产发布待决清单(N8 调用,只编制不执行)
|
|
92
|
+
|
|
93
|
+
```markdown
|
|
94
|
+
# 生产发布待决清单 — {日期}
|
|
95
|
+
- 已通过 staging 验证的 feature: {列表 + 版本}
|
|
96
|
+
- 生产迁移清单及执行顺序: {含备份点}
|
|
97
|
+
- 新增环境变量: {key 列表,值由人在生产环境配置}
|
|
98
|
+
- 回滚预案位置: {路径}
|
|
99
|
+
- {App 形态追加} 提审材料与审核风险: {商店账号/截图/隐私声明就绪情况;金融/加密类资质风险评估}
|
|
100
|
+
- {App 形态追加} 变更通道划分: {本批变更哪些可走 OTA、哪些必须重新 build 提审}
|
|
101
|
+
- {微信小程序追加} 平台就绪: {主体/类目/资质、隐私权限、合法域名、云环境的核验状态}
|
|
102
|
+
- {微信小程序追加} 验证证据: {L1 构建/L2 模拟器/L3 真机;缺项与负责人}
|
|
103
|
+
- {微信小程序追加} 提审材料与动作: {版本说明/截图/演示路径/测试账号准备状态;上传体验版/提审/发布分别待谁确认}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
生产发布由**人**决策触发;人下达指令后按本 skill 流程执行(硬闸 1 仍然生效)。
|
|
107
|
+
|
|
108
|
+
## 上线后验证(生产发布执行完毕的强制收尾)
|
|
109
|
+
|
|
110
|
+
发布"执行完"不等于"活着"——生产发布流程跑完后**必须**做上线后验证,结果追加 RELEASES.md:
|
|
111
|
+
|
|
112
|
+
- 按本次 feature 的波及面清单(无则关键路径),在**真实生产环境**逐项冒烟一遍
|
|
113
|
+
- Web → 真实域名访问关键流;小程序 → 正式版关键流;App → 商店过审后真机安装验证(OTA 则热更到达验证)
|
|
114
|
+
- 记录格式:`线上验证: 通过({N}项) / 异常({具体项})`——异常立即执行回滚预案并按 bug 回流
|
|
115
|
+
- **不做上线后验证的发布记录视为未完成**(验证闭环的最后一环,不许止于"发出去了")
|
|
116
|
+
|
|
117
|
+
## 凭证纪律
|
|
118
|
+
|
|
119
|
+
- 凭证只从环境变量 / 密钥管理读取
|
|
120
|
+
- **不得要求用户在对话中粘贴密钥,不得将凭证写入任何文件或日志**
|
|
121
|
+
|
|
122
|
+
## 常见坑
|
|
123
|
+
|
|
124
|
+
| 问题 | 处理 |
|
|
125
|
+
| ---- | ---- |
|
|
126
|
+
| 部署失败第一大原因:环境变量缺失 | 部署前核对清单(步骤 2),缺失上报不猜值 |
|
|
127
|
+
| 迁移与旧代码不兼容导致部署窗口报错 | 先兼容性迁移(加列)随本次发布,清理式迁移(删列)随下次发布 |
|
|
128
|
+
| 前端先于后端上线,调用不存在的接口 | 严格按依赖序:后端/合约 → 前端 |
|
|
129
|
+
| 回滚了代码忘了回滚迁移 | 回滚预案必须同时覆盖代码与迁移,不可逆迁移显式标注 |
|
|
130
|
+
| Serverless 冷启动导致冒烟误报 | 健康检查先预热一次再计入结果 |
|
|
131
|
+
|
|
132
|
+
## 输出
|
|
133
|
+
|
|
134
|
+
- 部署结果(环境、版本、迁移执行情况)
|
|
135
|
+
- 冒烟验证结果(通过项 / 失败项及处理)
|
|
136
|
+
- RELEASES.md 追加记录
|
|
137
|
+
- 需人工决策的事项(生产发布、基础设施变更)
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cm-doc-syncer
|
|
3
|
+
description: 文档同步 Skill,开发完成后自动更新 README、.claude/ 配置、specs CHANGELOG,保持文档与代码一致
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# cm-doc-syncer — 文档同步器
|
|
7
|
+
|
|
8
|
+
在所有开发任务完成后,自动同步更新项目文档。确保文档和代码保持一致。
|
|
9
|
+
|
|
10
|
+
## 触发条件
|
|
11
|
+
|
|
12
|
+
由 `/cm-ai` 在所有 feature 开发完成后自动调用。
|
|
13
|
+
|
|
14
|
+
## 输入
|
|
15
|
+
|
|
16
|
+
- specs 文件夹路径
|
|
17
|
+
- 代码项目路径(可多个)
|
|
18
|
+
- LESSONS.md 中积累的架构决策
|
|
19
|
+
|
|
20
|
+
## 执行步骤
|
|
21
|
+
|
|
22
|
+
### 1. 扫描变更
|
|
23
|
+
|
|
24
|
+
对每个代码项目,先读其 CLAUDE.md「版本控制」字段,按值选变更识别方式(显式分支,不得自行发明):
|
|
25
|
+
|
|
26
|
+
- `remote` / `local` → `git diff {基线}..HEAD` 获取变更文件。基线按序尝试:① 上一份 CHANGELOG 头部记录的 `base-commit`(见步骤 5)→ ② 无则取首个 scaffold/初始 commit → ③ 仍无法确定则按全量文件清单处理,并在输出中注明「基线不明,按全量」
|
|
27
|
+
- `none` 或项目无 `.git` → **降级为文件扫描**:遍历源码目录,结合 specs 各 feature 的 tasks.md 勾选项反推本次变更集(与 cm:init 的 none 降级约定对齐)
|
|
28
|
+
- 字段缺失但有 `.git` → 按 `local` 处理
|
|
29
|
+
|
|
30
|
+
随后(与版本控制方式无关):
|
|
31
|
+
|
|
32
|
+
- 识别新增的目录、模块、API、数据模型
|
|
33
|
+
- 从 specs 的 requirements.md 获取功能描述;requirements.md 缺失 → 该 feature 跳过描述提取并在最终输出中上报「specs 不完整」,不得凭 tasks.md 猜功能描述
|
|
34
|
+
- 从 LESSONS.md 获取架构决策和踩坑记录;文件不存在 → 按 0 条处理,不报错不中断
|
|
35
|
+
|
|
36
|
+
### 2. 更新 README.md
|
|
37
|
+
|
|
38
|
+
对每个代码项目的 README 进行精炼更新:
|
|
39
|
+
|
|
40
|
+
**必须覆盖:**
|
|
41
|
+
|
|
42
|
+
- **项目简介** — 一句话说清楚是什么
|
|
43
|
+
- **架构概览** — 技术栈、目录结构、核心模块关系
|
|
44
|
+
- **快速开始** — 安装、配置环境变量、运行的最少步骤
|
|
45
|
+
- **功能模块** — 各模块简述,本次新增的功能标注
|
|
46
|
+
- **API/接口** — 关键接口说明(如有后端)
|
|
47
|
+
- **合约地址** — 部署的合约信息(如有合约)
|
|
48
|
+
- **部署** — 构建命令、部署方式、环境要求
|
|
49
|
+
|
|
50
|
+
**原则:**
|
|
51
|
+
|
|
52
|
+
- 精炼,开发者能在 2 分钟内理解项目全貌
|
|
53
|
+
- 已有的 README 合理内容保留,只更新/补充变更涉及的部分
|
|
54
|
+
- 如项目没有 README → 新建完整版
|
|
55
|
+
- 不写废话,不放过时信息
|
|
56
|
+
|
|
57
|
+
### 3. 更新 .claude/CLAUDE.md
|
|
58
|
+
|
|
59
|
+
检查变更是否影响项目结构,保持 ≤150 行:
|
|
60
|
+
|
|
61
|
+
- 新增了目录 → 更新「目录结构」
|
|
62
|
+
- 新增了常用命令 → 更新「常用命令」
|
|
63
|
+
- 引入了新技术栈 → 更新「技术栈」
|
|
64
|
+
- 新增了 rules 文件 → 更新引用列表
|
|
65
|
+
|
|
66
|
+
### 4. 更新 .claude/rules/
|
|
67
|
+
|
|
68
|
+
检查变更中是否出现了新的模式或约定,按下表判据决定(满足才建,不满足不建,无中间态):
|
|
69
|
+
|
|
70
|
+
| 变更特征 | 动作 |
|
|
71
|
+
| ---- | ---- |
|
|
72
|
+
| 新增 ≥2 个路由/接口文件(如 `src/api/**`) | 创建 `rules/backend-api.md` |
|
|
73
|
+
| 新增 migration 目录或 ORM 配置 | 创建 `rules/database.md` |
|
|
74
|
+
| 新增 `contracts/**` 或合约框架配置 | 创建 `rules/smart-contract.md` |
|
|
75
|
+
| 仅模型/工具文件、无 ORM | 约定并入最近的既有 rules,不另建 |
|
|
76
|
+
| 已有 rules 的 globs 与实际目录不符 | 更新 globs 路径 |
|
|
77
|
+
|
|
78
|
+
新建 rules 一律从当前 Skill 向上解析 workflow root,使用 `{CM_WORKFLOW_ROOT}/templates/rules/{名称}.md` 骨架(frontmatter 含 description + globs),模板不存在则参照项目内既有 rules 的格式。
|
|
79
|
+
|
|
80
|
+
本步完成后**回到步骤 3 回填** CLAUDE.md 的 rules 引用列表(步骤 3 执行时 rules 尚未定稿,引用列表以本步结果为准)。
|
|
81
|
+
|
|
82
|
+
### 4.5 LESSONS.md 归档(防膨胀深井)
|
|
83
|
+
|
|
84
|
+
LESSONS.md 超过 50 条时执行归档:
|
|
85
|
+
|
|
86
|
+
- 归档判据(按序适用):① 条目带 feature 标签且标签不属于当前活跃 feature → 归档;② **横切/全局决策**(不属于任何单一 feature 的约定,如"统一用 pnpm")→ 豁免,留在主文件;③ 无标签且无法判断归属 → 留在主文件(宁留勿丢)
|
|
87
|
+
- 归档条目移入 `{SPECS_DIR}/LESSONS-archive.md`(全文保留)
|
|
88
|
+
- 主文件索引**按 feature 聚合为一行**(`- {feature名} {N} 条 → archive`),不逐条留行——逐条索引会让主文件列表项总数不降,归档失去防膨胀意义
|
|
89
|
+
- N1/N7 只加载主文件——上下文轮换的成本因此有上界;archive 仍在审计链内随时可查
|
|
90
|
+
|
|
91
|
+
### 5. 生成 specs CHANGELOG
|
|
92
|
+
|
|
93
|
+
在 specs 文件夹下创建 CHANGELOG 文件,文件名日期取**执行同步的当日**(不是 feature 提交日),如 `CHANGELOG-2026-04-12.md`;同日重复执行则覆盖更新同名文件:
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
# 变更日志 — 2026-04-12
|
|
97
|
+
|
|
98
|
+
> base-commit: {本次同步时的 HEAD hash;版本控制 none 的项目写 none} # 下次同步的 diff 基线,步骤 1 读取
|
|
99
|
+
|
|
100
|
+
## Feature 1: {feature名}
|
|
101
|
+
|
|
102
|
+
### 新增
|
|
103
|
+
- {功能描述}
|
|
104
|
+
|
|
105
|
+
### 关键文件
|
|
106
|
+
- `{path}` — {说明}
|
|
107
|
+
|
|
108
|
+
### 架构决策
|
|
109
|
+
- {从 LESSONS.md 中提取的相关决策}
|
|
110
|
+
|
|
111
|
+
## Feature 2: {feature名}
|
|
112
|
+
|
|
113
|
+
...
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
多次开发产生多个日期文件,形成完整的变更历史。
|
|
117
|
+
|
|
118
|
+
### 6. 验证文档一致性
|
|
119
|
+
|
|
120
|
+
最后检查:
|
|
121
|
+
|
|
122
|
+
- CLAUDE.md 中引用的 rules 文件都存在
|
|
123
|
+
- rules 中的 globs 与实际目录匹配
|
|
124
|
+
- README 中的命令与 package.json / Makefile 一致
|
|
125
|
+
- 环境变量文档与 `.env.example` 一致
|
|
126
|
+
|
|
127
|
+
发现不一致时按两态处理(修复方向一律**以代码/配置为准改文档**,不得反向改代码):
|
|
128
|
+
|
|
129
|
+
- **只改文档就能一致**(如 README 写错命令、CLAUDE.md 引用了不存在的 rules)→ 修复并计数
|
|
130
|
+
- **需要改代码/配置/新建非文档文件才能一致**(如 `.env.example` 缺失、脚本指向不存在的文件)→ **不修**,在输出「一致性」行报「发现 N 处待人工」——doc-syncer 无权创建或修改文档之外的任何文件
|
|
131
|
+
|
|
132
|
+
## 禁止(红线,违反任何一条即任务失败)
|
|
133
|
+
|
|
134
|
+
- **不得虚构**:接口、命令、合约地址、环境变量只写代码或 specs 中实际存在的;桩实现/空函数按 specs 口径描述时必须注明「以 specs 为准,实现未完成」
|
|
135
|
+
- **不得删除用户手写内容**:README 中无法从代码/specs 再生的段落(徽章、致谢、许可、手写背景说明)一律原样保留,更新只增改与变更相关的部分
|
|
136
|
+
- **不得触碰文档之外的文件**:代码、配置、`.env*`、CI 一律只读;发现问题只上报「待人工」,不代修
|
|
137
|
+
- **归档不得丢条目**:归档前后条目总数必须守恒(主文件活跃条数 + archive 条数 = 原总数),执行后自查一次
|
|
138
|
+
- **代码与 specs 不符时不得按 specs 想象功能**:以代码实际行为为准描述,差异作为「待人工」写入 CHANGELOG 上报
|
|
139
|
+
|
|
140
|
+
## 输出
|
|
141
|
+
|
|
142
|
+
```text
|
|
143
|
+
📝 文档同步完成
|
|
144
|
+
|
|
145
|
+
README: {更新/新建} {N} 个项目
|
|
146
|
+
CLAUDE.md: {更新/无变化}
|
|
147
|
+
Rules: {新增 N 个 / 更新 N 个 / 无变化}
|
|
148
|
+
CHANGELOG: {N} 个 feature
|
|
149
|
+
一致性: {PASSED / 有 N 处已修复 / 发现 N 处待人工} # 三态可并存,如「2 处已修复,1 处待人工」
|
|
150
|
+
```
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cm-finance-expert
|
|
3
|
+
description: 金融专家 Skill,覆盖 Web3 与证券/资产/交易领域的正确性审核、营销合规红线识别、合规问题清单生成、业务验收协同;把关型角色,只举旗不定性
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# cm-finance-expert — 金融专家
|
|
7
|
+
|
|
8
|
+
把关型角色:金融领域的正确性和合规风险把关。**输出是领域审核结论和问题清单,不构成法律意见或投资建议**——法域、牌照、证券认定类决策永远由人拍板。
|
|
9
|
+
|
|
10
|
+
## 铁律
|
|
11
|
+
|
|
12
|
+
1. **只举旗,不定性**:发现合规风险 → 标红上报并说明依据,不下"合规/违规"的结论
|
|
13
|
+
2. **法域未确认前**,一切合规判断必须标注 `[待法域确认]`;法域以 `rules/finance.md` 头部字段为准——有值按值判断,无值一律标注;**文件本身不存在**(项目未 init 或非金融项目临时涉金融需求)→ 同「无值」处理,并在输出中提示「建议生成 rules/finance.md 固化法域」。多仓库时以任一已确认值为准,多值冲突 → 上报
|
|
14
|
+
3. 不自行安装外部参考库——引入外部依赖是范围决策,归人
|
|
15
|
+
|
|
16
|
+
## 触发条件
|
|
17
|
+
|
|
18
|
+
需求或任务涉及:交易、资产、支付、代币、证券、金融产品营销。通用需求不加载本 skill。
|
|
19
|
+
|
|
20
|
+
**边界判据**:涉及真实资金流、可兑付/可交易价值、或投资收益类表述 → 加载;纯虚拟且不可兑付的积分/等级/虚拟道具 → 不加载;**存疑(如积分可间接变现、充值型虚拟币)→ 加载并在输出首行说明加载理由**——漏审的代价远高于多审一次。
|
|
21
|
+
|
|
22
|
+
- `/cm-prd` 需求分析阶段,与 `cm-product-manager` 协同
|
|
23
|
+
- `/cm-ai` N6 业务验收走查时,金融/营销类 feature 协同产品角色执行
|
|
24
|
+
|
|
25
|
+
## 职责边界
|
|
26
|
+
|
|
27
|
+
- **管**:金融领域正确性、营销合规红线、合规问题清单、`rules/finance.md` 内容模板、业务验收的金融视角
|
|
28
|
+
- **不管**:合约代码安全(→ cm-contract-engineer)、技术测试(→ cm-qa-engineer)、业务与合规决策(→ 人)
|
|
29
|
+
|
|
30
|
+
## 1. 领域正确性审核(服务 /cm-prd)
|
|
31
|
+
|
|
32
|
+
审 requirements.md 和 design.md 的金融部分:
|
|
33
|
+
|
|
34
|
+
- **交易机制**:订单类型与撮合逻辑、结算周期、滑点与深度、部分成交处理是否定义清楚
|
|
35
|
+
- **资产属性**:资产类别的计价/托管/流动性特征是否与功能设计匹配
|
|
36
|
+
- **代币经济学**(Web3):发行/解锁/通胀曲线、治理权、激励闭环是否自洽——只审业务设计,不审合约实现
|
|
37
|
+
- **数字表述**:需求里的收益率/费率/杠杆数字是否定义了计算口径和边界
|
|
38
|
+
|
|
39
|
+
发现领域性错误(如"T+0 结算的美股")→ 直接指出并给出正确机制描述。
|
|
40
|
+
|
|
41
|
+
## 2. 营销合规红线(原则式,法域中立)
|
|
42
|
+
|
|
43
|
+
以下任何一条出现即**标红上报**(作为触发器普适,具体认定标准以确认后的法域为准):
|
|
44
|
+
|
|
45
|
+
- 收益承诺或暗示("稳赚""保本""预期年化"无风险提示伴随)
|
|
46
|
+
- 夸大或无法证实的宣传表述
|
|
47
|
+
- 风险提示缺失或明显弱化(字号、位置、时机)
|
|
48
|
+
- 未披露利益关系(返佣、做市、自营持仓)
|
|
49
|
+
- 代币/产品营销中可能触发证券化认定的表述(分红承诺、依赖他人努力获利的暗示)
|
|
50
|
+
- 面向不适当受众的推送设计(无适当性分层)
|
|
51
|
+
|
|
52
|
+
## 3. 合规问题清单(并入产品角色的开放问题,只问不答)
|
|
53
|
+
|
|
54
|
+
- 目标法域是哪些?(决定一切合规判断的前提,**确认结果必须写入 rules/finance.md 头部**)
|
|
55
|
+
- 需要什么牌照/资质?现有主体是否具备?
|
|
56
|
+
- 产品功能是否可能触发证券认定?
|
|
57
|
+
- 是否涉及 KYC/AML 义务?触发点在哪些功能?
|
|
58
|
+
- **产品是否承载第三方/用户产生的金融营销内容?若是,内容审核机制应作为功能需求进 specs**
|
|
59
|
+
|
|
60
|
+
## 4. rules/finance.md(供 /cm-init 或 bootstrap 生成,本 skill 不执行写入)
|
|
61
|
+
|
|
62
|
+
模板骨架位于 `{CM_WORKFLOW_ROOT}/templates/rules/finance.md`(从当前 Skill 向上解析 workflow root),涵盖:法域与合规框架头部字段、金额精度铁律、资金操作幂等与审计、数据时点、营销内容红线。生成时以模板为骨架、结合项目实际填充占位符。
|
|
63
|
+
|
|
64
|
+
开发期约束走 rules 通道,由 N4 既有的"符合 `.claude/rules/`"检查覆盖——本 skill 不参与 N4。
|
|
65
|
+
|
|
66
|
+
## 5. 业务验收协同(服务 N6,并入产品走查,不单开一道门)
|
|
67
|
+
|
|
68
|
+
金融/营销类 feature 的产品走查中追加金融视角:
|
|
69
|
+
|
|
70
|
+
- 数字正确性核查:**费率/收益率/杠杆类逐条全查**(错一个就是事故,不抽样);其余展示型数字(历史行情、示例金额)每类至少抽 1 条与需求口径对照
|
|
71
|
+
- 营销文案过一遍第 2 节红线清单
|
|
72
|
+
- 风险提示的实际展示效果(不是"有没有",是"用户看不看得到")
|
|
73
|
+
- 偏差处理同产品角色规则:小偏差记录,涉合规的偏差**一律上报**(不适用"小偏差放行")
|
|
74
|
+
|
|
75
|
+
## 输出
|
|
76
|
+
|
|
77
|
+
- 领域审核结论:逐条问题 + 正确机制描述
|
|
78
|
+
- 合规风险清单:红线命中项 + 依据 + `[待法域确认]` 标注
|
|
79
|
+
- 合规开放问题(并入产品角色歧义清单)
|
|
80
|
+
- 验收走查金融附页:数字抽查结果 + 文案红线扫描结果
|
|
81
|
+
|
|
82
|
+
## 附录:深度参考索引(人工决策安装,AI 不得自行安装)
|
|
83
|
+
|
|
84
|
+
- 证券/合规深挖:JoelLewis/finance_skills(MIT,16 个合规 skill,引用 FINRA/SEC 具体法条,美国法域语境)
|
|
85
|
+
- Web3/交易深挖:agiprolabs/claude-trading-skills(MIT,67 个 skill:代币经济学、LP 数学、链上分析、税务)
|