forgecraft-mcp 1.4.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +67 -0
- package/README.md +527 -525
- package/dist/analyzers/anchors/anchor-loader.d.ts +47 -0
- package/dist/analyzers/anchors/anchor-loader.d.ts.map +1 -0
- package/dist/analyzers/anchors/anchor-loader.js +113 -0
- package/dist/analyzers/anchors/anchor-loader.js.map +1 -0
- package/dist/analyzers/anti-pattern.d.ts.map +1 -1
- package/dist/analyzers/anti-pattern.js +38 -26
- package/dist/analyzers/anti-pattern.js.map +1 -1
- package/dist/analyzers/completeness-helpers.d.ts +5 -0
- package/dist/analyzers/completeness-helpers.d.ts.map +1 -1
- package/dist/analyzers/completeness-helpers.js +17 -0
- package/dist/analyzers/completeness-helpers.js.map +1 -1
- package/dist/analyzers/completeness.d.ts.map +1 -1
- package/dist/analyzers/completeness.js +4 -4
- package/dist/analyzers/completeness.js.map +1 -1
- package/dist/analyzers/gs-scorer.d.ts +3 -1
- package/dist/analyzers/gs-scorer.d.ts.map +1 -1
- package/dist/analyzers/gs-scorer.js +5 -2
- package/dist/analyzers/gs-scorer.js.map +1 -1
- package/dist/analyzers/package-json.d.ts.map +1 -1
- package/dist/analyzers/package-json.js +194 -34
- package/dist/analyzers/package-json.js.map +1 -1
- package/dist/analyzers/scorers/composable-scorer.d.ts +4 -2
- package/dist/analyzers/scorers/composable-scorer.d.ts.map +1 -1
- package/dist/analyzers/scorers/composable-scorer.js +50 -2
- package/dist/analyzers/scorers/composable-scorer.js.map +1 -1
- package/dist/analyzers/scorers/executable-scorer.d.ts +3 -2
- package/dist/analyzers/scorers/executable-scorer.d.ts.map +1 -1
- package/dist/analyzers/scorers/executable-scorer.js +64 -4
- package/dist/analyzers/scorers/executable-scorer.js.map +1 -1
- package/dist/analyzers/scorers/scorer-utils.d.ts +5 -3
- package/dist/analyzers/scorers/scorer-utils.d.ts.map +1 -1
- package/dist/analyzers/scorers/scorer-utils.js +34 -9
- package/dist/analyzers/scorers/scorer-utils.js.map +1 -1
- package/dist/analyzers/scorers/self-describing-scorer.d.ts +7 -4
- package/dist/analyzers/scorers/self-describing-scorer.d.ts.map +1 -1
- package/dist/analyzers/scorers/self-describing-scorer.js +17 -18
- package/dist/analyzers/scorers/self-describing-scorer.js.map +1 -1
- package/dist/cli/help.js +51 -51
- package/dist/disciplines/catalog.d.ts +16 -0
- package/dist/disciplines/catalog.d.ts.map +1 -0
- package/dist/disciplines/catalog.js +196 -0
- package/dist/disciplines/catalog.js.map +1 -0
- package/dist/disciplines/runner.d.ts +13 -0
- package/dist/disciplines/runner.d.ts.map +1 -0
- package/dist/disciplines/runner.js +35 -0
- package/dist/disciplines/runner.js.map +1 -0
- package/dist/registry/composer.d.ts.map +1 -1
- package/dist/registry/composer.js +9 -4
- package/dist/registry/composer.js.map +1 -1
- package/dist/registry/loader-tag.d.ts.map +1 -1
- package/dist/registry/loader-tag.js +1 -0
- package/dist/registry/loader-tag.js.map +1 -1
- package/dist/registry/remote-gates.js +1 -1
- package/dist/registry/remote-gates.js.map +1 -1
- package/dist/registry/renderer-skeletons.js +92 -92
- package/dist/registry/sentinel-renderer.js +299 -20
- package/dist/registry/sentinel-renderer.js.map +1 -1
- package/dist/sentinel/detect.d.ts +41 -0
- package/dist/sentinel/detect.d.ts.map +1 -0
- package/dist/sentinel/detect.js +122 -0
- package/dist/sentinel/detect.js.map +1 -0
- package/dist/sentinel/write.d.ts +54 -0
- package/dist/sentinel/write.d.ts.map +1 -0
- package/dist/sentinel/write.js +75 -0
- package/dist/sentinel/write.js.map +1 -0
- package/dist/shared/cnt-health.d.ts +16 -0
- package/dist/shared/cnt-health.d.ts.map +1 -1
- package/dist/shared/cnt-health.js +55 -8
- package/dist/shared/cnt-health.js.map +1 -1
- package/dist/shared/config.d.ts +14 -0
- package/dist/shared/config.d.ts.map +1 -1
- package/dist/shared/config.js +45 -0
- package/dist/shared/config.js.map +1 -1
- package/dist/shared/gs-score-logger.js +6 -6
- package/dist/shared/hook-installer.d.ts +58 -0
- package/dist/shared/hook-installer.d.ts.map +1 -0
- package/dist/shared/hook-installer.js +316 -0
- package/dist/shared/hook-installer.js.map +1 -0
- package/dist/shared/project-gates-helpers.d.ts +9 -0
- package/dist/shared/project-gates-helpers.d.ts.map +1 -1
- package/dist/shared/project-gates-helpers.js +35 -0
- package/dist/shared/project-gates-helpers.js.map +1 -1
- package/dist/shared/types/config.d.ts +7 -1
- package/dist/shared/types/config.d.ts.map +1 -1
- package/dist/shared/types/gates.d.ts +34 -0
- package/dist/shared/types/gates.d.ts.map +1 -1
- package/dist/shared/types/project.d.ts +68 -2
- package/dist/shared/types/project.d.ts.map +1 -1
- package/dist/shared/types/project.js +1 -0
- package/dist/shared/types/project.js.map +1 -1
- package/dist/shared/types/templates.d.ts +8 -1
- package/dist/shared/types/templates.d.ts.map +1 -1
- package/dist/shared/types/verify.d.ts +51 -1
- package/dist/shared/types/verify.d.ts.map +1 -1
- package/dist/shared/types/verify.js +37 -1
- package/dist/shared/types/verify.js.map +1 -1
- package/dist/tools/add-hook.d.ts.map +1 -1
- package/dist/tools/add-hook.js +8 -1
- package/dist/tools/add-hook.js.map +1 -1
- package/dist/tools/add-module.js +123 -123
- package/dist/tools/advice-registry.d.ts.map +1 -1
- package/dist/tools/advice-registry.js +108 -18
- package/dist/tools/advice-registry.js.map +1 -1
- package/dist/tools/advise-session-advisor.d.ts +16 -0
- package/dist/tools/advise-session-advisor.d.ts.map +1 -0
- package/dist/tools/advise-session-advisor.js +89 -0
- package/dist/tools/advise-session-advisor.js.map +1 -0
- package/dist/tools/advise-session-signals.d.ts +21 -0
- package/dist/tools/advise-session-signals.d.ts.map +1 -0
- package/dist/tools/advise-session-signals.js +113 -0
- package/dist/tools/advise-session-signals.js.map +1 -0
- package/dist/tools/advise-session.d.ts +22 -0
- package/dist/tools/advise-session.d.ts.map +1 -0
- package/dist/tools/advise-session.js +31 -0
- package/dist/tools/advise-session.js.map +1 -0
- package/dist/tools/analyze-harness.d.ts +18 -0
- package/dist/tools/analyze-harness.d.ts.map +1 -0
- package/dist/tools/analyze-harness.js +298 -0
- package/dist/tools/analyze-harness.js.map +1 -0
- package/dist/tools/audit.d.ts.map +1 -1
- package/dist/tools/audit.js +19 -0
- package/dist/tools/audit.js.map +1 -1
- package/dist/tools/change-request.d.ts +53 -0
- package/dist/tools/change-request.d.ts.map +1 -0
- package/dist/tools/change-request.js +395 -0
- package/dist/tools/change-request.js.map +1 -0
- package/dist/tools/check-cascade-contracts.d.ts +13 -0
- package/dist/tools/check-cascade-contracts.d.ts.map +1 -1
- package/dist/tools/check-cascade-contracts.js +73 -2
- package/dist/tools/check-cascade-contracts.js.map +1 -1
- package/dist/tools/check-cascade-report.js +64 -64
- package/dist/tools/check-cascade-steps.d.ts +3 -0
- package/dist/tools/check-cascade-steps.d.ts.map +1 -1
- package/dist/tools/check-cascade-steps.js +104 -15
- package/dist/tools/check-cascade-steps.js.map +1 -1
- package/dist/tools/check-cascade.d.ts +4 -3
- package/dist/tools/check-cascade.d.ts.map +1 -1
- package/dist/tools/check-cascade.js +30 -12
- package/dist/tools/check-cascade.js.map +1 -1
- package/dist/tools/check-derivation-chain.d.ts +37 -0
- package/dist/tools/check-derivation-chain.d.ts.map +1 -0
- package/dist/tools/check-derivation-chain.js +418 -0
- package/dist/tools/check-derivation-chain.js.map +1 -0
- package/dist/tools/check-spec-consistency.d.ts +25 -0
- package/dist/tools/check-spec-consistency.d.ts.map +1 -0
- package/dist/tools/check-spec-consistency.js +339 -0
- package/dist/tools/check-spec-consistency.js.map +1 -0
- package/dist/tools/check-t4.d.ts +54 -0
- package/dist/tools/check-t4.d.ts.map +1 -0
- package/dist/tools/check-t4.js +305 -0
- package/dist/tools/check-t4.js.map +1 -0
- package/dist/tools/close-cycle.d.ts +11 -0
- package/dist/tools/close-cycle.d.ts.map +1 -1
- package/dist/tools/close-cycle.js +364 -4
- package/dist/tools/close-cycle.js.map +1 -1
- package/dist/tools/cnt-add-routing.d.ts +31 -0
- package/dist/tools/cnt-add-routing.d.ts.map +1 -0
- package/dist/tools/cnt-add-routing.js +99 -0
- package/dist/tools/cnt-add-routing.js.map +1 -0
- package/dist/tools/configure-mcp.d.ts.map +1 -1
- package/dist/tools/configure-mcp.js +52 -2
- package/dist/tools/configure-mcp.js.map +1 -1
- package/dist/tools/consolidate-status.d.ts +31 -0
- package/dist/tools/consolidate-status.d.ts.map +1 -1
- package/dist/tools/consolidate-status.js +105 -0
- package/dist/tools/consolidate-status.js.map +1 -1
- package/dist/tools/executable-gates.d.ts +52 -0
- package/dist/tools/executable-gates.d.ts.map +1 -0
- package/dist/tools/executable-gates.js +333 -0
- package/dist/tools/executable-gates.js.map +1 -0
- package/dist/tools/extract-adrs-from-spec.d.ts +33 -0
- package/dist/tools/extract-adrs-from-spec.d.ts.map +1 -0
- package/dist/tools/extract-adrs-from-spec.js +410 -0
- package/dist/tools/extract-adrs-from-spec.js.map +1 -0
- package/dist/tools/extract-adrs-history.d.ts +47 -0
- package/dist/tools/extract-adrs-history.d.ts.map +1 -0
- package/dist/tools/extract-adrs-history.js +265 -0
- package/dist/tools/extract-adrs-history.js.map +1 -0
- package/dist/tools/forgecraft-dispatch-extended.d.ts.map +1 -1
- package/dist/tools/forgecraft-dispatch-extended.js +137 -0
- package/dist/tools/forgecraft-dispatch-extended.js.map +1 -1
- package/dist/tools/forgecraft-dispatch.d.ts.map +1 -1
- package/dist/tools/forgecraft-dispatch.js +16 -0
- package/dist/tools/forgecraft-dispatch.js.map +1 -1
- package/dist/tools/forgecraft-schema-params.d.ts +174 -2
- package/dist/tools/forgecraft-schema-params.d.ts.map +1 -1
- package/dist/tools/forgecraft-schema-params.js +197 -0
- package/dist/tools/forgecraft-schema-params.js.map +1 -1
- package/dist/tools/forgecraft-schema.d.ts +179 -7
- package/dist/tools/forgecraft-schema.d.ts.map +1 -1
- package/dist/tools/forgecraft-schema.js +37 -0
- package/dist/tools/forgecraft-schema.js.map +1 -1
- package/dist/tools/generate-adr.js +6 -6
- package/dist/tools/generate-adr.js.map +1 -1
- package/dist/tools/generate-decision.d.ts +77 -0
- package/dist/tools/generate-decision.d.ts.map +1 -0
- package/dist/tools/generate-decision.js +162 -0
- package/dist/tools/generate-decision.js.map +1 -0
- package/dist/tools/generate-env-probe.d.ts +49 -0
- package/dist/tools/generate-env-probe.d.ts.map +1 -0
- package/dist/tools/generate-env-probe.js +365 -0
- package/dist/tools/generate-env-probe.js.map +1 -0
- package/dist/tools/generate-harness.d.ts +53 -0
- package/dist/tools/generate-harness.d.ts.map +1 -0
- package/dist/tools/generate-harness.js +395 -0
- package/dist/tools/generate-harness.js.map +1 -0
- package/dist/tools/generate-roadmap.d.ts +1 -1
- package/dist/tools/generate-roadmap.d.ts.map +1 -1
- package/dist/tools/generate-roadmap.js +38 -4
- package/dist/tools/generate-roadmap.js.map +1 -1
- package/dist/tools/generate-session-prompt.d.ts +3 -3
- package/dist/tools/generate-session-prompt.d.ts.map +1 -1
- package/dist/tools/generate-session-prompt.js +9 -1
- package/dist/tools/generate-session-prompt.js.map +1 -1
- package/dist/tools/generate-slo-probe.d.ts +53 -0
- package/dist/tools/generate-slo-probe.d.ts.map +1 -0
- package/dist/tools/generate-slo-probe.js +366 -0
- package/dist/tools/generate-slo-probe.js.map +1 -0
- package/dist/tools/layer-status-gates.d.ts +24 -0
- package/dist/tools/layer-status-gates.d.ts.map +1 -0
- package/dist/tools/layer-status-gates.js +151 -0
- package/dist/tools/layer-status-gates.js.map +1 -0
- package/dist/tools/layer-status.d.ts +126 -0
- package/dist/tools/layer-status.d.ts.map +1 -0
- package/dist/tools/layer-status.js +647 -0
- package/dist/tools/layer-status.js.map +1 -0
- package/dist/tools/list.d.ts.map +1 -1
- package/dist/tools/list.js +9 -5
- package/dist/tools/list.js.map +1 -1
- package/dist/tools/postcondition-coverage.d.ts +57 -0
- package/dist/tools/postcondition-coverage.d.ts.map +1 -0
- package/dist/tools/postcondition-coverage.js +256 -0
- package/dist/tools/postcondition-coverage.js.map +1 -0
- package/dist/tools/probe-runners.d.ts +21 -0
- package/dist/tools/probe-runners.d.ts.map +1 -0
- package/dist/tools/probe-runners.js +246 -0
- package/dist/tools/probe-runners.js.map +1 -0
- package/dist/tools/probe-templates.d.ts +27 -0
- package/dist/tools/probe-templates.d.ts.map +1 -0
- package/dist/tools/probe-templates.js +279 -0
- package/dist/tools/probe-templates.js.map +1 -0
- package/dist/tools/propose-session.d.ts +28 -0
- package/dist/tools/propose-session.d.ts.map +1 -0
- package/dist/tools/propose-session.js +333 -0
- package/dist/tools/propose-session.js.map +1 -0
- package/dist/tools/refresh-output.js +14 -14
- package/dist/tools/review-stubs.d.ts +29 -0
- package/dist/tools/review-stubs.d.ts.map +1 -0
- package/dist/tools/review-stubs.js +173 -0
- package/dist/tools/review-stubs.js.map +1 -0
- package/dist/tools/roadmap-builder.d.ts +49 -1
- package/dist/tools/roadmap-builder.d.ts.map +1 -1
- package/dist/tools/roadmap-builder.js +210 -5
- package/dist/tools/roadmap-builder.js.map +1 -1
- package/dist/tools/run-env-probe.d.ts +57 -0
- package/dist/tools/run-env-probe.d.ts.map +1 -0
- package/dist/tools/run-env-probe.js +270 -0
- package/dist/tools/run-env-probe.js.map +1 -0
- package/dist/tools/run-harness.d.ts +52 -0
- package/dist/tools/run-harness.d.ts.map +1 -0
- package/dist/tools/run-harness.js +279 -0
- package/dist/tools/run-harness.js.map +1 -0
- package/dist/tools/run-slo-probe.d.ts +50 -0
- package/dist/tools/run-slo-probe.d.ts.map +1 -0
- package/dist/tools/run-slo-probe.js +281 -0
- package/dist/tools/run-slo-probe.js.map +1 -0
- package/dist/tools/scaffold-spec-stubs.js +115 -115
- package/dist/tools/scaffold-templates.js +62 -62
- package/dist/tools/scaffold-writer.d.ts.map +1 -1
- package/dist/tools/scaffold-writer.js +9 -0
- package/dist/tools/scaffold-writer.js.map +1 -1
- package/dist/tools/score-rubric.d.ts +19 -0
- package/dist/tools/score-rubric.d.ts.map +1 -0
- package/dist/tools/score-rubric.js +411 -0
- package/dist/tools/score-rubric.js.map +1 -0
- package/dist/tools/session-prompt-builders.d.ts +20 -0
- package/dist/tools/session-prompt-builders.d.ts.map +1 -1
- package/dist/tools/session-prompt-builders.js +78 -5
- package/dist/tools/session-prompt-builders.js.map +1 -1
- package/dist/tools/session-prompt-sections.d.ts +4 -2
- package/dist/tools/session-prompt-sections.d.ts.map +1 -1
- package/dist/tools/session-prompt-sections.js +22 -10
- package/dist/tools/session-prompt-sections.js.map +1 -1
- package/dist/tools/setup-artifact-writers.d.ts +69 -4
- package/dist/tools/setup-artifact-writers.d.ts.map +1 -1
- package/dist/tools/setup-artifact-writers.js +681 -5
- package/dist/tools/setup-artifact-writers.js.map +1 -1
- package/dist/tools/setup-cnt-builders.d.ts.map +1 -1
- package/dist/tools/setup-cnt-builders.js +162 -34
- package/dist/tools/setup-cnt-builders.js.map +1 -1
- package/dist/tools/setup-monitoring.d.ts +41 -0
- package/dist/tools/setup-monitoring.d.ts.map +1 -0
- package/dist/tools/setup-monitoring.js +364 -0
- package/dist/tools/setup-monitoring.js.map +1 -0
- package/dist/tools/setup-phase1.d.ts.map +1 -1
- package/dist/tools/setup-phase1.js +14 -1
- package/dist/tools/setup-phase1.js.map +1 -1
- package/dist/tools/setup-phase2.d.ts +14 -0
- package/dist/tools/setup-phase2.d.ts.map +1 -1
- package/dist/tools/setup-phase2.js +130 -3
- package/dist/tools/setup-phase2.js.map +1 -1
- package/dist/tools/setup-project.d.ts +8 -0
- package/dist/tools/setup-project.d.ts.map +1 -1
- package/dist/tools/setup-project.js +52 -2
- package/dist/tools/setup-project.js.map +1 -1
- package/dist/tools/spec-parser-tags.d.ts.map +1 -1
- package/dist/tools/spec-parser-tags.js +1 -0
- package/dist/tools/spec-parser-tags.js.map +1 -1
- package/dist/tools/verify-formatter.d.ts.map +1 -1
- package/dist/tools/verify-formatter.js +15 -1
- package/dist/tools/verify-formatter.js.map +1 -1
- package/dist/tools/verify.d.ts.map +1 -1
- package/dist/tools/verify.js +3 -0
- package/dist/tools/verify.js.map +1 -1
- package/package.json +98 -89
- package/templates/analytics/instructions.yaml +37 -37
- package/templates/analytics/mcp-servers.yaml +11 -11
- package/templates/analytics/structure.yaml +25 -25
- package/templates/api/harness/uc-template.hurl +20 -0
- package/templates/api/instructions.yaml +231 -231
- package/templates/api/mcp-servers.yaml +22 -22
- package/templates/api/nfr.yaml +23 -23
- package/templates/api/review.yaml +103 -103
- package/templates/api/structure.yaml +34 -34
- package/templates/api/verification.yaml +132 -132
- package/templates/cli/instructions.yaml +31 -31
- package/templates/cli/mcp-servers.yaml +11 -11
- package/templates/cli/review.yaml +53 -53
- package/templates/cli/structure.yaml +16 -16
- package/templates/data-lineage/instructions.yaml +28 -28
- package/templates/data-lineage/mcp-servers.yaml +22 -22
- package/templates/data-pipeline/instructions.yaml +84 -84
- package/templates/data-pipeline/mcp-servers.yaml +13 -13
- package/templates/data-pipeline/nfr.yaml +39 -39
- package/templates/data-pipeline/structure.yaml +23 -23
- package/templates/docs-manifest.yaml +227 -0
- package/templates/fintech/hooks.yaml +55 -55
- package/templates/fintech/instructions.yaml +112 -112
- package/templates/fintech/mcp-servers.yaml +13 -13
- package/templates/fintech/nfr.yaml +46 -46
- package/templates/fintech/playbook.yaml +210 -210
- package/templates/fintech/verification.yaml +239 -239
- package/templates/game/harness/uc-template.sim.ts +29 -0
- package/templates/game/instructions.yaml +289 -289
- package/templates/game/mcp-servers.yaml +38 -38
- package/templates/game/nfr.yaml +64 -64
- package/templates/game/playbook.yaml +214 -214
- package/templates/game/review.yaml +97 -97
- package/templates/game/structure.yaml +67 -67
- package/templates/game/verification.yaml +174 -174
- package/templates/healthcare/instructions.yaml +42 -42
- package/templates/healthcare/mcp-servers.yaml +13 -13
- package/templates/healthcare/nfr.yaml +47 -47
- package/templates/hipaa/instructions.yaml +41 -41
- package/templates/hipaa/mcp-servers.yaml +13 -13
- package/templates/infra/instructions.yaml +104 -104
- package/templates/infra/mcp-servers.yaml +20 -20
- package/templates/infra/nfr.yaml +46 -46
- package/templates/infra/review.yaml +65 -65
- package/templates/infra/structure.yaml +25 -25
- package/templates/library/instructions.yaml +36 -36
- package/templates/library/mcp-servers.yaml +20 -20
- package/templates/library/review.yaml +56 -56
- package/templates/library/structure.yaml +19 -19
- package/templates/medallion-architecture/instructions.yaml +41 -41
- package/templates/medallion-architecture/mcp-servers.yaml +22 -22
- package/templates/ml/instructions.yaml +85 -85
- package/templates/ml/mcp-servers.yaml +11 -11
- package/templates/ml/nfr.yaml +39 -39
- package/templates/ml/structure.yaml +25 -25
- package/templates/ml/verification.yaml +156 -156
- package/templates/mobile/instructions.yaml +44 -44
- package/templates/mobile/mcp-servers.yaml +11 -11
- package/templates/mobile/nfr.yaml +49 -49
- package/templates/mobile/structure.yaml +27 -27
- package/templates/mobile/verification.yaml +121 -121
- package/templates/observability-xray/instructions.yaml +40 -40
- package/templates/observability-xray/mcp-servers.yaml +15 -15
- package/templates/realtime/instructions.yaml +42 -42
- package/templates/realtime/mcp-servers.yaml +13 -13
- package/templates/soc2/instructions.yaml +41 -41
- package/templates/soc2/mcp-servers.yaml +24 -24
- package/templates/social/instructions.yaml +43 -43
- package/templates/social/mcp-servers.yaml +24 -24
- package/templates/state-machine/instructions.yaml +42 -42
- package/templates/state-machine/mcp-servers.yaml +11 -11
- package/templates/tools-registry.yaml +164 -164
- package/templates/universal/claude-md-blocks/layer-navigation.md +20 -0
- package/templates/universal/claude-md-blocks/nfr-contracts.md +22 -0
- package/templates/universal/hooks.yaml +879 -723
- package/templates/universal/instructions.yaml +1692 -1692
- package/templates/universal/mcp-servers.yaml +50 -50
- package/templates/universal/nfr.yaml +197 -197
- package/templates/universal/reference.yaml +326 -326
- package/templates/universal/review.yaml +204 -204
- package/templates/universal/skills.yaml +262 -262
- package/templates/universal/structure.yaml +67 -67
- package/templates/universal/verification.yaml +416 -416
- package/templates/web-next/hooks.yaml +114 -0
- package/templates/web-next/instructions.yaml +106 -0
- package/templates/web-react/harness/uc-template.spec.ts +35 -0
- package/templates/web-react/hooks.yaml +156 -44
- package/templates/web-react/instructions.yaml +296 -207
- package/templates/web-react/mcp-servers.yaml +20 -20
- package/templates/web-react/nfr.yaml +27 -27
- package/templates/web-react/review.yaml +94 -94
- package/templates/web-react/structure.yaml +46 -46
- package/templates/web-react/verification.yaml +126 -126
- package/templates/web-static/hooks.yaml +85 -0
- package/templates/web-static/instructions.yaml +204 -115
- package/templates/web-static/mcp-servers.yaml +20 -20
- package/templates/web3/instructions.yaml +44 -44
- package/templates/web3/mcp-servers.yaml +11 -11
- package/templates/web3/verification.yaml +159 -159
- package/templates/zero-trust/instructions.yaml +41 -41
- package/templates/zero-trust/mcp-servers.yaml +15 -15
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
tag: DATA-PIPELINE
|
|
2
|
-
section: structure
|
|
3
|
-
entries:
|
|
4
|
-
- path: dags/
|
|
5
|
-
description: "Pipeline orchestration definitions (Airflow DAGs, Prefect flows, Dagster jobs)"
|
|
6
|
-
- path: src/extractors/
|
|
7
|
-
description: "Data source connectors: API, database, file extractors"
|
|
8
|
-
- path: src/transformers/
|
|
9
|
-
description: "Data transformation logic: cleaning, enrichment, aggregation"
|
|
10
|
-
- path: src/loaders/
|
|
11
|
-
description: "Data sinks: warehouse loaders, file writers, API publishers"
|
|
12
|
-
- path: src/validators/
|
|
13
|
-
description: "Data quality checks: schema validation, business rules, anomaly detection"
|
|
14
|
-
- path: src/config/
|
|
15
|
-
description: "Pipeline configuration: sources, schedules, thresholds (YAML)"
|
|
16
|
-
- path: tests/
|
|
17
|
-
description: "Unit tests for transformers, validators, and business logic"
|
|
18
|
-
- path: tests/fixtures/
|
|
19
|
-
description: "Sample data files for deterministic testing"
|
|
20
|
-
- path: sql/
|
|
21
|
-
description: "SQL transformations and DDL for warehouse tables"
|
|
22
|
-
- path: scripts/
|
|
23
|
-
description: "Operational scripts: backfill, reprocess, data repair"
|
|
1
|
+
tag: DATA-PIPELINE
|
|
2
|
+
section: structure
|
|
3
|
+
entries:
|
|
4
|
+
- path: dags/
|
|
5
|
+
description: "Pipeline orchestration definitions (Airflow DAGs, Prefect flows, Dagster jobs)"
|
|
6
|
+
- path: src/extractors/
|
|
7
|
+
description: "Data source connectors: API, database, file extractors"
|
|
8
|
+
- path: src/transformers/
|
|
9
|
+
description: "Data transformation logic: cleaning, enrichment, aggregation"
|
|
10
|
+
- path: src/loaders/
|
|
11
|
+
description: "Data sinks: warehouse loaders, file writers, API publishers"
|
|
12
|
+
- path: src/validators/
|
|
13
|
+
description: "Data quality checks: schema validation, business rules, anomaly detection"
|
|
14
|
+
- path: src/config/
|
|
15
|
+
description: "Pipeline configuration: sources, schedules, thresholds (YAML)"
|
|
16
|
+
- path: tests/
|
|
17
|
+
description: "Unit tests for transformers, validators, and business logic"
|
|
18
|
+
- path: tests/fixtures/
|
|
19
|
+
description: "Sample data files for deterministic testing"
|
|
20
|
+
- path: sql/
|
|
21
|
+
description: "SQL transformations and DDL for warehouse tables"
|
|
22
|
+
- path: scripts/
|
|
23
|
+
description: "Operational scripts: backfill, reprocess, data repair"
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# docs-manifest.yaml — canonical schema for the GS document taxonomy
|
|
2
|
+
#
|
|
3
|
+
# This file is the SINGLE SOURCE OF TRUTH for the document layout that all
|
|
4
|
+
# Pragmaworks GS-aware tools (forgecraft, chronicle, chronicle-team) honor.
|
|
5
|
+
# Projects do NOT copy this file. They write their own ./docs/manifest.yaml
|
|
6
|
+
# which references this canonical schema and overrides paths where needed.
|
|
7
|
+
#
|
|
8
|
+
# Canonical location:
|
|
9
|
+
# github.com/jghiringhelli/forgecraft-mcp/templates/docs-manifest.yaml
|
|
10
|
+
# (also reachable via the forgecraft npm package)
|
|
11
|
+
#
|
|
12
|
+
# A project's docs/manifest.yaml LOOKS LIKE:
|
|
13
|
+
#
|
|
14
|
+
# schema_source: forgecraft@1.5.0/templates/docs-manifest.yaml
|
|
15
|
+
# project:
|
|
16
|
+
# name: my-app
|
|
17
|
+
# type: api
|
|
18
|
+
# overrides:
|
|
19
|
+
# documents.specs.path: docs/product/ # legacy layout, mapped in
|
|
20
|
+
# documents.use_cases.path: docs/uc/
|
|
21
|
+
#
|
|
22
|
+
# Tools resolve paths in this order:
|
|
23
|
+
# 1. project's docs/manifest.yaml `overrides:` block (highest priority)
|
|
24
|
+
# 2. project's docs/manifest.yaml top-level fields
|
|
25
|
+
# 3. this canonical schema's defaults
|
|
26
|
+
#
|
|
27
|
+
# That is what "back-compat" means here: the canonical layout is the default;
|
|
28
|
+
# legacy projects map their existing files into the schema via overrides.
|
|
29
|
+
|
|
30
|
+
version: 1
|
|
31
|
+
|
|
32
|
+
# ── Project metadata ─────────────────────────────────────────────────────
|
|
33
|
+
project:
|
|
34
|
+
name: <required> # human-readable project name
|
|
35
|
+
type: <required> # library | cli | api | service | app | tool
|
|
36
|
+
release_phase: greenfield # greenfield | brownfield | maintenance
|
|
37
|
+
|
|
38
|
+
# ── Document types and their canonical locations ─────────────────────────
|
|
39
|
+
# Each entry defines:
|
|
40
|
+
# path — where files live (or active_path/done_path for archived types)
|
|
41
|
+
# pattern — glob applied for discovery
|
|
42
|
+
# required_on — conventional-commit types that MUST touch a file in this slot
|
|
43
|
+
# archive_when (optional) — when files move from active_path to done_path
|
|
44
|
+
documents:
|
|
45
|
+
|
|
46
|
+
# SPECS — what we are building (product/use-case-driven specs)
|
|
47
|
+
specs:
|
|
48
|
+
path: docs/specs/
|
|
49
|
+
pattern: "*.md"
|
|
50
|
+
required_on: [feat, refactor]
|
|
51
|
+
description: >
|
|
52
|
+
Product-level specs. One per feature or major capability.
|
|
53
|
+
Answers: what does the user do, what outcome do they want, what is in/out of scope?
|
|
54
|
+
|
|
55
|
+
# ADRs — architectural decision records (how we build, with rationale)
|
|
56
|
+
adrs:
|
|
57
|
+
active_path: docs/adrs/active/
|
|
58
|
+
done_path: docs/adrs/done/
|
|
59
|
+
pattern: "ADR-*.md"
|
|
60
|
+
required_on: [] # encouraged on feat/refactor when a decision is made
|
|
61
|
+
archive_when: superseded
|
|
62
|
+
description: >
|
|
63
|
+
Architectural Decision Records. One file per decision (e.g. ADR-0007-pick-postgres.md).
|
|
64
|
+
Active = currently in force. Done = superseded or rolled back, kept for history.
|
|
65
|
+
|
|
66
|
+
# USE CASES — actor + action + outcome (executable scenarios)
|
|
67
|
+
use_cases:
|
|
68
|
+
path: docs/use-cases/
|
|
69
|
+
pattern: "UC-*.md"
|
|
70
|
+
required_on: [feat]
|
|
71
|
+
description: >
|
|
72
|
+
Executable use cases. Each one: actor, preconditions, steps, expected outcome.
|
|
73
|
+
These bind specs to harness/tests.
|
|
74
|
+
|
|
75
|
+
# ROADMAPS — planned/active/done work items
|
|
76
|
+
roadmaps:
|
|
77
|
+
active_path: docs/roadmaps/active/
|
|
78
|
+
done_path: docs/roadmaps/done/
|
|
79
|
+
pattern: "RM-*.md"
|
|
80
|
+
required_on: [] # roadmap items are pulled from tickets/issues, not commits
|
|
81
|
+
archive_when: implemented
|
|
82
|
+
description: >
|
|
83
|
+
Roadmap items. One file per planned chunk of work (e.g. RM-0042-add-oauth.md).
|
|
84
|
+
Active = open. Done = shipped (kept for history and changelog generation).
|
|
85
|
+
|
|
86
|
+
# SCHEMAS — diagrams, data schemas, API schemas
|
|
87
|
+
schemas:
|
|
88
|
+
path: docs/schemas/
|
|
89
|
+
pattern: "*.{md,mmd,json,yaml}"
|
|
90
|
+
required_on: [feat]
|
|
91
|
+
description: >
|
|
92
|
+
Mermaid diagrams (.mmd or fenced .md), JSON Schema, OpenAPI specs, ER diagrams.
|
|
93
|
+
Required when data model or API surface changes.
|
|
94
|
+
|
|
95
|
+
# DECISIONS — lightweight bug-fix or operational decisions
|
|
96
|
+
decisions:
|
|
97
|
+
path: docs/decisions/
|
|
98
|
+
pattern: "*.md"
|
|
99
|
+
required_on: [] # optional even on fix; encouraged when behavior is intentionally redefined
|
|
100
|
+
scaffolded_by: generate_decision # forgecraft tool that emits the post-mortem stub
|
|
101
|
+
description: >
|
|
102
|
+
One-pager rationale for non-architectural decisions: bug-fix interpretations,
|
|
103
|
+
operational tweaks, "we chose X over Y because Z" notes that don't warrant a full ADR.
|
|
104
|
+
Filename pattern: YYYY-MM-DD-slug.md.
|
|
105
|
+
Use forgecraft `generate_decision` (or change_request with type=bug-postmortem)
|
|
106
|
+
to scaffold a stub with Trigger / Root cause / Fix / Regression test / Chronicle link.
|
|
107
|
+
|
|
108
|
+
# CONTRACTS — behavioral contracts (what the system promises)
|
|
109
|
+
contracts:
|
|
110
|
+
path: docs/contracts/
|
|
111
|
+
pattern: "*.{md,yaml}"
|
|
112
|
+
required_on: []
|
|
113
|
+
description: >
|
|
114
|
+
Behavioral contracts. NFRs, SLOs, API contracts, error semantics.
|
|
115
|
+
Often referenced from specs and ADRs.
|
|
116
|
+
|
|
117
|
+
# SESSION PROMPTS — bound to roadmap items (forgecraft + chronicle convention)
|
|
118
|
+
session_prompts:
|
|
119
|
+
path: docs/session-prompts/
|
|
120
|
+
pattern: "RM-*.md"
|
|
121
|
+
required_on: []
|
|
122
|
+
description: >
|
|
123
|
+
Per-roadmap-item prompts that drive AI sessions. One per RM-* item.
|
|
124
|
+
Generated by forgecraft propose_session, executed by chronicle.
|
|
125
|
+
|
|
126
|
+
# ── Cascade rules — which commit types require which doc updates ─────────
|
|
127
|
+
# These are enforced by:
|
|
128
|
+
# - .claude/hooks/pre-commit-doc-cascade.sh (local, advisory)
|
|
129
|
+
# - .github/workflows/validate-pr.yml (CI, blocking when severity=error)
|
|
130
|
+
#
|
|
131
|
+
# Severity:
|
|
132
|
+
# error — blocks commit/PR
|
|
133
|
+
# warning — emits a notice; does not block
|
|
134
|
+
# info — logs only
|
|
135
|
+
cascade:
|
|
136
|
+
feat:
|
|
137
|
+
required: [specs]
|
|
138
|
+
encouraged: [use_cases, schemas, adrs]
|
|
139
|
+
severity: warning # bump to error once a project's baseline is clean
|
|
140
|
+
|
|
141
|
+
fix:
|
|
142
|
+
required: [] # no doc requirement; regression test is mandatory (see human_judgment)
|
|
143
|
+
encouraged: [decisions]
|
|
144
|
+
require_regression_test: true
|
|
145
|
+
severity: warning
|
|
146
|
+
|
|
147
|
+
refactor:
|
|
148
|
+
required: []
|
|
149
|
+
encouraged: [adrs, decisions]
|
|
150
|
+
severity: info
|
|
151
|
+
|
|
152
|
+
perf:
|
|
153
|
+
required: []
|
|
154
|
+
encouraged: [decisions, schemas]
|
|
155
|
+
severity: info
|
|
156
|
+
|
|
157
|
+
docs:
|
|
158
|
+
required: []
|
|
159
|
+
encouraged: []
|
|
160
|
+
severity: info
|
|
161
|
+
|
|
162
|
+
test:
|
|
163
|
+
required: []
|
|
164
|
+
encouraged: []
|
|
165
|
+
severity: info
|
|
166
|
+
|
|
167
|
+
chore:
|
|
168
|
+
required: []
|
|
169
|
+
encouraged: []
|
|
170
|
+
severity: info
|
|
171
|
+
|
|
172
|
+
ci:
|
|
173
|
+
required: []
|
|
174
|
+
encouraged: []
|
|
175
|
+
severity: info
|
|
176
|
+
|
|
177
|
+
revert:
|
|
178
|
+
required: []
|
|
179
|
+
encouraged: [decisions]
|
|
180
|
+
severity: info
|
|
181
|
+
|
|
182
|
+
# ── Anti-drift — public API surface enforcement ─────────────────────────
|
|
183
|
+
# When the public surface changes (exports, public types, CLI flags, MCP tool
|
|
184
|
+
# schemas), a spec or ADR touch is required regardless of commit type.
|
|
185
|
+
api_surface:
|
|
186
|
+
detect:
|
|
187
|
+
typescript:
|
|
188
|
+
exports_glob: "src/**/index.ts"
|
|
189
|
+
public_types_glob: "src/types/**/*.ts"
|
|
190
|
+
cli:
|
|
191
|
+
flags_glob: "src/cli/**/*.ts"
|
|
192
|
+
mcp:
|
|
193
|
+
tools_glob: "src/tools/**/*.ts"
|
|
194
|
+
on_change_require: [specs, adrs]
|
|
195
|
+
severity: warning
|
|
196
|
+
|
|
197
|
+
# ── Human-judgment gate — "no untested or unreviewed code to prod" ──────
|
|
198
|
+
human_judgment:
|
|
199
|
+
protected_branches: [main, develop]
|
|
200
|
+
require_review: true
|
|
201
|
+
min_reviewers: 1 # set 0 for solo mode (still requires PR + checks)
|
|
202
|
+
require_tests_pass: true # CI must show tests green
|
|
203
|
+
require_human_ack: true # at least one human comment/approval on the PR
|
|
204
|
+
block_ai_only_merge: true # disallow merge when only the PR author has interacted
|
|
205
|
+
|
|
206
|
+
# ── Recording layers — three-tier memory contract ───────────────────────
|
|
207
|
+
# This block is informational. It documents how project / individual / team
|
|
208
|
+
# memory split across tools, so each tool knows its lane.
|
|
209
|
+
recording:
|
|
210
|
+
project:
|
|
211
|
+
owner: forgecraft
|
|
212
|
+
surface: docs/* + .forgecraft/* + .claude/hooks/*
|
|
213
|
+
scope: cascade docs, gates, hooks, harness contracts
|
|
214
|
+
individual:
|
|
215
|
+
owner: chronicle
|
|
216
|
+
surface: ~/.chronicle/ (per-user memory store)
|
|
217
|
+
scope: prompt history, decisions, findings, developer habits, work style
|
|
218
|
+
team:
|
|
219
|
+
owner: chronicle-team
|
|
220
|
+
surface: shared DB (Railway) + dashboard
|
|
221
|
+
scope: shared memory, prompt analytics, ticket integration, workload split (axon)
|
|
222
|
+
|
|
223
|
+
# ── Brownfield ingestion settings ───────────────────────────────────────
|
|
224
|
+
brownfield:
|
|
225
|
+
scanner: pragmaworks-cli # external tool, not embedded
|
|
226
|
+
override_file: docs/manifest.yaml # generated/edited during ingestion
|
|
227
|
+
report_path: reports/brownfield-audit.md
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
tag: FINTECH
|
|
2
|
-
section: hooks
|
|
3
|
-
hooks:
|
|
4
|
-
- name: vol-unit-convention
|
|
5
|
-
trigger: pre-commit
|
|
6
|
-
description: "Block double-scaling of volatility fields already stored as percentage-per-period"
|
|
7
|
-
filename: pre-commit-vol-units.sh
|
|
8
|
-
script: |
|
|
9
|
-
#!/bin/bash
|
|
10
|
-
# Volatility unit confusion is the single most common source of false crash triggers
|
|
11
|
-
# and missed recovery conditions in financial simulations.
|
|
12
|
-
#
|
|
13
|
-
# This hook catches the two double-scaling patterns:
|
|
14
|
-
# / sqrt(N) applied to a field already stored as percentage-per-period
|
|
15
|
-
# * 100 applied to a field already stored as percentage-per-period
|
|
16
|
-
#
|
|
17
|
-
# CUSTOMIZE: replace VOL_FIELD_PATTERNS with the actual field names used in
|
|
18
|
-
# this codebase (e.g. vol_pct_per_day, sigma_stored, realised_vol_pct).
|
|
19
|
-
# The generic pattern below catches common naming conventions.
|
|
20
|
-
#
|
|
21
|
-
# Label: customize VOL_FIELD_PATTERNS for this project's field names.
|
|
22
|
-
|
|
23
|
-
STAGED=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(py|ts|tsx|js|jsx|go|rs)$')
|
|
24
|
-
if [ -z "$STAGED" ]; then exit 0; fi
|
|
25
|
-
|
|
26
|
-
# Generic vol field patterns — override with project-specific names
|
|
27
|
-
VOL_FIELD_PATTERNS="vol_pct|sigma_pct|realized_vol|implied_vol|vol_stored|pct_vol|annualized_vol"
|
|
28
|
-
|
|
29
|
-
VIOLATIONS=0
|
|
30
|
-
|
|
31
|
-
for file in $STAGED; do
|
|
32
|
-
# Pattern 1: double sqrt-annualization on a _pct / stored vol field
|
|
33
|
-
if grep -nE "($VOL_FIELD_PATTERNS).*/ ?sqrt\(|sqrt\(.*\).*($VOL_FIELD_PATTERNS)" "$file" 2>/dev/null | grep -v "^[[:space:]]*//" | grep -q .; then
|
|
34
|
-
echo " ❌ $file — possible double sqrt-scaling on a percentage-per-period vol field"
|
|
35
|
-
echo " Vol fields stored as pct-per-period must not be divided by sqrt(N) again."
|
|
36
|
-
grep -nE "($VOL_FIELD_PATTERNS).*/ ?sqrt\(|sqrt\(.*\).*($VOL_FIELD_PATTERNS)" "$file" | grep -v "^[[:space:]]*//"
|
|
37
|
-
VIOLATIONS=$((VIOLATIONS + 1))
|
|
38
|
-
fi
|
|
39
|
-
|
|
40
|
-
# Pattern 2: *100 on a field already stored as percentage
|
|
41
|
-
if grep -nE "($VOL_FIELD_PATTERNS).*\* ?100[^.]|[^.]100 ?\* ?.*($VOL_FIELD_PATTERNS)" "$file" 2>/dev/null | grep -v "^[[:space:]]*//" | grep -q .; then
|
|
42
|
-
echo " ❌ $file — possible *100 rescaling on a percentage-per-period vol field"
|
|
43
|
-
echo " Vol fields stored as pct-per-period must not be multiplied by 100 again."
|
|
44
|
-
grep -nE "($VOL_FIELD_PATTERNS).*\* ?100[^.]|[^.]100 ?\* ?.*($VOL_FIELD_PATTERNS)" "$file" | grep -v "^[[:space:]]*//"
|
|
45
|
-
VIOLATIONS=$((VIOLATIONS + 1))
|
|
46
|
-
fi
|
|
47
|
-
done
|
|
48
|
-
|
|
49
|
-
if [ $VIOLATIONS -gt 0 ]; then
|
|
50
|
-
echo ""
|
|
51
|
-
echo "❌ Vol unit convention violation(s) found."
|
|
52
|
-
echo " Check that the field is stored as a raw ratio (0.03 = 3%), not already as percentage."
|
|
53
|
-
echo " To suppress a false positive: add a comment '# vol-unit: raw-ratio' on the same line."
|
|
54
|
-
exit 1
|
|
55
|
-
fi
|
|
1
|
+
tag: FINTECH
|
|
2
|
+
section: hooks
|
|
3
|
+
hooks:
|
|
4
|
+
- name: vol-unit-convention
|
|
5
|
+
trigger: pre-commit
|
|
6
|
+
description: "Block double-scaling of volatility fields already stored as percentage-per-period"
|
|
7
|
+
filename: pre-commit-vol-units.sh
|
|
8
|
+
script: |
|
|
9
|
+
#!/bin/bash
|
|
10
|
+
# Volatility unit confusion is the single most common source of false crash triggers
|
|
11
|
+
# and missed recovery conditions in financial simulations.
|
|
12
|
+
#
|
|
13
|
+
# This hook catches the two double-scaling patterns:
|
|
14
|
+
# / sqrt(N) applied to a field already stored as percentage-per-period
|
|
15
|
+
# * 100 applied to a field already stored as percentage-per-period
|
|
16
|
+
#
|
|
17
|
+
# CUSTOMIZE: replace VOL_FIELD_PATTERNS with the actual field names used in
|
|
18
|
+
# this codebase (e.g. vol_pct_per_day, sigma_stored, realised_vol_pct).
|
|
19
|
+
# The generic pattern below catches common naming conventions.
|
|
20
|
+
#
|
|
21
|
+
# Label: customize VOL_FIELD_PATTERNS for this project's field names.
|
|
22
|
+
|
|
23
|
+
STAGED=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(py|ts|tsx|js|jsx|go|rs)$')
|
|
24
|
+
if [ -z "$STAGED" ]; then exit 0; fi
|
|
25
|
+
|
|
26
|
+
# Generic vol field patterns — override with project-specific names
|
|
27
|
+
VOL_FIELD_PATTERNS="vol_pct|sigma_pct|realized_vol|implied_vol|vol_stored|pct_vol|annualized_vol"
|
|
28
|
+
|
|
29
|
+
VIOLATIONS=0
|
|
30
|
+
|
|
31
|
+
for file in $STAGED; do
|
|
32
|
+
# Pattern 1: double sqrt-annualization on a _pct / stored vol field
|
|
33
|
+
if grep -nE "($VOL_FIELD_PATTERNS).*/ ?sqrt\(|sqrt\(.*\).*($VOL_FIELD_PATTERNS)" "$file" 2>/dev/null | grep -v "^[[:space:]]*//" | grep -q .; then
|
|
34
|
+
echo " ❌ $file — possible double sqrt-scaling on a percentage-per-period vol field"
|
|
35
|
+
echo " Vol fields stored as pct-per-period must not be divided by sqrt(N) again."
|
|
36
|
+
grep -nE "($VOL_FIELD_PATTERNS).*/ ?sqrt\(|sqrt\(.*\).*($VOL_FIELD_PATTERNS)" "$file" | grep -v "^[[:space:]]*//"
|
|
37
|
+
VIOLATIONS=$((VIOLATIONS + 1))
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
# Pattern 2: *100 on a field already stored as percentage
|
|
41
|
+
if grep -nE "($VOL_FIELD_PATTERNS).*\* ?100[^.]|[^.]100 ?\* ?.*($VOL_FIELD_PATTERNS)" "$file" 2>/dev/null | grep -v "^[[:space:]]*//" | grep -q .; then
|
|
42
|
+
echo " ❌ $file — possible *100 rescaling on a percentage-per-period vol field"
|
|
43
|
+
echo " Vol fields stored as pct-per-period must not be multiplied by 100 again."
|
|
44
|
+
grep -nE "($VOL_FIELD_PATTERNS).*\* ?100[^.]|[^.]100 ?\* ?.*($VOL_FIELD_PATTERNS)" "$file" | grep -v "^[[:space:]]*//"
|
|
45
|
+
VIOLATIONS=$((VIOLATIONS + 1))
|
|
46
|
+
fi
|
|
47
|
+
done
|
|
48
|
+
|
|
49
|
+
if [ $VIOLATIONS -gt 0 ]; then
|
|
50
|
+
echo ""
|
|
51
|
+
echo "❌ Vol unit convention violation(s) found."
|
|
52
|
+
echo " Check that the field is stored as a raw ratio (0.03 = 3%), not already as percentage."
|
|
53
|
+
echo " To suppress a false positive: add a comment '# vol-unit: raw-ratio' on the same line."
|
|
54
|
+
exit 1
|
|
55
|
+
fi
|
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
tag: FINTECH
|
|
2
|
-
section: instructions
|
|
3
|
-
blocks:
|
|
4
|
-
- id: transaction-integrity
|
|
5
|
-
tier: recommended
|
|
6
|
-
title: "Transaction Integrity & Data Precision"
|
|
7
|
-
content: |
|
|
8
|
-
## Transaction Integrity & Financial Data Precision
|
|
9
|
-
|
|
10
|
-
- Never use floating-point types for monetary values. Use fixed-precision decimal types (e.g., `Decimal`, `BigDecimal`, `NUMERIC(19,4)`) or integer minor units (cents/pips) throughout the entire stack.
|
|
11
|
-
- Ensure all financial operations are ACID-compliant. Use database transactions with appropriate isolation levels (at minimum READ COMMITTED; use SERIALIZABLE for balance mutations).
|
|
12
|
-
- Implement double-entry bookkeeping: every transaction creates at least two ledger entries (debit and credit) that sum to zero. Validate this invariant on every write.
|
|
13
|
-
- Make all transaction processing idempotent using client-supplied idempotency keys. Retry-safe APIs prevent duplicate charges or transfers.
|
|
14
|
-
- Record immutable transaction history. Financial records are append-only; corrections are modeled as reversing entries, never as in-place updates or deletes.
|
|
15
|
-
- Perform end-of-day reconciliation between internal ledgers and external payment processor/bank records. Alert immediately on any discrepancy.
|
|
16
|
-
- Store and display all monetary amounts with their ISO 4217 currency code. Never assume a default currency.
|
|
17
|
-
|
|
18
|
-
- id: audit-compliance
|
|
19
|
-
tier: recommended
|
|
20
|
-
title: "Audit Trails & Regulatory Compliance"
|
|
21
|
-
content: |
|
|
22
|
-
## Audit Trails & Regulatory Compliance
|
|
23
|
-
|
|
24
|
-
- Maintain a tamper-evident, append-only audit log for every state change to accounts, transactions, and user permissions. Include actor, timestamp, old value, new value, and IP address.
|
|
25
|
-
- Implement PCI-DSS controls if handling cardholder data: network segmentation, encryption, access logging, vulnerability scanning, and annual compliance assessments.
|
|
26
|
-
- Mask or tokenize sensitive financial identifiers (account numbers, SSNs, card PANs) in logs, error messages, and non-production environments.
|
|
27
|
-
- Enforce KYC/AML checks at onboarding and on an ongoing basis. Integrate with identity verification and sanctions screening providers via well-defined service boundaries.
|
|
28
|
-
- Retain financial records and audit logs for the period required by applicable regulations (typically 5-7 years). Automate archival and ensure archived data remains queryable for audits.
|
|
29
|
-
- Design for regulatory reporting: build data models and pipelines that can produce required reports (SAR, CTR, regulatory filings) with minimal manual intervention.
|
|
30
|
-
|
|
31
|
-
- id: security-resilience
|
|
32
|
-
tier: recommended
|
|
33
|
-
title: "Security & Operational Resilience"
|
|
34
|
-
content: |
|
|
35
|
-
## Security & Operational Resilience
|
|
36
|
-
|
|
37
|
-
- Implement multi-factor authentication for all user-facing financial operations above a configurable threshold (e.g., transfers > $500).
|
|
38
|
-
- Apply velocity checks and fraud detection rules: flag unusual transaction volumes, amounts, geographies, or timing patterns for review before processing.
|
|
39
|
-
- Use cryptographic signing (HMAC or asymmetric signatures) for all webhook payloads, inter-service financial messages, and API requests to prevent tampering.
|
|
40
|
-
- Design for graceful degradation: if an external payment provider is unavailable, queue transactions for retry rather than failing the user experience entirely.
|
|
41
|
-
- Maintain a disaster recovery plan with RPO < 1 hour and RTO < 4 hours for critical financial services. Test failover procedures quarterly.
|
|
42
|
-
- Separate read and write paths for high-throughput systems. Use CQRS to ensure reporting queries never contend with transaction processing.
|
|
43
|
-
|
|
44
|
-
- id: simulation-invariants
|
|
45
|
-
tier: recommended
|
|
46
|
-
title: "Financial Simulation & Backtesting Invariants"
|
|
47
|
-
content: |
|
|
48
|
-
## Financial Simulation & Backtesting Invariants
|
|
49
|
-
|
|
50
|
-
Financial simulations fail in two directions, both silently. Name them explicitly
|
|
51
|
-
so every engineer on the team recognizes the pattern immediately.
|
|
52
|
-
|
|
53
|
-
### Category A — Silent Loss Bugs (strategy runs, earns nothing)
|
|
54
|
-
|
|
55
|
-
These bugs produce flat or zero P&L while the simulation completes without error.
|
|
56
|
-
The strategy appears to have run. It did not.
|
|
57
|
-
|
|
58
|
-
**1. P&L decomposition invariant**
|
|
59
|
-
At finalize: `fee_income + price_income == total_pnl ± 1%`.
|
|
60
|
-
A gap larger than 1% means an accounting component is unlinked — it exists
|
|
61
|
-
in the ledger but never flows into the reported total.
|
|
62
|
-
|
|
63
|
-
**2. Fee-time ratio**
|
|
64
|
-
Fees must be proportional to active simulation time. Near-zero fees after
|
|
65
|
-
1000 hours of "running" means the instrument was never created. The strategy
|
|
66
|
-
ran against nothing. Check: `total_fees / active_hours < threshold` → flag.
|
|
67
|
-
|
|
68
|
-
**3. State concentration**
|
|
69
|
-
If >80% of simulation time is spent in a single non-productive state
|
|
70
|
-
(e.g. `crash_short`, `emergency`, `waiting`), the state machine is stuck.
|
|
71
|
-
A stuck machine is not a conservative strategy — it is a broken one.
|
|
72
|
-
Surface this in finalize as a warning, not a footnote.
|
|
73
|
-
|
|
74
|
-
### Category B — Silent Gain Bugs (inflated returns from accounting errors)
|
|
75
|
-
|
|
76
|
-
These bugs produce plausible-looking positive returns. They are harder to catch
|
|
77
|
-
because the output looks like a win.
|
|
78
|
-
|
|
79
|
-
**4. Return plausibility**
|
|
80
|
-
For a market-neutral strategy: annual return >200% or `total_pnl / fee_income >10×`
|
|
81
|
-
is almost certainly a bug, not alpha. Fee income is ground truth of actual activity.
|
|
82
|
-
A strategy that earns 10× its fees in price income has a broken hedge or look-ahead leak.
|
|
83
|
-
|
|
84
|
-
**5. Delta neutrality**
|
|
85
|
-
Track `avg |net_delta|` while in the primary running state.
|
|
86
|
-
High average delta = the hedge is broken, bootstrapped incorrectly, or bypassed.
|
|
87
|
-
This check surfaces bootstrap order bugs that only appear mid-simulation.
|
|
88
|
-
|
|
89
|
-
**6. Instrument balance**
|
|
90
|
-
Sub-strategies should be sized proportionally per the allocation spec.
|
|
91
|
-
If one instrument is 5× larger than another at finalize, allocation logic failed.
|
|
92
|
-
Check: `max(instrument_notionals) / min(instrument_notionals) > 3× → warn`.
|
|
93
|
-
|
|
94
|
-
### Integration requirements
|
|
95
|
-
|
|
96
|
-
- All 6 checks run in the harness `finalize()` step, printing alongside standard metrics.
|
|
97
|
-
- Failed invariants logged as `[INVARIANT FAIL]` — not swallowed as warnings.
|
|
98
|
-
- Checks are parameterized: thresholds in config, not hardcoded.
|
|
99
|
-
- All 6 checks have unit tests with synthetic data that triggers each failure mode.
|
|
100
|
-
|
|
101
|
-
### Volatility unit convention
|
|
102
|
-
|
|
103
|
-
Unit confusion in vol calculations is the single most common source of both false crash
|
|
104
|
-
triggers and missed recovery conditions in DeFi and market-neutral strategies.
|
|
105
|
-
|
|
106
|
-
- Vol fields stored as `percentage_per_period` must never be re-transformed with
|
|
107
|
-
`/ sqrt(N)` or `* 100` after storage. Storing already-scaled vol and scaling again
|
|
108
|
-
= off by 10×–100× with no runtime error.
|
|
109
|
-
- Label every vol field with its unit in the variable name or type alias:
|
|
110
|
-
`vol_pct_per_day`, `sigma_annual` — never just `vol` or `sigma`.
|
|
111
|
-
- Annualization convention must be a named constant: `TRADING_DAYS_PER_YEAR = 252`
|
|
112
|
-
(or 365, or actual — choose one, name it, use it everywhere).
|
|
1
|
+
tag: FINTECH
|
|
2
|
+
section: instructions
|
|
3
|
+
blocks:
|
|
4
|
+
- id: transaction-integrity
|
|
5
|
+
tier: recommended
|
|
6
|
+
title: "Transaction Integrity & Data Precision"
|
|
7
|
+
content: |
|
|
8
|
+
## Transaction Integrity & Financial Data Precision
|
|
9
|
+
|
|
10
|
+
- Never use floating-point types for monetary values. Use fixed-precision decimal types (e.g., `Decimal`, `BigDecimal`, `NUMERIC(19,4)`) or integer minor units (cents/pips) throughout the entire stack.
|
|
11
|
+
- Ensure all financial operations are ACID-compliant. Use database transactions with appropriate isolation levels (at minimum READ COMMITTED; use SERIALIZABLE for balance mutations).
|
|
12
|
+
- Implement double-entry bookkeeping: every transaction creates at least two ledger entries (debit and credit) that sum to zero. Validate this invariant on every write.
|
|
13
|
+
- Make all transaction processing idempotent using client-supplied idempotency keys. Retry-safe APIs prevent duplicate charges or transfers.
|
|
14
|
+
- Record immutable transaction history. Financial records are append-only; corrections are modeled as reversing entries, never as in-place updates or deletes.
|
|
15
|
+
- Perform end-of-day reconciliation between internal ledgers and external payment processor/bank records. Alert immediately on any discrepancy.
|
|
16
|
+
- Store and display all monetary amounts with their ISO 4217 currency code. Never assume a default currency.
|
|
17
|
+
|
|
18
|
+
- id: audit-compliance
|
|
19
|
+
tier: recommended
|
|
20
|
+
title: "Audit Trails & Regulatory Compliance"
|
|
21
|
+
content: |
|
|
22
|
+
## Audit Trails & Regulatory Compliance
|
|
23
|
+
|
|
24
|
+
- Maintain a tamper-evident, append-only audit log for every state change to accounts, transactions, and user permissions. Include actor, timestamp, old value, new value, and IP address.
|
|
25
|
+
- Implement PCI-DSS controls if handling cardholder data: network segmentation, encryption, access logging, vulnerability scanning, and annual compliance assessments.
|
|
26
|
+
- Mask or tokenize sensitive financial identifiers (account numbers, SSNs, card PANs) in logs, error messages, and non-production environments.
|
|
27
|
+
- Enforce KYC/AML checks at onboarding and on an ongoing basis. Integrate with identity verification and sanctions screening providers via well-defined service boundaries.
|
|
28
|
+
- Retain financial records and audit logs for the period required by applicable regulations (typically 5-7 years). Automate archival and ensure archived data remains queryable for audits.
|
|
29
|
+
- Design for regulatory reporting: build data models and pipelines that can produce required reports (SAR, CTR, regulatory filings) with minimal manual intervention.
|
|
30
|
+
|
|
31
|
+
- id: security-resilience
|
|
32
|
+
tier: recommended
|
|
33
|
+
title: "Security & Operational Resilience"
|
|
34
|
+
content: |
|
|
35
|
+
## Security & Operational Resilience
|
|
36
|
+
|
|
37
|
+
- Implement multi-factor authentication for all user-facing financial operations above a configurable threshold (e.g., transfers > $500).
|
|
38
|
+
- Apply velocity checks and fraud detection rules: flag unusual transaction volumes, amounts, geographies, or timing patterns for review before processing.
|
|
39
|
+
- Use cryptographic signing (HMAC or asymmetric signatures) for all webhook payloads, inter-service financial messages, and API requests to prevent tampering.
|
|
40
|
+
- Design for graceful degradation: if an external payment provider is unavailable, queue transactions for retry rather than failing the user experience entirely.
|
|
41
|
+
- Maintain a disaster recovery plan with RPO < 1 hour and RTO < 4 hours for critical financial services. Test failover procedures quarterly.
|
|
42
|
+
- Separate read and write paths for high-throughput systems. Use CQRS to ensure reporting queries never contend with transaction processing.
|
|
43
|
+
|
|
44
|
+
- id: simulation-invariants
|
|
45
|
+
tier: recommended
|
|
46
|
+
title: "Financial Simulation & Backtesting Invariants"
|
|
47
|
+
content: |
|
|
48
|
+
## Financial Simulation & Backtesting Invariants
|
|
49
|
+
|
|
50
|
+
Financial simulations fail in two directions, both silently. Name them explicitly
|
|
51
|
+
so every engineer on the team recognizes the pattern immediately.
|
|
52
|
+
|
|
53
|
+
### Category A — Silent Loss Bugs (strategy runs, earns nothing)
|
|
54
|
+
|
|
55
|
+
These bugs produce flat or zero P&L while the simulation completes without error.
|
|
56
|
+
The strategy appears to have run. It did not.
|
|
57
|
+
|
|
58
|
+
**1. P&L decomposition invariant**
|
|
59
|
+
At finalize: `fee_income + price_income == total_pnl ± 1%`.
|
|
60
|
+
A gap larger than 1% means an accounting component is unlinked — it exists
|
|
61
|
+
in the ledger but never flows into the reported total.
|
|
62
|
+
|
|
63
|
+
**2. Fee-time ratio**
|
|
64
|
+
Fees must be proportional to active simulation time. Near-zero fees after
|
|
65
|
+
1000 hours of "running" means the instrument was never created. The strategy
|
|
66
|
+
ran against nothing. Check: `total_fees / active_hours < threshold` → flag.
|
|
67
|
+
|
|
68
|
+
**3. State concentration**
|
|
69
|
+
If >80% of simulation time is spent in a single non-productive state
|
|
70
|
+
(e.g. `crash_short`, `emergency`, `waiting`), the state machine is stuck.
|
|
71
|
+
A stuck machine is not a conservative strategy — it is a broken one.
|
|
72
|
+
Surface this in finalize as a warning, not a footnote.
|
|
73
|
+
|
|
74
|
+
### Category B — Silent Gain Bugs (inflated returns from accounting errors)
|
|
75
|
+
|
|
76
|
+
These bugs produce plausible-looking positive returns. They are harder to catch
|
|
77
|
+
because the output looks like a win.
|
|
78
|
+
|
|
79
|
+
**4. Return plausibility**
|
|
80
|
+
For a market-neutral strategy: annual return >200% or `total_pnl / fee_income >10×`
|
|
81
|
+
is almost certainly a bug, not alpha. Fee income is ground truth of actual activity.
|
|
82
|
+
A strategy that earns 10× its fees in price income has a broken hedge or look-ahead leak.
|
|
83
|
+
|
|
84
|
+
**5. Delta neutrality**
|
|
85
|
+
Track `avg |net_delta|` while in the primary running state.
|
|
86
|
+
High average delta = the hedge is broken, bootstrapped incorrectly, or bypassed.
|
|
87
|
+
This check surfaces bootstrap order bugs that only appear mid-simulation.
|
|
88
|
+
|
|
89
|
+
**6. Instrument balance**
|
|
90
|
+
Sub-strategies should be sized proportionally per the allocation spec.
|
|
91
|
+
If one instrument is 5× larger than another at finalize, allocation logic failed.
|
|
92
|
+
Check: `max(instrument_notionals) / min(instrument_notionals) > 3× → warn`.
|
|
93
|
+
|
|
94
|
+
### Integration requirements
|
|
95
|
+
|
|
96
|
+
- All 6 checks run in the harness `finalize()` step, printing alongside standard metrics.
|
|
97
|
+
- Failed invariants logged as `[INVARIANT FAIL]` — not swallowed as warnings.
|
|
98
|
+
- Checks are parameterized: thresholds in config, not hardcoded.
|
|
99
|
+
- All 6 checks have unit tests with synthetic data that triggers each failure mode.
|
|
100
|
+
|
|
101
|
+
### Volatility unit convention
|
|
102
|
+
|
|
103
|
+
Unit confusion in vol calculations is the single most common source of both false crash
|
|
104
|
+
triggers and missed recovery conditions in DeFi and market-neutral strategies.
|
|
105
|
+
|
|
106
|
+
- Vol fields stored as `percentage_per_period` must never be re-transformed with
|
|
107
|
+
`/ sqrt(N)` or `* 100` after storage. Storing already-scaled vol and scaling again
|
|
108
|
+
= off by 10×–100× with no runtime error.
|
|
109
|
+
- Label every vol field with its unit in the variable name or type alias:
|
|
110
|
+
`vol_pct_per_day`, `sigma_annual` — never just `vol` or `sigma`.
|
|
111
|
+
- Annualization convention must be a named constant: `TRADING_DAYS_PER_YEAR = 252`
|
|
112
|
+
(or 365, or actual — choose one, name it, use it everywhere).
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
tag: FINTECH
|
|
2
|
-
section: mcp-servers
|
|
3
|
-
servers:
|
|
4
|
-
- name: stripe
|
|
5
|
-
description: "Stripe API integration — payments, subscriptions, invoices, and customer management"
|
|
6
|
-
command: npx
|
|
7
|
-
args: ["-y", "@stripe/mcp-server"]
|
|
8
|
-
tags: [FINTECH]
|
|
9
|
-
category: general
|
|
10
|
-
tier: recommended
|
|
11
|
-
env:
|
|
12
|
-
STRIPE_SECRET_KEY: ""
|
|
13
|
-
url: "https://github.com/stripe/agent-toolkit"
|
|
1
|
+
tag: FINTECH
|
|
2
|
+
section: mcp-servers
|
|
3
|
+
servers:
|
|
4
|
+
- name: stripe
|
|
5
|
+
description: "Stripe API integration — payments, subscriptions, invoices, and customer management"
|
|
6
|
+
command: npx
|
|
7
|
+
args: ["-y", "@stripe/mcp-server"]
|
|
8
|
+
tags: [FINTECH]
|
|
9
|
+
category: general
|
|
10
|
+
tier: recommended
|
|
11
|
+
env:
|
|
12
|
+
STRIPE_SECRET_KEY: ""
|
|
13
|
+
url: "https://github.com/stripe/agent-toolkit"
|