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,46 +1,46 @@
1
- tag: FINTECH
2
- section: nfr
3
- blocks:
4
- - id: fintech-transaction-integrity
5
- tier: recommended
6
- title: "Transaction Integrity"
7
- content: |
8
- ## NFR: Transaction Integrity
9
-
10
- ### ACID Compliance
11
- - All financial operations wrapped in database transactions.
12
- - Double-entry bookkeeping: every debit has a corresponding credit. Ledger always balances.
13
- - Idempotency keys on all payment operations — retries must not duplicate charges.
14
-
15
- ### Precision
16
- - NO floating-point arithmetic for monetary values. Use integer cents, BigDecimal, or Decimal types.
17
- - Currency stored alongside amount. No implicit currency assumptions.
18
- - Rounding rules documented and consistent with regulatory requirements.
19
-
20
- ### Reconciliation
21
- - Automated reconciliation between internal ledger and external payment providers.
22
- - Reconciliation frequency: {{reconciliation_frequency | default: daily}}.
23
- - Discrepancies alerted within 1 hour. Unresolved discrepancies escalated.
24
-
25
- - id: fintech-compliance
26
- tier: recommended
27
- title: "Financial Compliance"
28
- content: |
29
- ## NFR: Financial Compliance
30
-
31
- ### Regulatory
32
- - PCI DSS compliance for card data handling. No raw card numbers stored — tokenize.
33
- - KYC/AML processes integrated where required. Document which regulations apply.
34
- - SOC 2 Type II audit trail: all access to financial data logged and retained.
35
-
36
- ### Audit Trail
37
- - Immutable audit log for every financial transaction.
38
- - Log contains: timestamp, actor, operation, before/after state, correlation ID.
39
- - Retention: minimum {{audit_retention | default: 7 years}} per regulatory requirements.
40
- - Audit logs stored separately, tamper-evident (append-only, hashed).
41
-
42
- ### Disaster Recovery
43
- - RPO for financial data: < {{fintech_rpo | default: 5 minutes}}.
44
- - RTO: < {{fintech_rto | default: 1 hour}}.
45
- - Point-in-time recovery to any second within retention window.
46
- - DR drill: quarterly, documented, measured.
1
+ tag: FINTECH
2
+ section: nfr
3
+ blocks:
4
+ - id: fintech-transaction-integrity
5
+ tier: recommended
6
+ title: "Transaction Integrity"
7
+ content: |
8
+ ## NFR: Transaction Integrity
9
+
10
+ ### ACID Compliance
11
+ - All financial operations wrapped in database transactions.
12
+ - Double-entry bookkeeping: every debit has a corresponding credit. Ledger always balances.
13
+ - Idempotency keys on all payment operations — retries must not duplicate charges.
14
+
15
+ ### Precision
16
+ - NO floating-point arithmetic for monetary values. Use integer cents, BigDecimal, or Decimal types.
17
+ - Currency stored alongside amount. No implicit currency assumptions.
18
+ - Rounding rules documented and consistent with regulatory requirements.
19
+
20
+ ### Reconciliation
21
+ - Automated reconciliation between internal ledger and external payment providers.
22
+ - Reconciliation frequency: {{reconciliation_frequency | default: daily}}.
23
+ - Discrepancies alerted within 1 hour. Unresolved discrepancies escalated.
24
+
25
+ - id: fintech-compliance
26
+ tier: recommended
27
+ title: "Financial Compliance"
28
+ content: |
29
+ ## NFR: Financial Compliance
30
+
31
+ ### Regulatory
32
+ - PCI DSS compliance for card data handling. No raw card numbers stored — tokenize.
33
+ - KYC/AML processes integrated where required. Document which regulations apply.
34
+ - SOC 2 Type II audit trail: all access to financial data logged and retained.
35
+
36
+ ### Audit Trail
37
+ - Immutable audit log for every financial transaction.
38
+ - Log contains: timestamp, actor, operation, before/after state, correlation ID.
39
+ - Retention: minimum {{audit_retention | default: 7 years}} per regulatory requirements.
40
+ - Audit logs stored separately, tamper-evident (append-only, hashed).
41
+
42
+ ### Disaster Recovery
43
+ - RPO for financial data: < {{fintech_rpo | default: 5 minutes}}.
44
+ - RTO: < {{fintech_rto | default: 1 hour}}.
45
+ - Point-in-time recovery to any second within retention window.
46
+ - DR drill: quarterly, documented, measured.
@@ -1,210 +1,210 @@
1
- tag: FINTECH
2
- section: playbook
3
- title: "Quantitative Model Development Pipeline"
4
- description: >
5
- A structured, agent-driven pipeline for building production-grade financial models.
6
- Covers formula research and selection, state-machine design, parametrization,
7
- heuristic search with pruning, and simulation with insight distillation.
8
- Run this playbook before writing any pricing, risk, or execution model code.
9
-
10
- phases:
11
-
12
- - id: formula-research
13
- title: "Formula Research & Selection"
14
- rationale: >
15
- The agent must survey the domain literature first — using web search, arxiv,
16
- and internal docs — before choosing a model. Committing to the wrong formula
17
- is the most expensive mistake in quant work.
18
- steps:
19
- - id: enumerate-candidates
20
- instruction: >
21
- Search academic and industry sources for all formulas/models relevant
22
- to the problem domain (e.g., pricing, risk, signal generation).
23
- Produce a candidate list with: name, formula notation, assumptions, and original source.
24
- expected_output: "Markdown table: Name | Formula | Key Assumptions | Source"
25
- tools: ["web_search", "fetch_webpage"]
26
-
27
- - id: evaluate-candidates
28
- instruction: >
29
- Score each candidate on: mathematical tractability, data requirements,
30
- known failure modes, computational cost, and regulatory acceptability.
31
- Eliminate candidates that fail hard constraints (e.g., negative price assumption).
32
- expected_output: "Scored comparison table; candidates ranked with pass/fail on hard constraints"
33
- tools: ["web_search"]
34
-
35
- - id: select-and-justify
36
- instruction: >
37
- Select the winning formula. Write a one-page justification covering:
38
- why it beats alternatives, what it assumes, and what conditions would
39
- invalidate it. This becomes ADR content.
40
- expected_output: "ADR draft with title, status=Proposed, context, decision, consequences"
41
-
42
- - id: state-machine-design
43
- title: "State Machine Design"
44
- rationale: >
45
- Financial workflows (order lifecycle, position states, settlement stages)
46
- are inherently state machines. Formalising them before code prevents
47
- impossible state transitions, race conditions, and audit gaps.
48
- steps:
49
- - id: enumerate-states
50
- instruction: >
51
- List every possible state for the entity (e.g., order: NEW, PENDING, PARTIALLY_FILLED,
52
- FILLED, CANCELLED, REJECTED, EXPIRED). For each state, describe: what it means,
53
- who/what causes entry, and what invariants must hold while in this state.
54
- expected_output: "States table: State | Entry Condition | Invariants | Exit Triggers"
55
-
56
- - id: enumerate-transitions
57
- instruction: >
58
- For each state, enumerate all valid transitions and the events/guards that trigger them.
59
- Mark transitions that require idempotency guarantees or external settlement confirmation.
60
- expected_output: "Transition table: From | Event | Guard | To | Side Effects"
61
-
62
- - id: draw-diagram
63
- instruction: >
64
- Generate a Mermaid stateDiagram-v2 diagram from the state and transition tables.
65
- Include notes on parallel states or guard conditions where relevant.
66
- expected_output: "Mermaid stateDiagram-v2 code block that compiles without errors"
67
- tools: ["run_in_terminal"]
68
-
69
- - id: validate-completeness
70
- instruction: >
71
- Verify the diagram satisfies: (1) no dead-end states except terminal ones,
72
- (2) every state reachable from the initial state, (3) every external event handled.
73
- Flag any gaps.
74
- expected_output: "Completeness checklist: pass/fail per criterion; gaps listed"
75
-
76
- - id: parametrization
77
- title: "Model Parametrization"
78
- rationale: >
79
- Hard-coded constants are a maintenance liability and a back-test overfitting risk.
80
- Every numeric knob must be named, typed, range-validated, and externally configurable.
81
- steps:
82
- - id: extract-parameters
83
- instruction: >
84
- From the selected formula and state machine, extract every numeric constant
85
- or threshold. For each: name it, specify its type (rate, multiplier, count,
86
- duration), its valid range, and its economic meaning.
87
- expected_output: "Parameter registry table: Name | Type | Valid Range | Default | Meaning"
88
-
89
- - id: design-config-schema
90
- instruction: >
91
- Define a Zod (or Pydantic) schema for the full parameter set.
92
- Include range validators, cross-parameter constraints (e.g., stop_loss < take_profit),
93
- and environment-specific override docs.
94
- expected_output: "Schema source file with all validators and inline JSDoc"
95
-
96
- - id: sensitivity-matrix
97
- instruction: >
98
- For each parameter, estimate first-order sensitivity: how much does the model
99
- output change for a ±10% change in the parameter? Identify the top 3 most
100
- sensitive parameters — these need the tightest validation and monitoring.
101
- expected_output: "Sensitivity table: Parameter | Δ+10% impact | Δ-10% impact | Risk rank"
102
-
103
- - id: heuristic-search
104
- title: "Heuristic Search with Pruning"
105
- rationale: >
106
- Exhaustive grid search over parameter space is computationally prohibitive.
107
- Structured heuristic search (Bayesian optimisation, evolutionary algorithms,
108
- or domain-guided hill climbing) with aggressive pruning finds good solutions
109
- orders of magnitude faster.
110
- steps:
111
- - id: define-objective
112
- instruction: >
113
- Define the objective function: what scalar metric are we optimising?
114
- (Sharpe ratio, max drawdown %, expected profit per unit risk, etc.)
115
- Document: formula, units, whether higher or lower is better, and any
116
- multi-objective tradeoff weights.
117
- expected_output: "Objective function definition with formula, direction, and tradeoff weights"
118
-
119
- - id: select-search-strategy
120
- instruction: >
121
- Choose a search strategy appropriate to parameter count and evaluation cost:
122
- - ≤5 params, cheap eval → exhaustive grid or random search
123
- - ≤15 params → Bayesian optimisation (optuna, hyperopt)
124
- - >15 params or expensive eval → evolutionary (CMA-ES, NSGA-II)
125
- Justify the choice and configure the initial seed and budget.
126
- expected_output: "Strategy selection with justification and search budget (eval count)"
127
-
128
- - id: implement-pruning
129
- instruction: >
130
- Implement pruning callbacks that abort parameter sets early if:
131
- (1) intermediate metrics fall below a floor threshold,
132
- (2) required constraints are violated (e.g., max drawdown breached before run ends).
133
- Log all pruned candidates with their termination reason.
134
- expected_output: "Pruning callback code + test showing early termination fires correctly"
135
- tools: ["run_in_terminal"]
136
-
137
- - id: run-search
138
- instruction: >
139
- Execute the heuristic search. Checkpoint results every N evaluations.
140
- Produce: top-10 parameter sets by objective score, pruning rate, and
141
- the marginal gain curve (how much did adding more evaluations help?).
142
- expected_output: "Search results: top-10 table, pruning rate %, convergence plot data"
143
- tools: ["run_in_terminal"]
144
-
145
- - id: simulation-and-distillation
146
- title: "Simulation & Insight Distillation"
147
- rationale: >
148
- Optimised parameters must be stress-tested against edge cases and adverse scenarios
149
- before deployment. Simulations should produce compact, decision-relevant summaries —
150
- not raw data dumps.
151
- steps:
152
- - id: define-scenarios
153
- instruction: >
154
- Define the simulation scenario set: at minimum, include (1) historical base case,
155
- (2) fat-tail / crisis scenario (2008, 2020-03, etc.), (3) low-liquidity scenario,
156
- (4) mean-reversion failure scenario. Add domain-specific stress scenarios.
157
- expected_output: "Scenario catalogue: Name | Description | Key parameter overrides"
158
-
159
- - id: run-simulations
160
- instruction: >
161
- Run Monte Carlo or historical replay simulations for each scenario using the
162
- top-3 parameter sets from the search phase. Use at least 10,000 paths where
163
- stochastic. Record: P&L distribution, max drawdown, Sharpe, Sortino, hit rate,
164
- and worst consecutive loss streak.
165
- expected_output: "Per-scenario stats table for each of the top-3 parameter sets"
166
- tools: ["run_in_terminal"]
167
-
168
- - id: distill-insights
169
- instruction: >
170
- From simulation results, extract the 5–7 most important insights.
171
- For each: state the insight in one sentence, the evidence from the data,
172
- and the actionable implication for deployment (e.g., reduce position size in
173
- low-liquidity regimes). Discard raw data; keep only insights.
174
- expected_output: "Insight list: Insight | Evidence | Deployment Implication"
175
-
176
- - id: define-guardrails
177
- instruction: >
178
- From the simulation results, define production guardrails as concrete,
179
- machine-checkable conditions: circuit breakers (halt if drawdown > X%),
180
- position size limits per regime, and anomaly alerts (volume spike, spread widening).
181
- These become config values in the parameter schema.
182
- expected_output: "Guardrails config additions + monitoring alert definitions"
183
-
184
- - id: implementation-handoff
185
- title: "Implementation Handoff"
186
- rationale: >
187
- All upstream artefacts (ADR, schema, state machine, guardrails) must be in place
188
- before a line of production code is written. This phase locks the specification.
189
- steps:
190
- - id: finalize-adr
191
- instruction: >
192
- Promote the ADR draft from Proposed → Accepted. Add a summary of the
193
- simulation results that confirms the decision. Record the parameter set
194
- selected for deployment.
195
- expected_output: "docs/adrs/NNNN-<model-name>.md with Status: Accepted"
196
-
197
- - id: write-acceptance-tests
198
- instruction: >
199
- Translate the simulation guardrails and state machine transitions into
200
- acceptance tests. These must pass before any code is merged to main.
201
- Tests should use the production Zod/Pydantic schema for inputs.
202
- expected_output: "Test file with at minimum: 1 test per state transition + 1 per guardrail"
203
- tools: ["run_in_terminal"]
204
-
205
- - id: checklist-sign-off
206
- instruction: >
207
- Verify all items are complete: ADR accepted, schema merged, state machine
208
- diagram committed, acceptance tests green, simulation results committed to
209
- docs/simulations/. Only then is implementation cleared to start.
210
- expected_output: "Sign-off checklist: all items checked"
1
+ tag: FINTECH
2
+ section: playbook
3
+ title: "Quantitative Model Development Pipeline"
4
+ description: >
5
+ A structured, agent-driven pipeline for building production-grade financial models.
6
+ Covers formula research and selection, state-machine design, parametrization,
7
+ heuristic search with pruning, and simulation with insight distillation.
8
+ Run this playbook before writing any pricing, risk, or execution model code.
9
+
10
+ phases:
11
+
12
+ - id: formula-research
13
+ title: "Formula Research & Selection"
14
+ rationale: >
15
+ The agent must survey the domain literature first — using web search, arxiv,
16
+ and internal docs — before choosing a model. Committing to the wrong formula
17
+ is the most expensive mistake in quant work.
18
+ steps:
19
+ - id: enumerate-candidates
20
+ instruction: >
21
+ Search academic and industry sources for all formulas/models relevant
22
+ to the problem domain (e.g., pricing, risk, signal generation).
23
+ Produce a candidate list with: name, formula notation, assumptions, and original source.
24
+ expected_output: "Markdown table: Name | Formula | Key Assumptions | Source"
25
+ tools: ["web_search", "fetch_webpage"]
26
+
27
+ - id: evaluate-candidates
28
+ instruction: >
29
+ Score each candidate on: mathematical tractability, data requirements,
30
+ known failure modes, computational cost, and regulatory acceptability.
31
+ Eliminate candidates that fail hard constraints (e.g., negative price assumption).
32
+ expected_output: "Scored comparison table; candidates ranked with pass/fail on hard constraints"
33
+ tools: ["web_search"]
34
+
35
+ - id: select-and-justify
36
+ instruction: >
37
+ Select the winning formula. Write a one-page justification covering:
38
+ why it beats alternatives, what it assumes, and what conditions would
39
+ invalidate it. This becomes ADR content.
40
+ expected_output: "ADR draft with title, status=Proposed, context, decision, consequences"
41
+
42
+ - id: state-machine-design
43
+ title: "State Machine Design"
44
+ rationale: >
45
+ Financial workflows (order lifecycle, position states, settlement stages)
46
+ are inherently state machines. Formalising them before code prevents
47
+ impossible state transitions, race conditions, and audit gaps.
48
+ steps:
49
+ - id: enumerate-states
50
+ instruction: >
51
+ List every possible state for the entity (e.g., order: NEW, PENDING, PARTIALLY_FILLED,
52
+ FILLED, CANCELLED, REJECTED, EXPIRED). For each state, describe: what it means,
53
+ who/what causes entry, and what invariants must hold while in this state.
54
+ expected_output: "States table: State | Entry Condition | Invariants | Exit Triggers"
55
+
56
+ - id: enumerate-transitions
57
+ instruction: >
58
+ For each state, enumerate all valid transitions and the events/guards that trigger them.
59
+ Mark transitions that require idempotency guarantees or external settlement confirmation.
60
+ expected_output: "Transition table: From | Event | Guard | To | Side Effects"
61
+
62
+ - id: draw-diagram
63
+ instruction: >
64
+ Generate a Mermaid stateDiagram-v2 diagram from the state and transition tables.
65
+ Include notes on parallel states or guard conditions where relevant.
66
+ expected_output: "Mermaid stateDiagram-v2 code block that compiles without errors"
67
+ tools: ["run_in_terminal"]
68
+
69
+ - id: validate-completeness
70
+ instruction: >
71
+ Verify the diagram satisfies: (1) no dead-end states except terminal ones,
72
+ (2) every state reachable from the initial state, (3) every external event handled.
73
+ Flag any gaps.
74
+ expected_output: "Completeness checklist: pass/fail per criterion; gaps listed"
75
+
76
+ - id: parametrization
77
+ title: "Model Parametrization"
78
+ rationale: >
79
+ Hard-coded constants are a maintenance liability and a back-test overfitting risk.
80
+ Every numeric knob must be named, typed, range-validated, and externally configurable.
81
+ steps:
82
+ - id: extract-parameters
83
+ instruction: >
84
+ From the selected formula and state machine, extract every numeric constant
85
+ or threshold. For each: name it, specify its type (rate, multiplier, count,
86
+ duration), its valid range, and its economic meaning.
87
+ expected_output: "Parameter registry table: Name | Type | Valid Range | Default | Meaning"
88
+
89
+ - id: design-config-schema
90
+ instruction: >
91
+ Define a Zod (or Pydantic) schema for the full parameter set.
92
+ Include range validators, cross-parameter constraints (e.g., stop_loss < take_profit),
93
+ and environment-specific override docs.
94
+ expected_output: "Schema source file with all validators and inline JSDoc"
95
+
96
+ - id: sensitivity-matrix
97
+ instruction: >
98
+ For each parameter, estimate first-order sensitivity: how much does the model
99
+ output change for a ±10% change in the parameter? Identify the top 3 most
100
+ sensitive parameters — these need the tightest validation and monitoring.
101
+ expected_output: "Sensitivity table: Parameter | Δ+10% impact | Δ-10% impact | Risk rank"
102
+
103
+ - id: heuristic-search
104
+ title: "Heuristic Search with Pruning"
105
+ rationale: >
106
+ Exhaustive grid search over parameter space is computationally prohibitive.
107
+ Structured heuristic search (Bayesian optimisation, evolutionary algorithms,
108
+ or domain-guided hill climbing) with aggressive pruning finds good solutions
109
+ orders of magnitude faster.
110
+ steps:
111
+ - id: define-objective
112
+ instruction: >
113
+ Define the objective function: what scalar metric are we optimising?
114
+ (Sharpe ratio, max drawdown %, expected profit per unit risk, etc.)
115
+ Document: formula, units, whether higher or lower is better, and any
116
+ multi-objective tradeoff weights.
117
+ expected_output: "Objective function definition with formula, direction, and tradeoff weights"
118
+
119
+ - id: select-search-strategy
120
+ instruction: >
121
+ Choose a search strategy appropriate to parameter count and evaluation cost:
122
+ - ≤5 params, cheap eval → exhaustive grid or random search
123
+ - ≤15 params → Bayesian optimisation (optuna, hyperopt)
124
+ - >15 params or expensive eval → evolutionary (CMA-ES, NSGA-II)
125
+ Justify the choice and configure the initial seed and budget.
126
+ expected_output: "Strategy selection with justification and search budget (eval count)"
127
+
128
+ - id: implement-pruning
129
+ instruction: >
130
+ Implement pruning callbacks that abort parameter sets early if:
131
+ (1) intermediate metrics fall below a floor threshold,
132
+ (2) required constraints are violated (e.g., max drawdown breached before run ends).
133
+ Log all pruned candidates with their termination reason.
134
+ expected_output: "Pruning callback code + test showing early termination fires correctly"
135
+ tools: ["run_in_terminal"]
136
+
137
+ - id: run-search
138
+ instruction: >
139
+ Execute the heuristic search. Checkpoint results every N evaluations.
140
+ Produce: top-10 parameter sets by objective score, pruning rate, and
141
+ the marginal gain curve (how much did adding more evaluations help?).
142
+ expected_output: "Search results: top-10 table, pruning rate %, convergence plot data"
143
+ tools: ["run_in_terminal"]
144
+
145
+ - id: simulation-and-distillation
146
+ title: "Simulation & Insight Distillation"
147
+ rationale: >
148
+ Optimised parameters must be stress-tested against edge cases and adverse scenarios
149
+ before deployment. Simulations should produce compact, decision-relevant summaries —
150
+ not raw data dumps.
151
+ steps:
152
+ - id: define-scenarios
153
+ instruction: >
154
+ Define the simulation scenario set: at minimum, include (1) historical base case,
155
+ (2) fat-tail / crisis scenario (2008, 2020-03, etc.), (3) low-liquidity scenario,
156
+ (4) mean-reversion failure scenario. Add domain-specific stress scenarios.
157
+ expected_output: "Scenario catalogue: Name | Description | Key parameter overrides"
158
+
159
+ - id: run-simulations
160
+ instruction: >
161
+ Run Monte Carlo or historical replay simulations for each scenario using the
162
+ top-3 parameter sets from the search phase. Use at least 10,000 paths where
163
+ stochastic. Record: P&L distribution, max drawdown, Sharpe, Sortino, hit rate,
164
+ and worst consecutive loss streak.
165
+ expected_output: "Per-scenario stats table for each of the top-3 parameter sets"
166
+ tools: ["run_in_terminal"]
167
+
168
+ - id: distill-insights
169
+ instruction: >
170
+ From simulation results, extract the 5–7 most important insights.
171
+ For each: state the insight in one sentence, the evidence from the data,
172
+ and the actionable implication for deployment (e.g., reduce position size in
173
+ low-liquidity regimes). Discard raw data; keep only insights.
174
+ expected_output: "Insight list: Insight | Evidence | Deployment Implication"
175
+
176
+ - id: define-guardrails
177
+ instruction: >
178
+ From the simulation results, define production guardrails as concrete,
179
+ machine-checkable conditions: circuit breakers (halt if drawdown > X%),
180
+ position size limits per regime, and anomaly alerts (volume spike, spread widening).
181
+ These become config values in the parameter schema.
182
+ expected_output: "Guardrails config additions + monitoring alert definitions"
183
+
184
+ - id: implementation-handoff
185
+ title: "Implementation Handoff"
186
+ rationale: >
187
+ All upstream artefacts (ADR, schema, state machine, guardrails) must be in place
188
+ before a line of production code is written. This phase locks the specification.
189
+ steps:
190
+ - id: finalize-adr
191
+ instruction: >
192
+ Promote the ADR draft from Proposed → Accepted. Add a summary of the
193
+ simulation results that confirms the decision. Record the parameter set
194
+ selected for deployment.
195
+ expected_output: "docs/adrs/NNNN-<model-name>.md with Status: Accepted"
196
+
197
+ - id: write-acceptance-tests
198
+ instruction: >
199
+ Translate the simulation guardrails and state machine transitions into
200
+ acceptance tests. These must pass before any code is merged to main.
201
+ Tests should use the production Zod/Pydantic schema for inputs.
202
+ expected_output: "Test file with at minimum: 1 test per state transition + 1 per guardrail"
203
+ tools: ["run_in_terminal"]
204
+
205
+ - id: checklist-sign-off
206
+ instruction: >
207
+ Verify all items are complete: ADR accepted, schema merged, state machine
208
+ diagram committed, acceptance tests green, simulation results committed to
209
+ docs/simulations/. Only then is implementation cleared to start.
210
+ expected_output: "Sign-off checklist: all items checked"