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,22 +1,22 @@
1
- tag: API
2
- section: mcp-servers
3
- servers:
4
- - name: postman
5
- description: "API testing and collection management via Postman workspace"
6
- command: npx
7
- args: ["-y", "@anthropic/mcp-server-postman"]
8
- tags: [API]
9
- category: testing
10
- tier: recommended
11
- url: "https://github.com/anthropics/anthropic-quickstarts/tree/main/mcp-server-postman"
12
- env:
13
- POSTMAN_API_KEY: ""
14
-
15
- - name: playwright
16
- description: "Browser automation for API + E2E testing, request interception, and response validation"
17
- command: npx
18
- args: ["-y", "@anthropic/mcp-server-playwright"]
19
- tags: [API]
20
- category: testing
21
- tier: recommended
22
- url: "https://github.com/anthropics/anthropic-quickstarts/tree/main/mcp-server-playwright"
1
+ tag: API
2
+ section: mcp-servers
3
+ servers:
4
+ - name: postman
5
+ description: "API testing and collection management via Postman workspace"
6
+ command: npx
7
+ args: ["-y", "@anthropic/mcp-server-postman"]
8
+ tags: [API]
9
+ category: testing
10
+ tier: recommended
11
+ url: "https://github.com/anthropics/anthropic-quickstarts/tree/main/mcp-server-postman"
12
+ env:
13
+ POSTMAN_API_KEY: ""
14
+
15
+ - name: playwright
16
+ description: "Browser automation for API + E2E testing, request interception, and response validation"
17
+ command: npx
18
+ args: ["-y", "@anthropic/mcp-server-playwright"]
19
+ tags: [API]
20
+ category: testing
21
+ tier: recommended
22
+ url: "https://github.com/anthropics/anthropic-quickstarts/tree/main/mcp-server-playwright"
@@ -1,23 +1,23 @@
1
- tag: API
2
- section: nfr
3
- blocks:
4
- - id: api-performance
5
- tier: recommended
6
- title: "API Performance"
7
- content: |
8
- ## NFR: API Performance
9
-
10
- ### Response Time Targets
11
- - p50: < {{p50_target | default: 50ms}}
12
- - p95: < {{p95_target | default: 200ms}}
13
- - p99: < {{p99_target | default: 500ms}}
14
-
15
- ### Throughput
16
- - Target requests/sec: {{target_rps}}
17
- - Load test before launch at 2x expected peak.
18
- - Auto-scaling configured with appropriate min/max.
19
-
20
- ### Rate Limiting
21
- - Per-client rate limits on all endpoints.
22
- - Graduated response: 429 with Retry-After header before hard block.
23
- - Rate limit bypass for internal services via separate auth.
1
+ tag: API
2
+ section: nfr
3
+ blocks:
4
+ - id: api-performance
5
+ tier: recommended
6
+ title: "API Performance"
7
+ content: |
8
+ ## NFR: API Performance
9
+
10
+ ### Response Time Targets
11
+ - p50: < {{p50_target | default: 50ms}}
12
+ - p95: < {{p95_target | default: 200ms}}
13
+ - p99: < {{p99_target | default: 500ms}}
14
+
15
+ ### Throughput
16
+ - Target requests/sec: {{target_rps}}
17
+ - Load test before launch at 2x expected peak.
18
+ - Auto-scaling configured with appropriate min/max.
19
+
20
+ ### Rate Limiting
21
+ - Per-client rate limits on all endpoints.
22
+ - Graduated response: 429 with Retry-After header before hard block.
23
+ - Rate limit bypass for internal services via separate auth.
@@ -1,103 +1,103 @@
1
- tag: API
2
- section: review
3
- blocks:
4
- - id: api-architecture-review
5
- tier: recommended
6
- dimension: architecture
7
- title: "API Architecture Review"
8
- description: |
9
- Evaluate API design, endpoint structure, middleware pipeline, and service boundaries.
10
- checklist:
11
- - id: endpoint-design
12
- description: "RESTful conventions followed: proper HTTP methods, status codes, resource naming."
13
- severity: critical
14
- - id: middleware-pipeline
15
- description: "Middleware pipeline is ordered correctly: auth → validation → rate-limit → handler."
16
- severity: important
17
- - id: service-layer-separation
18
- description: "Handlers are thin (validation + delegation). Business logic lives in service layer."
19
- severity: critical
20
- - id: api-versioning
21
- description: "API versioning strategy defined and enforced (URL prefix, header, or content negotiation)."
22
- severity: important
23
- - id: database-migrations
24
- description: "Schema changes managed through versioned migration files. Every migration is reversible. No manual DDL."
25
- severity: critical
26
- - id: owasp-injection
27
- description: "Parameterized queries only. No string concatenation for SQL, commands, or LDAP queries."
28
- severity: critical
29
- - id: owasp-access-control
30
- description: "Ownership checks enforced — users cannot access other users' resources. No IDOR vulnerabilities."
31
- severity: critical
32
- - id: security-headers
33
- description: "Security headers set: CSP, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy."
34
- severity: important
35
- - id: audit-logging
36
- description: "Security-relevant actions logged: WHO did WHAT to WHICH resource, WHEN. Immutable, separate from app logs."
37
- severity: important
38
- - id: graceful-shutdown
39
- description: "SIGTERM handled: stop accepting requests, drain in-flight work, close connections, exit cleanly."
40
- severity: important
41
- - id: container-best-practices
42
- description: "Dockerfile uses multi-stage build, non-root user, pinned base image digest. Image scanned for CVEs."
43
- severity: important
44
- - id: health-endpoint
45
- description: "/health endpoint returns status, version, uptime, and dependency connectivity. Used by orchestrator probes."
46
- severity: critical
47
- - id: migration-auto-deploy
48
- description: "Database migrations run automatically on deploy (pre-deploy hook or init container). Never manually applied."
49
- severity: important
50
-
51
- - id: api-code-quality-review
52
- tier: recommended
53
- dimension: code-quality
54
- title: "API Code Quality Review"
55
- description: |
56
- Evaluate input validation, response contracts, and error response consistency.
57
- checklist:
58
- - id: input-validation
59
- description: "All endpoint inputs validated with schema (Zod, Joi, class-validator). No trust of client data."
60
- severity: critical
61
- - id: response-consistency
62
- description: "All responses follow a consistent envelope: { data, error, meta }."
63
- severity: important
64
- - id: error-responses
65
- description: "Error responses include: status code, error code, human message, request ID. No stack traces in production."
66
- severity: critical
67
-
68
- - id: api-performance-review
69
- tier: recommended
70
- dimension: performance
71
- title: "API Performance Review"
72
- description: |
73
- Evaluate query efficiency, pagination, and rate limiting.
74
- checklist:
75
- - id: n-plus-one-queries
76
- description: "No N+1 query patterns in list endpoints. Use eager loading or DataLoader."
77
- severity: critical
78
- - id: pagination
79
- description: "List endpoints paginated. No unbounded result sets."
80
- severity: critical
81
- - id: rate-limiting
82
- description: "Rate limiting configured on all public-facing endpoints."
83
- severity: important
84
- - id: response-caching
85
- description: "Cacheable responses use Cache-Control headers or application-level caching."
86
- severity: nice-to-have
87
-
88
- - id: api-test-review
89
- tier: recommended
90
- dimension: tests
91
- title: "API Test Review"
92
- description: |
93
- Evaluate API-specific testing patterns including contract tests and migration testing.
94
- checklist:
95
- - id: migration-testing
96
- description: "Database migrations tested: up + down both verified. Migration tests run in CI."
97
- severity: critical
98
- - id: api-contract-tests
99
- description: "API contracts tested: request/response shapes match OpenAPI spec. Breaking changes caught early."
100
- severity: important
101
- - id: auth-path-testing
102
- description: "Auth paths thoroughly tested: valid token, expired token, missing token, insufficient permissions."
103
- severity: critical
1
+ tag: API
2
+ section: review
3
+ blocks:
4
+ - id: api-architecture-review
5
+ tier: recommended
6
+ dimension: architecture
7
+ title: "API Architecture Review"
8
+ description: |
9
+ Evaluate API design, endpoint structure, middleware pipeline, and service boundaries.
10
+ checklist:
11
+ - id: endpoint-design
12
+ description: "RESTful conventions followed: proper HTTP methods, status codes, resource naming."
13
+ severity: critical
14
+ - id: middleware-pipeline
15
+ description: "Middleware pipeline is ordered correctly: auth → validation → rate-limit → handler."
16
+ severity: important
17
+ - id: service-layer-separation
18
+ description: "Handlers are thin (validation + delegation). Business logic lives in service layer."
19
+ severity: critical
20
+ - id: api-versioning
21
+ description: "API versioning strategy defined and enforced (URL prefix, header, or content negotiation)."
22
+ severity: important
23
+ - id: database-migrations
24
+ description: "Schema changes managed through versioned migration files. Every migration is reversible. No manual DDL."
25
+ severity: critical
26
+ - id: owasp-injection
27
+ description: "Parameterized queries only. No string concatenation for SQL, commands, or LDAP queries."
28
+ severity: critical
29
+ - id: owasp-access-control
30
+ description: "Ownership checks enforced — users cannot access other users' resources. No IDOR vulnerabilities."
31
+ severity: critical
32
+ - id: security-headers
33
+ description: "Security headers set: CSP, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy."
34
+ severity: important
35
+ - id: audit-logging
36
+ description: "Security-relevant actions logged: WHO did WHAT to WHICH resource, WHEN. Immutable, separate from app logs."
37
+ severity: important
38
+ - id: graceful-shutdown
39
+ description: "SIGTERM handled: stop accepting requests, drain in-flight work, close connections, exit cleanly."
40
+ severity: important
41
+ - id: container-best-practices
42
+ description: "Dockerfile uses multi-stage build, non-root user, pinned base image digest. Image scanned for CVEs."
43
+ severity: important
44
+ - id: health-endpoint
45
+ description: "/health endpoint returns status, version, uptime, and dependency connectivity. Used by orchestrator probes."
46
+ severity: critical
47
+ - id: migration-auto-deploy
48
+ description: "Database migrations run automatically on deploy (pre-deploy hook or init container). Never manually applied."
49
+ severity: important
50
+
51
+ - id: api-code-quality-review
52
+ tier: recommended
53
+ dimension: code-quality
54
+ title: "API Code Quality Review"
55
+ description: |
56
+ Evaluate input validation, response contracts, and error response consistency.
57
+ checklist:
58
+ - id: input-validation
59
+ description: "All endpoint inputs validated with schema (Zod, Joi, class-validator). No trust of client data."
60
+ severity: critical
61
+ - id: response-consistency
62
+ description: "All responses follow a consistent envelope: { data, error, meta }."
63
+ severity: important
64
+ - id: error-responses
65
+ description: "Error responses include: status code, error code, human message, request ID. No stack traces in production."
66
+ severity: critical
67
+
68
+ - id: api-performance-review
69
+ tier: recommended
70
+ dimension: performance
71
+ title: "API Performance Review"
72
+ description: |
73
+ Evaluate query efficiency, pagination, and rate limiting.
74
+ checklist:
75
+ - id: n-plus-one-queries
76
+ description: "No N+1 query patterns in list endpoints. Use eager loading or DataLoader."
77
+ severity: critical
78
+ - id: pagination
79
+ description: "List endpoints paginated. No unbounded result sets."
80
+ severity: critical
81
+ - id: rate-limiting
82
+ description: "Rate limiting configured on all public-facing endpoints."
83
+ severity: important
84
+ - id: response-caching
85
+ description: "Cacheable responses use Cache-Control headers or application-level caching."
86
+ severity: nice-to-have
87
+
88
+ - id: api-test-review
89
+ tier: recommended
90
+ dimension: tests
91
+ title: "API Test Review"
92
+ description: |
93
+ Evaluate API-specific testing patterns including contract tests and migration testing.
94
+ checklist:
95
+ - id: migration-testing
96
+ description: "Database migrations tested: up + down both verified. Migration tests run in CI."
97
+ severity: critical
98
+ - id: api-contract-tests
99
+ description: "API contracts tested: request/response shapes match OpenAPI spec. Breaking changes caught early."
100
+ severity: important
101
+ - id: auth-path-testing
102
+ description: "Auth paths thoroughly tested: valid token, expired token, missing token, insufficient permissions."
103
+ severity: critical
@@ -1,34 +1,34 @@
1
- tag: API
2
- section: structure
3
- language: typescript
4
- entries:
5
- - path: src/index.ts
6
- type: file
7
- description: "Composition root — only place concretes are instantiated"
8
- - path: src/shared/config/index.ts
9
- type: file
10
- description: "Env validation with fail-fast"
11
- - path: src/shared/errors/index.ts
12
- type: file
13
- description: "Error class hierarchy"
14
- - path: src/shared/logger/index.ts
15
- type: file
16
- description: "Structured logging (pino)"
17
- - path: src/shared/middleware
18
- type: directory
19
- description: "Auth, error handler, request ID"
20
- - path: src/shared/types
21
- type: directory
22
- description: "Shared interfaces and type definitions"
23
- - path: src/modules
24
- type: directory
25
- description: "Feature modules"
26
- - path: tests/unit
27
- type: directory
28
- description: "Unit tests"
29
- - path: tests/integration
30
- type: directory
31
- description: "Integration tests"
32
- - path: tests/e2e
33
- type: directory
34
- description: "End-to-end tests"
1
+ tag: API
2
+ section: structure
3
+ language: typescript
4
+ entries:
5
+ - path: src/index.ts
6
+ type: file
7
+ description: "Composition root — only place concretes are instantiated"
8
+ - path: src/shared/config/index.ts
9
+ type: file
10
+ description: "Env validation with fail-fast"
11
+ - path: src/shared/errors/index.ts
12
+ type: file
13
+ description: "Error class hierarchy"
14
+ - path: src/shared/logger/index.ts
15
+ type: file
16
+ description: "Structured logging (pino)"
17
+ - path: src/shared/middleware
18
+ type: directory
19
+ description: "Auth, error handler, request ID"
20
+ - path: src/shared/types
21
+ type: directory
22
+ description: "Shared interfaces and type definitions"
23
+ - path: src/modules
24
+ type: directory
25
+ description: "Feature modules"
26
+ - path: tests/unit
27
+ type: directory
28
+ description: "Unit tests"
29
+ - path: tests/integration
30
+ type: directory
31
+ description: "Integration tests"
32
+ - path: tests/e2e
33
+ type: directory
34
+ description: "End-to-end tests"
@@ -1,132 +1,132 @@
1
- tag: API
2
- section: verification
3
- title: "Spec-Driven API Verification"
4
- description: >
5
- API contracts are the highest-determinism domain. A formal Hurl spec or
6
- OpenAPI schema covers every endpoint, method, status code, and response shape.
7
- When this strategy is applied, S approaches 1.0 — enabling single-pass
8
- automated verification with no human judgment required at execution time.
9
- uncertainty_levels:
10
- - deterministic
11
- completeness_ceiling: 0.95
12
-
13
- phases:
14
-
15
- - id: contract-definition
16
- title: "Define the API Contract Before Code"
17
- rationale: >
18
- The OpenAPI spec is the source of truth. Types, validators, and tests
19
- must be generated from it — never maintained in parallel. A spec written
20
- before implementation is a contract; a spec written after implementation
21
- is documentation.
22
- steps:
23
- - id: write-openapi-spec
24
- instruction: >
25
- Write the full OpenAPI 3.1 spec for every endpoint before implementation.
26
- Every endpoint must define: path, method, request schema (body + query + path params),
27
- all response codes with response schemas, and security requirements.
28
- Use $ref for shared schemas — no inline duplication.
29
- contract: >
30
- openapi.yaml or openapi.json exists in the project root and passes
31
- `openapi-spec-validator`. Every endpoint in the spec maps 1:1 to a route
32
- in the implementation.
33
- tools: ["openapi-spec-validator", "stoplight/spectral"]
34
- expected_output: "openapi.yaml validated by openapi-spec-validator with 0 errors"
35
- pass_criterion: "openapi-spec-validator openapi.yaml exits 0"
36
-
37
- - id: generate-types-from-spec
38
- instruction: >
39
- Generate TypeScript types from the OpenAPI spec using openapi-typescript.
40
- Use the generated types in route handlers and service layers — do not
41
- hand-write types that duplicate the spec.
42
- contract: >
43
- src/types/api.ts (or equivalent) is generated, not hand-written.
44
- A Makefile or package.json script exists to regenerate it.
45
- tools: ["openapi-typescript", "npx openapi-typescript openapi.yaml -o src/types/api.ts"]
46
- expected_output: "Generated src/types/api.ts with no manual edits"
47
- pass_criterion: "File is generated; `npm run generate-types` succeeds"
48
-
49
- - id: write-hurl-spec
50
- instruction: >
51
- Write a Hurl spec file for every endpoint. Each file covers:
52
- the happy path, at least one error case (400/401/403/404/422),
53
- and one edge case (e.g., empty list, max payload).
54
- Variables use Hurl's {{variable}} syntax for base_url, tokens, etc.
55
- contract: >
56
- A .hurl file exists per endpoint group (auth, articles, users, etc.).
57
- Total Hurl files ≥ number of resource groups. Every Hurl file runs
58
- to completion without network errors.
59
- tools: ["hurl --test", "hurl --variables-file .env.test"]
60
- expected_output: "Hurl test output with pass/fail per file"
61
- pass_criterion: "hurl --test *.hurl exits 0 with 0 failures"
62
-
63
- - id: execution
64
- title: "Run Hurl Spec Against Live Server"
65
- rationale: >
66
- The gap between GS Verifiable and Executable is closed here. The server must be
67
- running with a test database. Hurl drives real HTTP — it catches route wiring gaps,
68
- JWT issues, and normalization bugs that no unit test can detect.
69
- steps:
70
- - id: start-server
71
- instruction: >
72
- Start the API server with NODE_ENV=test and a clean test database.
73
- Sync the schema with `prisma db push --accept-data-loss` (not `migrate deploy` —
74
- migrate deploy silently no-ops when no migrations folder exists, leaving an empty DB).
75
- Capture the server process and its port in a test fixture.
76
- contract: >
77
- Server health check endpoint returns HTTP 200 within 5 seconds.
78
- Test database has 0 seed rows (clean state).
79
- tools: ["docker-compose up -d", "npx prisma db push --accept-data-loss", "curl /health"]
80
- expected_output: "HTTP 200 from /health or /api/health"
81
- pass_criterion: "curl -s localhost:PORT/health returns 200"
82
-
83
- - id: run-hurl-suite
84
- instruction: >
85
- Run all Hurl files in sequence. Record: total files, total assertions,
86
- pass count, fail count. For every failure, capture: file name, step number,
87
- expected vs actual response body and status code.
88
- contract: >
89
- ≥ 80% of Hurl files pass. 100% of auth-related files pass.
90
- Zero 5xx responses on any happy-path request.
91
- tools: ["hurl --test --report-junit junit-hurl.xml", "hurl --variables-file .env.test"]
92
- expected_output: "JUnit XML + terminal summary: N files, M passed, K failed"
93
- pass_criterion: "Pass rate ≥ 80%; 0 failures in auth.hurl"
94
-
95
- - id: run-schema-validator
96
- instruction: >
97
- For every response captured by the Hurl run, validate the response body against
98
- the OpenAPI spec's response schema. Use `openapi-backend` or `express-openapi-validator`
99
- in strict mode. Treat schema mismatches as failures even if Hurl assertions passed.
100
- contract: >
101
- 0 schema validation errors. Response shapes match spec exactly —
102
- no extra undocumented fields, no missing required fields.
103
- tools: ["openapi-backend", "express-openapi-validator"]
104
- expected_output: "Validation report with 0 mismatches"
105
- pass_criterion: "0 schema validation errors"
106
-
107
- - id: evidence
108
- title: "Record and Interpret Execution Results"
109
- rationale: >
110
- Hurl results feed directly into the Executable dimension score (0–2).
111
- Results must be structured so the verify loop can detect regressions
112
- across passes and determine whether the fix prompt improved things.
113
- steps:
114
- - id: record-hurl-results
115
- instruction: >
116
- Save the JUnit XML report to test-results/hurl-junit.xml.
117
- Extract: total files count, pass count, fail count, failed file names.
118
- Write a one-line summary to test-results/hurl-summary.txt.
119
- contract: "test-results/hurl-junit.xml and hurl-summary.txt exist after run"
120
- tools: ["hurl --report-junit", "xsltproc or python xml.etree"]
121
- expected_output: "hurl-summary.txt: '13 files, 12 passed, 1 failed'"
122
- pass_criterion: "Files exist; pass count parseable as integer"
123
-
124
- - id: compute-executable-score
125
- instruction: >
126
- Compute the Executable score: 0 if server fails to start, 1 if 1–79% of Hurl files pass,
127
- 2 if ≥ 80% of Hurl files pass. Record this score in test-results/executable-score.json
128
- with fields: score, pass_rate, total_files, passed_files, timestamp.
129
- contract: "executable-score.json exists with integer score 0|1|2"
130
- tools: ["node -e", "python -c", "jq"]
131
- expected_output: '{"score": 2, "pass_rate": 0.92, "total_files": 13, "passed_files": 12}'
132
- pass_criterion: "File parses as valid JSON with score field"
1
+ tag: API
2
+ section: verification
3
+ title: "Spec-Driven API Verification"
4
+ description: >
5
+ API contracts are the highest-determinism domain. A formal Hurl spec or
6
+ OpenAPI schema covers every endpoint, method, status code, and response shape.
7
+ When this strategy is applied, S approaches 1.0 — enabling single-pass
8
+ automated verification with no human judgment required at execution time.
9
+ uncertainty_levels:
10
+ - deterministic
11
+ completeness_ceiling: 0.95
12
+
13
+ phases:
14
+
15
+ - id: contract-definition
16
+ title: "Define the API Contract Before Code"
17
+ rationale: >
18
+ The OpenAPI spec is the source of truth. Types, validators, and tests
19
+ must be generated from it — never maintained in parallel. A spec written
20
+ before implementation is a contract; a spec written after implementation
21
+ is documentation.
22
+ steps:
23
+ - id: write-openapi-spec
24
+ instruction: >
25
+ Write the full OpenAPI 3.1 spec for every endpoint before implementation.
26
+ Every endpoint must define: path, method, request schema (body + query + path params),
27
+ all response codes with response schemas, and security requirements.
28
+ Use $ref for shared schemas — no inline duplication.
29
+ contract: >
30
+ openapi.yaml or openapi.json exists in the project root and passes
31
+ `openapi-spec-validator`. Every endpoint in the spec maps 1:1 to a route
32
+ in the implementation.
33
+ tools: ["openapi-spec-validator", "stoplight/spectral"]
34
+ expected_output: "openapi.yaml validated by openapi-spec-validator with 0 errors"
35
+ pass_criterion: "openapi-spec-validator openapi.yaml exits 0"
36
+
37
+ - id: generate-types-from-spec
38
+ instruction: >
39
+ Generate TypeScript types from the OpenAPI spec using openapi-typescript.
40
+ Use the generated types in route handlers and service layers — do not
41
+ hand-write types that duplicate the spec.
42
+ contract: >
43
+ src/types/api.ts (or equivalent) is generated, not hand-written.
44
+ A Makefile or package.json script exists to regenerate it.
45
+ tools: ["openapi-typescript", "npx openapi-typescript openapi.yaml -o src/types/api.ts"]
46
+ expected_output: "Generated src/types/api.ts with no manual edits"
47
+ pass_criterion: "File is generated; `npm run generate-types` succeeds"
48
+
49
+ - id: write-hurl-spec
50
+ instruction: >
51
+ Write a Hurl spec file for every endpoint. Each file covers:
52
+ the happy path, at least one error case (400/401/403/404/422),
53
+ and one edge case (e.g., empty list, max payload).
54
+ Variables use Hurl's {{variable}} syntax for base_url, tokens, etc.
55
+ contract: >
56
+ A .hurl file exists per endpoint group (auth, articles, users, etc.).
57
+ Total Hurl files ≥ number of resource groups. Every Hurl file runs
58
+ to completion without network errors.
59
+ tools: ["hurl --test", "hurl --variables-file .env.test"]
60
+ expected_output: "Hurl test output with pass/fail per file"
61
+ pass_criterion: "hurl --test *.hurl exits 0 with 0 failures"
62
+
63
+ - id: execution
64
+ title: "Run Hurl Spec Against Live Server"
65
+ rationale: >
66
+ The gap between GS Verifiable and Executable is closed here. The server must be
67
+ running with a test database. Hurl drives real HTTP — it catches route wiring gaps,
68
+ JWT issues, and normalization bugs that no unit test can detect.
69
+ steps:
70
+ - id: start-server
71
+ instruction: >
72
+ Start the API server with NODE_ENV=test and a clean test database.
73
+ Sync the schema with `prisma db push --accept-data-loss` (not `migrate deploy` —
74
+ migrate deploy silently no-ops when no migrations folder exists, leaving an empty DB).
75
+ Capture the server process and its port in a test fixture.
76
+ contract: >
77
+ Server health check endpoint returns HTTP 200 within 5 seconds.
78
+ Test database has 0 seed rows (clean state).
79
+ tools: ["docker-compose up -d", "npx prisma db push --accept-data-loss", "curl /health"]
80
+ expected_output: "HTTP 200 from /health or /api/health"
81
+ pass_criterion: "curl -s localhost:PORT/health returns 200"
82
+
83
+ - id: run-hurl-suite
84
+ instruction: >
85
+ Run all Hurl files in sequence. Record: total files, total assertions,
86
+ pass count, fail count. For every failure, capture: file name, step number,
87
+ expected vs actual response body and status code.
88
+ contract: >
89
+ ≥ 80% of Hurl files pass. 100% of auth-related files pass.
90
+ Zero 5xx responses on any happy-path request.
91
+ tools: ["hurl --test --report-junit junit-hurl.xml", "hurl --variables-file .env.test"]
92
+ expected_output: "JUnit XML + terminal summary: N files, M passed, K failed"
93
+ pass_criterion: "Pass rate ≥ 80%; 0 failures in auth.hurl"
94
+
95
+ - id: run-schema-validator
96
+ instruction: >
97
+ For every response captured by the Hurl run, validate the response body against
98
+ the OpenAPI spec's response schema. Use `openapi-backend` or `express-openapi-validator`
99
+ in strict mode. Treat schema mismatches as failures even if Hurl assertions passed.
100
+ contract: >
101
+ 0 schema validation errors. Response shapes match spec exactly —
102
+ no extra undocumented fields, no missing required fields.
103
+ tools: ["openapi-backend", "express-openapi-validator"]
104
+ expected_output: "Validation report with 0 mismatches"
105
+ pass_criterion: "0 schema validation errors"
106
+
107
+ - id: evidence
108
+ title: "Record and Interpret Execution Results"
109
+ rationale: >
110
+ Hurl results feed directly into the Executable dimension score (0–2).
111
+ Results must be structured so the verify loop can detect regressions
112
+ across passes and determine whether the fix prompt improved things.
113
+ steps:
114
+ - id: record-hurl-results
115
+ instruction: >
116
+ Save the JUnit XML report to test-results/hurl-junit.xml.
117
+ Extract: total files count, pass count, fail count, failed file names.
118
+ Write a one-line summary to test-results/hurl-summary.txt.
119
+ contract: "test-results/hurl-junit.xml and hurl-summary.txt exist after run"
120
+ tools: ["hurl --report-junit", "xsltproc or python xml.etree"]
121
+ expected_output: "hurl-summary.txt: '13 files, 12 passed, 1 failed'"
122
+ pass_criterion: "Files exist; pass count parseable as integer"
123
+
124
+ - id: compute-executable-score
125
+ instruction: >
126
+ Compute the Executable score: 0 if server fails to start, 1 if 1–79% of Hurl files pass,
127
+ 2 if ≥ 80% of Hurl files pass. Record this score in test-results/executable-score.json
128
+ with fields: score, pass_rate, total_files, passed_files, timestamp.
129
+ contract: "executable-score.json exists with integer score 0|1|2"
130
+ tools: ["node -e", "python -c", "jq"]
131
+ expected_output: '{"score": 2, "pass_rate": 0.92, "total_files": 13, "passed_files": 12}'
132
+ pass_criterion: "File parses as valid JSON with score field"