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.
Files changed (418) hide show
  1. package/LICENSE +67 -0
  2. package/README.md +527 -525
  3. package/dist/analyzers/anchors/anchor-loader.d.ts +47 -0
  4. package/dist/analyzers/anchors/anchor-loader.d.ts.map +1 -0
  5. package/dist/analyzers/anchors/anchor-loader.js +113 -0
  6. package/dist/analyzers/anchors/anchor-loader.js.map +1 -0
  7. package/dist/analyzers/anti-pattern.d.ts.map +1 -1
  8. package/dist/analyzers/anti-pattern.js +38 -26
  9. package/dist/analyzers/anti-pattern.js.map +1 -1
  10. package/dist/analyzers/completeness-helpers.d.ts +5 -0
  11. package/dist/analyzers/completeness-helpers.d.ts.map +1 -1
  12. package/dist/analyzers/completeness-helpers.js +17 -0
  13. package/dist/analyzers/completeness-helpers.js.map +1 -1
  14. package/dist/analyzers/completeness.d.ts.map +1 -1
  15. package/dist/analyzers/completeness.js +4 -4
  16. package/dist/analyzers/completeness.js.map +1 -1
  17. package/dist/analyzers/gs-scorer.d.ts +3 -1
  18. package/dist/analyzers/gs-scorer.d.ts.map +1 -1
  19. package/dist/analyzers/gs-scorer.js +5 -2
  20. package/dist/analyzers/gs-scorer.js.map +1 -1
  21. package/dist/analyzers/package-json.d.ts.map +1 -1
  22. package/dist/analyzers/package-json.js +194 -34
  23. package/dist/analyzers/package-json.js.map +1 -1
  24. package/dist/analyzers/scorers/composable-scorer.d.ts +4 -2
  25. package/dist/analyzers/scorers/composable-scorer.d.ts.map +1 -1
  26. package/dist/analyzers/scorers/composable-scorer.js +50 -2
  27. package/dist/analyzers/scorers/composable-scorer.js.map +1 -1
  28. package/dist/analyzers/scorers/executable-scorer.d.ts +3 -2
  29. package/dist/analyzers/scorers/executable-scorer.d.ts.map +1 -1
  30. package/dist/analyzers/scorers/executable-scorer.js +64 -4
  31. package/dist/analyzers/scorers/executable-scorer.js.map +1 -1
  32. package/dist/analyzers/scorers/scorer-utils.d.ts +5 -3
  33. package/dist/analyzers/scorers/scorer-utils.d.ts.map +1 -1
  34. package/dist/analyzers/scorers/scorer-utils.js +34 -9
  35. package/dist/analyzers/scorers/scorer-utils.js.map +1 -1
  36. package/dist/analyzers/scorers/self-describing-scorer.d.ts +7 -4
  37. package/dist/analyzers/scorers/self-describing-scorer.d.ts.map +1 -1
  38. package/dist/analyzers/scorers/self-describing-scorer.js +17 -18
  39. package/dist/analyzers/scorers/self-describing-scorer.js.map +1 -1
  40. package/dist/cli/help.js +51 -51
  41. package/dist/disciplines/catalog.d.ts +16 -0
  42. package/dist/disciplines/catalog.d.ts.map +1 -0
  43. package/dist/disciplines/catalog.js +196 -0
  44. package/dist/disciplines/catalog.js.map +1 -0
  45. package/dist/disciplines/runner.d.ts +13 -0
  46. package/dist/disciplines/runner.d.ts.map +1 -0
  47. package/dist/disciplines/runner.js +35 -0
  48. package/dist/disciplines/runner.js.map +1 -0
  49. package/dist/registry/composer.d.ts.map +1 -1
  50. package/dist/registry/composer.js +9 -4
  51. package/dist/registry/composer.js.map +1 -1
  52. package/dist/registry/loader-tag.d.ts.map +1 -1
  53. package/dist/registry/loader-tag.js +1 -0
  54. package/dist/registry/loader-tag.js.map +1 -1
  55. package/dist/registry/remote-gates.js +1 -1
  56. package/dist/registry/remote-gates.js.map +1 -1
  57. package/dist/registry/renderer-skeletons.js +92 -92
  58. package/dist/registry/sentinel-renderer.js +299 -20
  59. package/dist/registry/sentinel-renderer.js.map +1 -1
  60. package/dist/sentinel/detect.d.ts +41 -0
  61. package/dist/sentinel/detect.d.ts.map +1 -0
  62. package/dist/sentinel/detect.js +122 -0
  63. package/dist/sentinel/detect.js.map +1 -0
  64. package/dist/sentinel/write.d.ts +54 -0
  65. package/dist/sentinel/write.d.ts.map +1 -0
  66. package/dist/sentinel/write.js +75 -0
  67. package/dist/sentinel/write.js.map +1 -0
  68. package/dist/shared/cnt-health.d.ts +16 -0
  69. package/dist/shared/cnt-health.d.ts.map +1 -1
  70. package/dist/shared/cnt-health.js +55 -8
  71. package/dist/shared/cnt-health.js.map +1 -1
  72. package/dist/shared/config.d.ts +14 -0
  73. package/dist/shared/config.d.ts.map +1 -1
  74. package/dist/shared/config.js +45 -0
  75. package/dist/shared/config.js.map +1 -1
  76. package/dist/shared/gs-score-logger.js +6 -6
  77. package/dist/shared/hook-installer.d.ts +58 -0
  78. package/dist/shared/hook-installer.d.ts.map +1 -0
  79. package/dist/shared/hook-installer.js +316 -0
  80. package/dist/shared/hook-installer.js.map +1 -0
  81. package/dist/shared/project-gates-helpers.d.ts +9 -0
  82. package/dist/shared/project-gates-helpers.d.ts.map +1 -1
  83. package/dist/shared/project-gates-helpers.js +35 -0
  84. package/dist/shared/project-gates-helpers.js.map +1 -1
  85. package/dist/shared/types/config.d.ts +7 -1
  86. package/dist/shared/types/config.d.ts.map +1 -1
  87. package/dist/shared/types/gates.d.ts +34 -0
  88. package/dist/shared/types/gates.d.ts.map +1 -1
  89. package/dist/shared/types/project.d.ts +68 -2
  90. package/dist/shared/types/project.d.ts.map +1 -1
  91. package/dist/shared/types/project.js +1 -0
  92. package/dist/shared/types/project.js.map +1 -1
  93. package/dist/shared/types/templates.d.ts +8 -1
  94. package/dist/shared/types/templates.d.ts.map +1 -1
  95. package/dist/shared/types/verify.d.ts +51 -1
  96. package/dist/shared/types/verify.d.ts.map +1 -1
  97. package/dist/shared/types/verify.js +37 -1
  98. package/dist/shared/types/verify.js.map +1 -1
  99. package/dist/tools/add-hook.d.ts.map +1 -1
  100. package/dist/tools/add-hook.js +8 -1
  101. package/dist/tools/add-hook.js.map +1 -1
  102. package/dist/tools/add-module.js +123 -123
  103. package/dist/tools/advice-registry.d.ts.map +1 -1
  104. package/dist/tools/advice-registry.js +108 -18
  105. package/dist/tools/advice-registry.js.map +1 -1
  106. package/dist/tools/advise-session-advisor.d.ts +16 -0
  107. package/dist/tools/advise-session-advisor.d.ts.map +1 -0
  108. package/dist/tools/advise-session-advisor.js +89 -0
  109. package/dist/tools/advise-session-advisor.js.map +1 -0
  110. package/dist/tools/advise-session-signals.d.ts +21 -0
  111. package/dist/tools/advise-session-signals.d.ts.map +1 -0
  112. package/dist/tools/advise-session-signals.js +113 -0
  113. package/dist/tools/advise-session-signals.js.map +1 -0
  114. package/dist/tools/advise-session.d.ts +22 -0
  115. package/dist/tools/advise-session.d.ts.map +1 -0
  116. package/dist/tools/advise-session.js +31 -0
  117. package/dist/tools/advise-session.js.map +1 -0
  118. package/dist/tools/analyze-harness.d.ts +18 -0
  119. package/dist/tools/analyze-harness.d.ts.map +1 -0
  120. package/dist/tools/analyze-harness.js +298 -0
  121. package/dist/tools/analyze-harness.js.map +1 -0
  122. package/dist/tools/audit.d.ts.map +1 -1
  123. package/dist/tools/audit.js +19 -0
  124. package/dist/tools/audit.js.map +1 -1
  125. package/dist/tools/change-request.d.ts +53 -0
  126. package/dist/tools/change-request.d.ts.map +1 -0
  127. package/dist/tools/change-request.js +395 -0
  128. package/dist/tools/change-request.js.map +1 -0
  129. package/dist/tools/check-cascade-contracts.d.ts +13 -0
  130. package/dist/tools/check-cascade-contracts.d.ts.map +1 -1
  131. package/dist/tools/check-cascade-contracts.js +73 -2
  132. package/dist/tools/check-cascade-contracts.js.map +1 -1
  133. package/dist/tools/check-cascade-report.js +64 -64
  134. package/dist/tools/check-cascade-steps.d.ts +3 -0
  135. package/dist/tools/check-cascade-steps.d.ts.map +1 -1
  136. package/dist/tools/check-cascade-steps.js +104 -15
  137. package/dist/tools/check-cascade-steps.js.map +1 -1
  138. package/dist/tools/check-cascade.d.ts +4 -3
  139. package/dist/tools/check-cascade.d.ts.map +1 -1
  140. package/dist/tools/check-cascade.js +30 -12
  141. package/dist/tools/check-cascade.js.map +1 -1
  142. package/dist/tools/check-derivation-chain.d.ts +37 -0
  143. package/dist/tools/check-derivation-chain.d.ts.map +1 -0
  144. package/dist/tools/check-derivation-chain.js +418 -0
  145. package/dist/tools/check-derivation-chain.js.map +1 -0
  146. package/dist/tools/check-spec-consistency.d.ts +25 -0
  147. package/dist/tools/check-spec-consistency.d.ts.map +1 -0
  148. package/dist/tools/check-spec-consistency.js +339 -0
  149. package/dist/tools/check-spec-consistency.js.map +1 -0
  150. package/dist/tools/check-t4.d.ts +54 -0
  151. package/dist/tools/check-t4.d.ts.map +1 -0
  152. package/dist/tools/check-t4.js +305 -0
  153. package/dist/tools/check-t4.js.map +1 -0
  154. package/dist/tools/close-cycle.d.ts +11 -0
  155. package/dist/tools/close-cycle.d.ts.map +1 -1
  156. package/dist/tools/close-cycle.js +364 -4
  157. package/dist/tools/close-cycle.js.map +1 -1
  158. package/dist/tools/cnt-add-routing.d.ts +31 -0
  159. package/dist/tools/cnt-add-routing.d.ts.map +1 -0
  160. package/dist/tools/cnt-add-routing.js +99 -0
  161. package/dist/tools/cnt-add-routing.js.map +1 -0
  162. package/dist/tools/configure-mcp.d.ts.map +1 -1
  163. package/dist/tools/configure-mcp.js +52 -2
  164. package/dist/tools/configure-mcp.js.map +1 -1
  165. package/dist/tools/consolidate-status.d.ts +31 -0
  166. package/dist/tools/consolidate-status.d.ts.map +1 -1
  167. package/dist/tools/consolidate-status.js +105 -0
  168. package/dist/tools/consolidate-status.js.map +1 -1
  169. package/dist/tools/executable-gates.d.ts +52 -0
  170. package/dist/tools/executable-gates.d.ts.map +1 -0
  171. package/dist/tools/executable-gates.js +333 -0
  172. package/dist/tools/executable-gates.js.map +1 -0
  173. package/dist/tools/extract-adrs-from-spec.d.ts +33 -0
  174. package/dist/tools/extract-adrs-from-spec.d.ts.map +1 -0
  175. package/dist/tools/extract-adrs-from-spec.js +410 -0
  176. package/dist/tools/extract-adrs-from-spec.js.map +1 -0
  177. package/dist/tools/extract-adrs-history.d.ts +47 -0
  178. package/dist/tools/extract-adrs-history.d.ts.map +1 -0
  179. package/dist/tools/extract-adrs-history.js +265 -0
  180. package/dist/tools/extract-adrs-history.js.map +1 -0
  181. package/dist/tools/forgecraft-dispatch-extended.d.ts.map +1 -1
  182. package/dist/tools/forgecraft-dispatch-extended.js +137 -0
  183. package/dist/tools/forgecraft-dispatch-extended.js.map +1 -1
  184. package/dist/tools/forgecraft-dispatch.d.ts.map +1 -1
  185. package/dist/tools/forgecraft-dispatch.js +16 -0
  186. package/dist/tools/forgecraft-dispatch.js.map +1 -1
  187. package/dist/tools/forgecraft-schema-params.d.ts +174 -2
  188. package/dist/tools/forgecraft-schema-params.d.ts.map +1 -1
  189. package/dist/tools/forgecraft-schema-params.js +197 -0
  190. package/dist/tools/forgecraft-schema-params.js.map +1 -1
  191. package/dist/tools/forgecraft-schema.d.ts +179 -7
  192. package/dist/tools/forgecraft-schema.d.ts.map +1 -1
  193. package/dist/tools/forgecraft-schema.js +37 -0
  194. package/dist/tools/forgecraft-schema.js.map +1 -1
  195. package/dist/tools/generate-adr.js +6 -6
  196. package/dist/tools/generate-adr.js.map +1 -1
  197. package/dist/tools/generate-decision.d.ts +77 -0
  198. package/dist/tools/generate-decision.d.ts.map +1 -0
  199. package/dist/tools/generate-decision.js +162 -0
  200. package/dist/tools/generate-decision.js.map +1 -0
  201. package/dist/tools/generate-env-probe.d.ts +49 -0
  202. package/dist/tools/generate-env-probe.d.ts.map +1 -0
  203. package/dist/tools/generate-env-probe.js +365 -0
  204. package/dist/tools/generate-env-probe.js.map +1 -0
  205. package/dist/tools/generate-harness.d.ts +53 -0
  206. package/dist/tools/generate-harness.d.ts.map +1 -0
  207. package/dist/tools/generate-harness.js +395 -0
  208. package/dist/tools/generate-harness.js.map +1 -0
  209. package/dist/tools/generate-roadmap.d.ts +1 -1
  210. package/dist/tools/generate-roadmap.d.ts.map +1 -1
  211. package/dist/tools/generate-roadmap.js +38 -4
  212. package/dist/tools/generate-roadmap.js.map +1 -1
  213. package/dist/tools/generate-session-prompt.d.ts +3 -3
  214. package/dist/tools/generate-session-prompt.d.ts.map +1 -1
  215. package/dist/tools/generate-session-prompt.js +9 -1
  216. package/dist/tools/generate-session-prompt.js.map +1 -1
  217. package/dist/tools/generate-slo-probe.d.ts +53 -0
  218. package/dist/tools/generate-slo-probe.d.ts.map +1 -0
  219. package/dist/tools/generate-slo-probe.js +366 -0
  220. package/dist/tools/generate-slo-probe.js.map +1 -0
  221. package/dist/tools/layer-status-gates.d.ts +24 -0
  222. package/dist/tools/layer-status-gates.d.ts.map +1 -0
  223. package/dist/tools/layer-status-gates.js +151 -0
  224. package/dist/tools/layer-status-gates.js.map +1 -0
  225. package/dist/tools/layer-status.d.ts +126 -0
  226. package/dist/tools/layer-status.d.ts.map +1 -0
  227. package/dist/tools/layer-status.js +647 -0
  228. package/dist/tools/layer-status.js.map +1 -0
  229. package/dist/tools/list.d.ts.map +1 -1
  230. package/dist/tools/list.js +9 -5
  231. package/dist/tools/list.js.map +1 -1
  232. package/dist/tools/postcondition-coverage.d.ts +57 -0
  233. package/dist/tools/postcondition-coverage.d.ts.map +1 -0
  234. package/dist/tools/postcondition-coverage.js +256 -0
  235. package/dist/tools/postcondition-coverage.js.map +1 -0
  236. package/dist/tools/probe-runners.d.ts +21 -0
  237. package/dist/tools/probe-runners.d.ts.map +1 -0
  238. package/dist/tools/probe-runners.js +246 -0
  239. package/dist/tools/probe-runners.js.map +1 -0
  240. package/dist/tools/probe-templates.d.ts +27 -0
  241. package/dist/tools/probe-templates.d.ts.map +1 -0
  242. package/dist/tools/probe-templates.js +279 -0
  243. package/dist/tools/probe-templates.js.map +1 -0
  244. package/dist/tools/propose-session.d.ts +28 -0
  245. package/dist/tools/propose-session.d.ts.map +1 -0
  246. package/dist/tools/propose-session.js +333 -0
  247. package/dist/tools/propose-session.js.map +1 -0
  248. package/dist/tools/refresh-output.js +14 -14
  249. package/dist/tools/review-stubs.d.ts +29 -0
  250. package/dist/tools/review-stubs.d.ts.map +1 -0
  251. package/dist/tools/review-stubs.js +173 -0
  252. package/dist/tools/review-stubs.js.map +1 -0
  253. package/dist/tools/roadmap-builder.d.ts +49 -1
  254. package/dist/tools/roadmap-builder.d.ts.map +1 -1
  255. package/dist/tools/roadmap-builder.js +210 -5
  256. package/dist/tools/roadmap-builder.js.map +1 -1
  257. package/dist/tools/run-env-probe.d.ts +57 -0
  258. package/dist/tools/run-env-probe.d.ts.map +1 -0
  259. package/dist/tools/run-env-probe.js +270 -0
  260. package/dist/tools/run-env-probe.js.map +1 -0
  261. package/dist/tools/run-harness.d.ts +52 -0
  262. package/dist/tools/run-harness.d.ts.map +1 -0
  263. package/dist/tools/run-harness.js +279 -0
  264. package/dist/tools/run-harness.js.map +1 -0
  265. package/dist/tools/run-slo-probe.d.ts +50 -0
  266. package/dist/tools/run-slo-probe.d.ts.map +1 -0
  267. package/dist/tools/run-slo-probe.js +281 -0
  268. package/dist/tools/run-slo-probe.js.map +1 -0
  269. package/dist/tools/scaffold-spec-stubs.js +115 -115
  270. package/dist/tools/scaffold-templates.js +62 -62
  271. package/dist/tools/scaffold-writer.d.ts.map +1 -1
  272. package/dist/tools/scaffold-writer.js +9 -0
  273. package/dist/tools/scaffold-writer.js.map +1 -1
  274. package/dist/tools/score-rubric.d.ts +19 -0
  275. package/dist/tools/score-rubric.d.ts.map +1 -0
  276. package/dist/tools/score-rubric.js +411 -0
  277. package/dist/tools/score-rubric.js.map +1 -0
  278. package/dist/tools/session-prompt-builders.d.ts +20 -0
  279. package/dist/tools/session-prompt-builders.d.ts.map +1 -1
  280. package/dist/tools/session-prompt-builders.js +78 -5
  281. package/dist/tools/session-prompt-builders.js.map +1 -1
  282. package/dist/tools/session-prompt-sections.d.ts +4 -2
  283. package/dist/tools/session-prompt-sections.d.ts.map +1 -1
  284. package/dist/tools/session-prompt-sections.js +22 -10
  285. package/dist/tools/session-prompt-sections.js.map +1 -1
  286. package/dist/tools/setup-artifact-writers.d.ts +69 -4
  287. package/dist/tools/setup-artifact-writers.d.ts.map +1 -1
  288. package/dist/tools/setup-artifact-writers.js +681 -5
  289. package/dist/tools/setup-artifact-writers.js.map +1 -1
  290. package/dist/tools/setup-cnt-builders.d.ts.map +1 -1
  291. package/dist/tools/setup-cnt-builders.js +162 -34
  292. package/dist/tools/setup-cnt-builders.js.map +1 -1
  293. package/dist/tools/setup-monitoring.d.ts +41 -0
  294. package/dist/tools/setup-monitoring.d.ts.map +1 -0
  295. package/dist/tools/setup-monitoring.js +364 -0
  296. package/dist/tools/setup-monitoring.js.map +1 -0
  297. package/dist/tools/setup-phase1.d.ts.map +1 -1
  298. package/dist/tools/setup-phase1.js +14 -1
  299. package/dist/tools/setup-phase1.js.map +1 -1
  300. package/dist/tools/setup-phase2.d.ts +14 -0
  301. package/dist/tools/setup-phase2.d.ts.map +1 -1
  302. package/dist/tools/setup-phase2.js +130 -3
  303. package/dist/tools/setup-phase2.js.map +1 -1
  304. package/dist/tools/setup-project.d.ts +8 -0
  305. package/dist/tools/setup-project.d.ts.map +1 -1
  306. package/dist/tools/setup-project.js +52 -2
  307. package/dist/tools/setup-project.js.map +1 -1
  308. package/dist/tools/spec-parser-tags.d.ts.map +1 -1
  309. package/dist/tools/spec-parser-tags.js +1 -0
  310. package/dist/tools/spec-parser-tags.js.map +1 -1
  311. package/dist/tools/verify-formatter.d.ts.map +1 -1
  312. package/dist/tools/verify-formatter.js +15 -1
  313. package/dist/tools/verify-formatter.js.map +1 -1
  314. package/dist/tools/verify.d.ts.map +1 -1
  315. package/dist/tools/verify.js +3 -0
  316. package/dist/tools/verify.js.map +1 -1
  317. package/package.json +98 -89
  318. package/templates/analytics/instructions.yaml +37 -37
  319. package/templates/analytics/mcp-servers.yaml +11 -11
  320. package/templates/analytics/structure.yaml +25 -25
  321. package/templates/api/harness/uc-template.hurl +20 -0
  322. package/templates/api/instructions.yaml +231 -231
  323. package/templates/api/mcp-servers.yaml +22 -22
  324. package/templates/api/nfr.yaml +23 -23
  325. package/templates/api/review.yaml +103 -103
  326. package/templates/api/structure.yaml +34 -34
  327. package/templates/api/verification.yaml +132 -132
  328. package/templates/cli/instructions.yaml +31 -31
  329. package/templates/cli/mcp-servers.yaml +11 -11
  330. package/templates/cli/review.yaml +53 -53
  331. package/templates/cli/structure.yaml +16 -16
  332. package/templates/data-lineage/instructions.yaml +28 -28
  333. package/templates/data-lineage/mcp-servers.yaml +22 -22
  334. package/templates/data-pipeline/instructions.yaml +84 -84
  335. package/templates/data-pipeline/mcp-servers.yaml +13 -13
  336. package/templates/data-pipeline/nfr.yaml +39 -39
  337. package/templates/data-pipeline/structure.yaml +23 -23
  338. package/templates/docs-manifest.yaml +227 -0
  339. package/templates/fintech/hooks.yaml +55 -55
  340. package/templates/fintech/instructions.yaml +112 -112
  341. package/templates/fintech/mcp-servers.yaml +13 -13
  342. package/templates/fintech/nfr.yaml +46 -46
  343. package/templates/fintech/playbook.yaml +210 -210
  344. package/templates/fintech/verification.yaml +239 -239
  345. package/templates/game/harness/uc-template.sim.ts +29 -0
  346. package/templates/game/instructions.yaml +289 -289
  347. package/templates/game/mcp-servers.yaml +38 -38
  348. package/templates/game/nfr.yaml +64 -64
  349. package/templates/game/playbook.yaml +214 -214
  350. package/templates/game/review.yaml +97 -97
  351. package/templates/game/structure.yaml +67 -67
  352. package/templates/game/verification.yaml +174 -174
  353. package/templates/healthcare/instructions.yaml +42 -42
  354. package/templates/healthcare/mcp-servers.yaml +13 -13
  355. package/templates/healthcare/nfr.yaml +47 -47
  356. package/templates/hipaa/instructions.yaml +41 -41
  357. package/templates/hipaa/mcp-servers.yaml +13 -13
  358. package/templates/infra/instructions.yaml +104 -104
  359. package/templates/infra/mcp-servers.yaml +20 -20
  360. package/templates/infra/nfr.yaml +46 -46
  361. package/templates/infra/review.yaml +65 -65
  362. package/templates/infra/structure.yaml +25 -25
  363. package/templates/library/instructions.yaml +36 -36
  364. package/templates/library/mcp-servers.yaml +20 -20
  365. package/templates/library/review.yaml +56 -56
  366. package/templates/library/structure.yaml +19 -19
  367. package/templates/medallion-architecture/instructions.yaml +41 -41
  368. package/templates/medallion-architecture/mcp-servers.yaml +22 -22
  369. package/templates/ml/instructions.yaml +85 -85
  370. package/templates/ml/mcp-servers.yaml +11 -11
  371. package/templates/ml/nfr.yaml +39 -39
  372. package/templates/ml/structure.yaml +25 -25
  373. package/templates/ml/verification.yaml +156 -156
  374. package/templates/mobile/instructions.yaml +44 -44
  375. package/templates/mobile/mcp-servers.yaml +11 -11
  376. package/templates/mobile/nfr.yaml +49 -49
  377. package/templates/mobile/structure.yaml +27 -27
  378. package/templates/mobile/verification.yaml +121 -121
  379. package/templates/observability-xray/instructions.yaml +40 -40
  380. package/templates/observability-xray/mcp-servers.yaml +15 -15
  381. package/templates/realtime/instructions.yaml +42 -42
  382. package/templates/realtime/mcp-servers.yaml +13 -13
  383. package/templates/soc2/instructions.yaml +41 -41
  384. package/templates/soc2/mcp-servers.yaml +24 -24
  385. package/templates/social/instructions.yaml +43 -43
  386. package/templates/social/mcp-servers.yaml +24 -24
  387. package/templates/state-machine/instructions.yaml +42 -42
  388. package/templates/state-machine/mcp-servers.yaml +11 -11
  389. package/templates/tools-registry.yaml +164 -164
  390. package/templates/universal/claude-md-blocks/layer-navigation.md +20 -0
  391. package/templates/universal/claude-md-blocks/nfr-contracts.md +22 -0
  392. package/templates/universal/hooks.yaml +879 -723
  393. package/templates/universal/instructions.yaml +1692 -1692
  394. package/templates/universal/mcp-servers.yaml +50 -50
  395. package/templates/universal/nfr.yaml +197 -197
  396. package/templates/universal/reference.yaml +326 -326
  397. package/templates/universal/review.yaml +204 -204
  398. package/templates/universal/skills.yaml +262 -262
  399. package/templates/universal/structure.yaml +67 -67
  400. package/templates/universal/verification.yaml +416 -416
  401. package/templates/web-next/hooks.yaml +114 -0
  402. package/templates/web-next/instructions.yaml +106 -0
  403. package/templates/web-react/harness/uc-template.spec.ts +35 -0
  404. package/templates/web-react/hooks.yaml +156 -44
  405. package/templates/web-react/instructions.yaml +296 -207
  406. package/templates/web-react/mcp-servers.yaml +20 -20
  407. package/templates/web-react/nfr.yaml +27 -27
  408. package/templates/web-react/review.yaml +94 -94
  409. package/templates/web-react/structure.yaml +46 -46
  410. package/templates/web-react/verification.yaml +126 -126
  411. package/templates/web-static/hooks.yaml +85 -0
  412. package/templates/web-static/instructions.yaml +204 -115
  413. package/templates/web-static/mcp-servers.yaml +20 -20
  414. package/templates/web3/instructions.yaml +44 -44
  415. package/templates/web3/mcp-servers.yaml +11 -11
  416. package/templates/web3/verification.yaml +159 -159
  417. package/templates/zero-trust/instructions.yaml +41 -41
  418. 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"