@azure-id/orc 0.55.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 (449) hide show
  1. package/CHANGELOG.md +2017 -0
  2. package/README-id.md +521 -0
  3. package/README.md +485 -0
  4. package/bin/build-agents.js +86 -0
  5. package/bin/cli.js +29050 -0
  6. package/bin/mockrun-catalog.js +267 -0
  7. package/bin/onboarding-content.js +172 -0
  8. package/bin/pricing.json +200 -0
  9. package/bin/providers.json +437 -0
  10. package/bin/ui.js +95 -0
  11. package/bin/verify-contracts.js +3277 -0
  12. package/bin/verify-package.js +498 -0
  13. package/bin/webui/api.js +1163 -0
  14. package/bin/webui/app.html +198 -0
  15. package/bin/webui/css/00-tokens.css +92 -0
  16. package/bin/webui/css/01-base.css +42 -0
  17. package/bin/webui/css/02-shell.css +103 -0
  18. package/bin/webui/css/03-components.css +462 -0
  19. package/bin/webui/css/04-motion.css +91 -0
  20. package/bin/webui/css/05-tour.css +100 -0
  21. package/bin/webui/css/06-responsive.css +108 -0
  22. package/bin/webui/css/panels/boundary.css +26 -0
  23. package/bin/webui/css/panels/challenge.css +151 -0
  24. package/bin/webui/css/panels/crosslink.css +194 -0
  25. package/bin/webui/css/panels/docs.css +254 -0
  26. package/bin/webui/css/panels/experiment.css +23 -0
  27. package/bin/webui/css/panels/extra.css +536 -0
  28. package/bin/webui/css/panels/flow.css +177 -0
  29. package/bin/webui/css/panels/handoff.css +67 -0
  30. package/bin/webui/css/panels/knowledge.css +86 -0
  31. package/bin/webui/css/panels/learn.css +154 -0
  32. package/bin/webui/css/panels/maintenance.css +55 -0
  33. package/bin/webui/css/panels/mockrun.css +268 -0
  34. package/bin/webui/css/panels/overview.css +100 -0
  35. package/bin/webui/css/panels/pact.css +43 -0
  36. package/bin/webui/css/panels/runs.css +105 -0
  37. package/bin/webui/css/panels/settings.css +227 -0
  38. package/bin/webui/css/panels/stats.css +87 -0
  39. package/bin/webui/fixtures/boundary.js +92 -0
  40. package/bin/webui/fixtures/challenge.js +825 -0
  41. package/bin/webui/fixtures/crosslink.js +31 -0
  42. package/bin/webui/fixtures/docs.js +982 -0
  43. package/bin/webui/fixtures/extra.js +1934 -0
  44. package/bin/webui/fixtures/flow.js +81 -0
  45. package/bin/webui/fixtures/handoff.js +35 -0
  46. package/bin/webui/fixtures/index.js +486 -0
  47. package/bin/webui/fixtures/knowledge.js +291 -0
  48. package/bin/webui/fixtures/maintenance.js +42 -0
  49. package/bin/webui/fixtures/mockrun.js +36 -0
  50. package/bin/webui/fixtures/pact.js +111 -0
  51. package/bin/webui/fixtures/runs.js +109 -0
  52. package/bin/webui/fixtures/settings.js +78 -0
  53. package/bin/webui/fixtures/shell.js +48 -0
  54. package/bin/webui/fixtures/stats.js +104 -0
  55. package/bin/webui/i18n/TERMS.md +134 -0
  56. package/bin/webui/i18n/en/banner.json +29 -0
  57. package/bin/webui/i18n/en/boundary.json +20 -0
  58. package/bin/webui/i18n/en/challenge.json +106 -0
  59. package/bin/webui/i18n/en/common.json +69 -0
  60. package/bin/webui/i18n/en/crosslink.json +69 -0
  61. package/bin/webui/i18n/en/docs.json +175 -0
  62. package/bin/webui/i18n/en/experiment.json +17 -0
  63. package/bin/webui/i18n/en/extra.json +313 -0
  64. package/bin/webui/i18n/en/flow.json +30 -0
  65. package/bin/webui/i18n/en/handoff.json +37 -0
  66. package/bin/webui/i18n/en/knowledge.json +141 -0
  67. package/bin/webui/i18n/en/learn.json +16 -0
  68. package/bin/webui/i18n/en/maintenance.json +52 -0
  69. package/bin/webui/i18n/en/mockrun.json +19 -0
  70. package/bin/webui/i18n/en/nav.json +19 -0
  71. package/bin/webui/i18n/en/overview.json +89 -0
  72. package/bin/webui/i18n/en/pact.json +36 -0
  73. package/bin/webui/i18n/en/runs.json +51 -0
  74. package/bin/webui/i18n/en/settings.json +49 -0
  75. package/bin/webui/i18n/en/stats.json +69 -0
  76. package/bin/webui/i18n/en/tour.json +33 -0
  77. package/bin/webui/i18n/id/banner.json +29 -0
  78. package/bin/webui/i18n/id/boundary.json +20 -0
  79. package/bin/webui/i18n/id/challenge.json +106 -0
  80. package/bin/webui/i18n/id/common.json +70 -0
  81. package/bin/webui/i18n/id/crosslink.json +69 -0
  82. package/bin/webui/i18n/id/docs.json +175 -0
  83. package/bin/webui/i18n/id/experiment.json +17 -0
  84. package/bin/webui/i18n/id/extra.json +313 -0
  85. package/bin/webui/i18n/id/flow.json +30 -0
  86. package/bin/webui/i18n/id/handoff.json +37 -0
  87. package/bin/webui/i18n/id/knowledge.json +141 -0
  88. package/bin/webui/i18n/id/learn.json +16 -0
  89. package/bin/webui/i18n/id/maintenance.json +52 -0
  90. package/bin/webui/i18n/id/mockrun.json +19 -0
  91. package/bin/webui/i18n/id/nav.json +19 -0
  92. package/bin/webui/i18n/id/overview.json +89 -0
  93. package/bin/webui/i18n/id/pact.json +36 -0
  94. package/bin/webui/i18n/id/runs.json +51 -0
  95. package/bin/webui/i18n/id/settings.json +49 -0
  96. package/bin/webui/i18n/id/stats.json +69 -0
  97. package/bin/webui/i18n/id/tour.json +33 -0
  98. package/bin/webui/js/00-core.js +115 -0
  99. package/bin/webui/js/01-i18n.js +149 -0
  100. package/bin/webui/js/02-ui.js +211 -0
  101. package/bin/webui/js/03-md.js +286 -0
  102. package/bin/webui/js/04-router.js +51 -0
  103. package/bin/webui/js/05-banners.js +172 -0
  104. package/bin/webui/js/06-edit.js +183 -0
  105. package/bin/webui/js/90-tour.js +488 -0
  106. package/bin/webui/js/91-shortcuts.js +126 -0
  107. package/bin/webui/js/99-boot.js +118 -0
  108. package/bin/webui/js/panels/boundary.js +104 -0
  109. package/bin/webui/js/panels/challenge.js +781 -0
  110. package/bin/webui/js/panels/crosslink.js +654 -0
  111. package/bin/webui/js/panels/docs.js +1338 -0
  112. package/bin/webui/js/panels/experiment.js +98 -0
  113. package/bin/webui/js/panels/extra.js +3011 -0
  114. package/bin/webui/js/panels/flow.js +297 -0
  115. package/bin/webui/js/panels/handoff.js +169 -0
  116. package/bin/webui/js/panels/knowledge.js +890 -0
  117. package/bin/webui/js/panels/learn.js +220 -0
  118. package/bin/webui/js/panels/maintenance.js +235 -0
  119. package/bin/webui/js/panels/mockrun.js +227 -0
  120. package/bin/webui/js/panels/overview.js +447 -0
  121. package/bin/webui/js/panels/pact.js +189 -0
  122. package/bin/webui/js/panels/runs.js +416 -0
  123. package/bin/webui/js/panels/settings.js +573 -0
  124. package/bin/webui/js/panels/stats.js +378 -0
  125. package/bin/webui/serve.js +557 -0
  126. package/mock-run/INDEX.md +106 -0
  127. package/mock-run/a-normal-day.md +587 -0
  128. package/mock-run/context-combiner.md +100 -0
  129. package/mock-run/extra-recovery.md +330 -0
  130. package/mock-run/extra-slots.md +177 -0
  131. package/mock-run/media/README.md +43 -0
  132. package/mock-run/orc-aftermath.md +392 -0
  133. package/mock-run/orc-boundary.md +356 -0
  134. package/mock-run/orc-brainstorm.md +177 -0
  135. package/mock-run/orc-budget.md +534 -0
  136. package/mock-run/orc-challenge-council.md +262 -0
  137. package/mock-run/orc-challenge.md +416 -0
  138. package/mock-run/orc-cli.md +200 -0
  139. package/mock-run/orc-diy.md +129 -0
  140. package/mock-run/orc-doc.md +448 -0
  141. package/mock-run/orc-explain.md +86 -0
  142. package/mock-run/orc-export.md +423 -0
  143. package/mock-run/orc-extra.md +392 -0
  144. package/mock-run/orc-fast.md +106 -0
  145. package/mock-run/orc-grill.md +151 -0
  146. package/mock-run/orc-handoff.md +480 -0
  147. package/mock-run/orc-pact.md +421 -0
  148. package/mock-run/orc-pattern.md +112 -0
  149. package/mock-run/orc-plan.md +108 -0
  150. package/mock-run/orc-pr-setup.md +126 -0
  151. package/mock-run/orc-quick.md +113 -0
  152. package/mock-run/orc-route.md +93 -0
  153. package/mock-run/orc-ui.md +125 -0
  154. package/mock-run/orc-ultra.md +103 -0
  155. package/mock-run/orc.md +157 -0
  156. package/mock-run/the-example-project.md +55 -0
  157. package/package.json +39 -0
  158. package/templates/agents/MODEL-MAPPING.md +168 -0
  159. package/templates/agents/orc-advisor-fable-5.md +50 -0
  160. package/templates/agents/orc-advisor-opus-5-xhigh.md +56 -0
  161. package/templates/agents/orc-analyst-fable-5.md +115 -0
  162. package/templates/agents/orc-analyze-mini-opus-5-med.md +60 -0
  163. package/templates/agents/orc-analyze-mini-sonnet-5-high.md +58 -0
  164. package/templates/agents/orc-challenge-advisor-opus-5-med.md +75 -0
  165. package/templates/agents/orc-challenge-contrarian-opus-5-high.md +110 -0
  166. package/templates/agents/orc-challenge-executor-opus-5-med.md +114 -0
  167. package/templates/agents/orc-challenge-expansionist-opus-5-med.md +112 -0
  168. package/templates/agents/orc-challenge-judge-opus-5-high.md +132 -0
  169. package/templates/agents/orc-challenge-outsider-opus-5-low.md +109 -0
  170. package/templates/agents/orc-challenge-principles-opus-5-high.md +109 -0
  171. package/templates/agents/orc-challenge-reader-opus-5-low.md +90 -0
  172. package/templates/agents/orc-claude-writer-opus-4-8-high.md +53 -0
  173. package/templates/agents/orc-claude-writer-opus-5-med.md +55 -0
  174. package/templates/agents/orc-context-combiner-opus-5-high.md +88 -0
  175. package/templates/agents/orc-doc-checker-opus-5-low.md +108 -0
  176. package/templates/agents/orc-doc-writer-opus-5-med.md +134 -0
  177. package/templates/agents/orc-executor-haiku-4-5.md +113 -0
  178. package/templates/agents/orc-executor-opus-4-7-high.md +114 -0
  179. package/templates/agents/orc-executor-opus-4-7-med.md +114 -0
  180. package/templates/agents/orc-executor-opus-4-8-high.md +114 -0
  181. package/templates/agents/orc-executor-opus-5-high.md +114 -0
  182. package/templates/agents/orc-executor-opus-5-low.md +114 -0
  183. package/templates/agents/orc-executor-opus-5-med.md +114 -0
  184. package/templates/agents/orc-executor-sonnet-4-6-high.md +114 -0
  185. package/templates/agents/orc-executor-sonnet-4-6-med.md +114 -0
  186. package/templates/agents/orc-executor-sonnet-5-high.md +114 -0
  187. package/templates/agents/orc-judge-fable-5.md +79 -0
  188. package/templates/agents/orc-judge-opus-5-xhigh.md +85 -0
  189. package/templates/agents/orc-learn-writer-opus-5-low.md +73 -0
  190. package/templates/agents/orc-pattern-codifier-opus-5-med.md +65 -0
  191. package/templates/agents/orc-pattern-codifier-sonnet-5-high.md +63 -0
  192. package/templates/agents/orc-planner-fable-5.md +152 -0
  193. package/templates/agents/orc-planner-mini-opus-5-med.md +69 -0
  194. package/templates/agents/orc-planner-mini-sonnet-5-high.md +67 -0
  195. package/templates/agents/orc-planner-opus-5-med.md +160 -0
  196. package/templates/agents/orc-retro-opus-5-med.md +73 -0
  197. package/templates/agents/orc-retro-sonnet-5-high.md +72 -0
  198. package/templates/agents/orc-reviewer-fable-5.md +57 -0
  199. package/templates/agents/orc-reviewer-opus-5-med.md +60 -0
  200. package/templates/agents/orc-scout-opus-5-low.md +40 -0
  201. package/templates/agents/orc-scout-sonnet-4-6-high.md +39 -0
  202. package/templates/agents/orc-system-analyst-opus-5-high.md +120 -0
  203. package/templates/agents/orc-test-author-opus-5-med.md +71 -0
  204. package/templates/agents/orc-trace-writer-haiku-4-5.md +107 -0
  205. package/templates/agents/orc-verifier-opus-5-med.md +69 -0
  206. package/templates/agents/orc-wiki-scanner-opus-4-8-high.md +79 -0
  207. package/templates/agents/orc-wiki-scanner-opus-5-med.md +81 -0
  208. package/templates/agents/orc-wiki-scanner-sonnet-5-high.md +106 -0
  209. package/templates/commands/orc-aftermath.md +49 -0
  210. package/templates/commands/orc-analyze.md +21 -0
  211. package/templates/commands/orc-boundary.md +46 -0
  212. package/templates/commands/orc-brainstorm.md +51 -0
  213. package/templates/commands/orc-budget.md +54 -0
  214. package/templates/commands/orc-challenge.md +58 -0
  215. package/templates/commands/orc-claude.md +14 -0
  216. package/templates/commands/orc-diy.md +13 -0
  217. package/templates/commands/orc-doc.md +128 -0
  218. package/templates/commands/orc-explain.md +20 -0
  219. package/templates/commands/orc-export.md +46 -0
  220. package/templates/commands/orc-fast.md +15 -0
  221. package/templates/commands/orc-grill.md +40 -0
  222. package/templates/commands/orc-handoff.md +52 -0
  223. package/templates/commands/orc-learn.md +17 -0
  224. package/templates/commands/orc-mini.md +12 -0
  225. package/templates/commands/orc-pact.md +44 -0
  226. package/templates/commands/orc-pattern.md +15 -0
  227. package/templates/commands/orc-plan.md +22 -0
  228. package/templates/commands/orc-poly.md +21 -0
  229. package/templates/commands/orc-pr-driver.md +30 -0
  230. package/templates/commands/orc-pr-setup.md +31 -0
  231. package/templates/commands/orc-quick.md +33 -0
  232. package/templates/commands/orc-retro.md +17 -0
  233. package/templates/commands/orc-route.md +41 -0
  234. package/templates/commands/orc-ultra.md +17 -0
  235. package/templates/commands/orc-verify.md +11 -0
  236. package/templates/commands/orc-wiki.md +42 -0
  237. package/templates/commands/orc.md +16 -0
  238. package/templates/hooks/orc-effort-guard.js +178 -0
  239. package/templates/hooks/orc-statusline.js +305 -0
  240. package/templates/hooks/orc-trace.js +471 -0
  241. package/templates/hooks/orc-update-lib.js +125 -0
  242. package/templates/skills/_shared/README.md +50 -0
  243. package/templates/skills/_shared/detecting-artifacts.md +90 -0
  244. package/templates/skills/_shared/drift-recovery.md +98 -0
  245. package/templates/skills/_shared/extra-dispatch.md +1051 -0
  246. package/templates/skills/_shared/fable5-override.md +56 -0
  247. package/templates/skills/_shared/fallback-handoff.md +42 -0
  248. package/templates/skills/_shared/gh-stack-commands.md +65 -0
  249. package/templates/skills/_shared/gotchas.md +177 -0
  250. package/templates/skills/_shared/interview.md +144 -0
  251. package/templates/skills/_shared/lane-suspend.md +82 -0
  252. package/templates/skills/_shared/opus5-only.md +131 -0
  253. package/templates/skills/_shared/pr-templates.md +106 -0
  254. package/templates/skills/_shared/read-ladder.md +54 -0
  255. package/templates/skills/_shared/return-validation.md +145 -0
  256. package/templates/skills/_shared/smoke-gate.md +28 -0
  257. package/templates/skills/_shared/stack-plan.md +135 -0
  258. package/templates/skills/_shared/untrusted-input.md +63 -0
  259. package/templates/skills/context-combiner/SKILL.md +187 -0
  260. package/templates/skills/context-combiner/schemas/combined-report.md +78 -0
  261. package/templates/skills/context-combiner/schemas/combined-requirement-spec.md +87 -0
  262. package/templates/skills/orc/README.md +150 -0
  263. package/templates/skills/orc/SKILL.md +526 -0
  264. package/templates/skills/orc/config.md +389 -0
  265. package/templates/skills/orc/examples/full-run-mock.md +73 -0
  266. package/templates/skills/orc/references/analyst-gates.md +124 -0
  267. package/templates/skills/orc/references/effort-and-mode.md +224 -0
  268. package/templates/skills/orc/references/house-rules.md +20 -0
  269. package/templates/skills/orc/references/intake.md +120 -0
  270. package/templates/skills/orc/references/log-protocol.md +39 -0
  271. package/templates/skills/orc/references/pattern-gate.md +89 -0
  272. package/templates/skills/orc/references/plan-handoff.md +84 -0
  273. package/templates/skills/orc/references/preflight-report.md +220 -0
  274. package/templates/skills/orc/references/security-checklist.md +39 -0
  275. package/templates/skills/orc/references/stop-and-resume.md +160 -0
  276. package/templates/skills/orc/references/trace-protocol.md +314 -0
  277. package/templates/skills/orc/references/ultra-mode.md +123 -0
  278. package/templates/skills/orc/references/wave-grouping.md +121 -0
  279. package/templates/skills/orc/references/wiki-consult.md +177 -0
  280. package/templates/skills/orc/schemas/checkpoint.md +122 -0
  281. package/templates/skills/orc/schemas/intent-spec.md +42 -0
  282. package/templates/skills/orc/schemas/planning-output.md +279 -0
  283. package/templates/skills/orc/subskills/orc-checkpoint/SKILL.md +55 -0
  284. package/templates/skills/orc/subskills/orc-execution/SKILL.md +72 -0
  285. package/templates/skills/orc/subskills/orc-execution/core.md +151 -0
  286. package/templates/skills/orc/subskills/orc-execution/subagent.md +13 -0
  287. package/templates/skills/orc/subskills/orc-planner/SKILL.md +264 -0
  288. package/templates/skills/orc/subskills/orc-planner-mini/SKILL.md +121 -0
  289. package/templates/skills/orc/subskills/orc-pr/SKILL.md +51 -0
  290. package/templates/skills/orc/subskills/orc-pr/pr.md +22 -0
  291. package/templates/skills/orc/subskills/orc-pr/stack-gate.md +108 -0
  292. package/templates/skills/orc/subskills/orc-review-verify/SKILL.md +76 -0
  293. package/templates/skills/orc/subskills/orc-review-verify/core.md +135 -0
  294. package/templates/skills/orc/subskills/orc-review-verify/subagent.md +7 -0
  295. package/templates/skills/orc/subskills/orc-testgen/SKILL.md +45 -0
  296. package/templates/skills/orc/subskills/orc-testgen/core.md +59 -0
  297. package/templates/skills/orc/subskills/orc-testgen/subagent.md +7 -0
  298. package/templates/skills/orc-advisor/SKILL.md +60 -0
  299. package/templates/skills/orc-aftermath/SKILL.md +136 -0
  300. package/templates/skills/orc-aftermath/references/report.md +95 -0
  301. package/templates/skills/orc-analyze/SKILL.md +220 -0
  302. package/templates/skills/orc-analyze/examples/analyze-mock.md +42 -0
  303. package/templates/skills/orc-analyze/references/branching.md +51 -0
  304. package/templates/skills/orc-analyze/references/deep-mode.md +27 -0
  305. package/templates/skills/orc-analyze/references/thin-input.md +77 -0
  306. package/templates/skills/orc-analyze/schemas/report-audit.md +83 -0
  307. package/templates/skills/orc-analyze/schemas/report-prose.md +63 -0
  308. package/templates/skills/orc-analyze/schemas/report-requirement.md +78 -0
  309. package/templates/skills/orc-analyze/schemas/requirement-spec.md +77 -0
  310. package/templates/skills/orc-analyze-mini/SKILL.md +112 -0
  311. package/templates/skills/orc-analyze-mini/examples/quick-analysis-mock.md +31 -0
  312. package/templates/skills/orc-boundary/SKILL.md +208 -0
  313. package/templates/skills/orc-boundary/references/card.md +78 -0
  314. package/templates/skills/orc-boundary/references/gate.md +113 -0
  315. package/templates/skills/orc-brainstorm/SKILL.md +339 -0
  316. package/templates/skills/orc-brainstorm/references/brainstorm-doc.md +133 -0
  317. package/templates/skills/orc-brainstorm/references/lenses.md +152 -0
  318. package/templates/skills/orc-budget/SKILL.md +225 -0
  319. package/templates/skills/orc-budget/references/corpus.md +87 -0
  320. package/templates/skills/orc-challenge/README.md +142 -0
  321. package/templates/skills/orc-challenge/SKILL.md +255 -0
  322. package/templates/skills/orc-challenge/examples/code-module.md +110 -0
  323. package/templates/skills/orc-challenge/examples/council-full-roster.md +273 -0
  324. package/templates/skills/orc-challenge/examples/tsd-two-iterations.md +213 -0
  325. package/templates/skills/orc-challenge/references/conservation.md +107 -0
  326. package/templates/skills/orc-challenge/references/council.md +315 -0
  327. package/templates/skills/orc-challenge/references/cycle-state.md +185 -0
  328. package/templates/skills/orc-challenge/references/dimensions.md +121 -0
  329. package/templates/skills/orc-challenge/references/fix-brief.md +130 -0
  330. package/templates/skills/orc-challenge/references/intake.md +171 -0
  331. package/templates/skills/orc-challenge/references/kinds.md +44 -0
  332. package/templates/skills/orc-challenge/references/plain-english.md +98 -0
  333. package/templates/skills/orc-challenge/references/rubric.md +109 -0
  334. package/templates/skills/orc-challenge/references/sealed-slice.md +97 -0
  335. package/templates/skills/orc-challenge/references/verdict-doc.md +154 -0
  336. package/templates/skills/orc-claude/SKILL.md +199 -0
  337. package/templates/skills/orc-claude/examples/claude-run-mock.md +65 -0
  338. package/templates/skills/orc-claude/references/refresh.md +76 -0
  339. package/templates/skills/orc-claude/references/template.md +109 -0
  340. package/templates/skills/orc-diy/README.md +142 -0
  341. package/templates/skills/orc-diy/SKILL.md +70 -0
  342. package/templates/skills/orc-diy/references/blocks/analyze.md +24 -0
  343. package/templates/skills/orc-diy/references/blocks/execution.md +42 -0
  344. package/templates/skills/orc-diy/references/blocks/extra.md +55 -0
  345. package/templates/skills/orc-diy/references/blocks/header.md +55 -0
  346. package/templates/skills/orc-diy/references/blocks/mock-example.md +22 -0
  347. package/templates/skills/orc-diy/references/blocks/pattern.md +18 -0
  348. package/templates/skills/orc-diy/references/blocks/planning.md +34 -0
  349. package/templates/skills/orc-diy/references/blocks/review.md +18 -0
  350. package/templates/skills/orc-diy/references/blocks/scoring.md +16 -0
  351. package/templates/skills/orc-diy/references/blocks/security.md +25 -0
  352. package/templates/skills/orc-diy/references/blocks/ship.md +25 -0
  353. package/templates/skills/orc-diy/references/blocks/summary.md +18 -0
  354. package/templates/skills/orc-diy/references/blocks/testgen.md +17 -0
  355. package/templates/skills/orc-diy/references/blocks/trace.md +28 -0
  356. package/templates/skills/orc-diy/references/blocks/verify.md +25 -0
  357. package/templates/skills/orc-diy/references/blocks/wiki.md +26 -0
  358. package/templates/skills/orc-diy/references/compile.md +59 -0
  359. package/templates/skills/orc-diy/references/flow-schema.md +100 -0
  360. package/templates/skills/orc-diy/references/locked-blocks.md +37 -0
  361. package/templates/skills/orc-doc/README.md +229 -0
  362. package/templates/skills/orc-doc/SKILL.md +444 -0
  363. package/templates/skills/orc-doc/examples/orc-doc-prd-run.md +325 -0
  364. package/templates/skills/orc-doc/references/chunking.md +527 -0
  365. package/templates/skills/orc-doc/references/gates.md +311 -0
  366. package/templates/skills/orc-doc/references/generation-rules.md +122 -0
  367. package/templates/skills/orc-doc/references/house-rules.md +170 -0
  368. package/templates/skills/orc-doc/references/import-targets.md +40 -0
  369. package/templates/skills/orc-doc/references/plain-language.md +66 -0
  370. package/templates/skills/orc-doc/references/portable-markdown.md +74 -0
  371. package/templates/skills/orc-doc/references/resume-protocol.md +228 -0
  372. package/templates/skills/orc-doc/references/templates/collaboration.md +118 -0
  373. package/templates/skills/orc-doc/references/templates/prd.md +133 -0
  374. package/templates/skills/orc-doc/references/templates/report.md +102 -0
  375. package/templates/skills/orc-doc/references/templates/tsd.md +122 -0
  376. package/templates/skills/orc-doc/references/templates/workflow.md +112 -0
  377. package/templates/skills/orc-explain/SKILL.md +57 -0
  378. package/templates/skills/orc-export/SKILL.md +154 -0
  379. package/templates/skills/orc-fast/SKILL.md +188 -0
  380. package/templates/skills/orc-grill/SKILL.md +207 -0
  381. package/templates/skills/orc-grill/references/grill-doc.md +105 -0
  382. package/templates/skills/orc-handoff/SKILL.md +204 -0
  383. package/templates/skills/orc-handoff/references/handoff-log.md +67 -0
  384. package/templates/skills/orc-handoff/references/surfaces.md +88 -0
  385. package/templates/skills/orc-judge/SKILL.md +82 -0
  386. package/templates/skills/orc-learn/SKILL.md +156 -0
  387. package/templates/skills/orc-learn/examples/learn-run-mock.md +61 -0
  388. package/templates/skills/orc-learn/references/deepen.md +70 -0
  389. package/templates/skills/orc-learn/references/refresh.md +65 -0
  390. package/templates/skills/orc-learn/references/template-knowledge.md +83 -0
  391. package/templates/skills/orc-learn/references/template-learning.md +67 -0
  392. package/templates/skills/orc-mini/SKILL.md +226 -0
  393. package/templates/skills/orc-mini/examples/mini-run-mock.md +50 -0
  394. package/templates/skills/orc-pact/SKILL.md +218 -0
  395. package/templates/skills/orc-pact/references/gate.md +70 -0
  396. package/templates/skills/orc-pact/references/ledger.md +99 -0
  397. package/templates/skills/orc-pattern/SKILL.md +124 -0
  398. package/templates/skills/orc-pattern/references/INDEX.md +73 -0
  399. package/templates/skills/orc-pattern/references/be-django.md +80 -0
  400. package/templates/skills/orc-pattern/references/be-express.md +82 -0
  401. package/templates/skills/orc-pattern/references/be-fastapi.md +107 -0
  402. package/templates/skills/orc-pattern/references/be-go.md +96 -0
  403. package/templates/skills/orc-pattern/references/be-nestjs.md +86 -0
  404. package/templates/skills/orc-pattern/references/be-postgres.md +98 -0
  405. package/templates/skills/orc-pattern/references/fe-a11y.md +36 -0
  406. package/templates/skills/orc-pattern/references/fe-angular.md +87 -0
  407. package/templates/skills/orc-pattern/references/fe-nextjs.md +65 -0
  408. package/templates/skills/orc-pattern/references/fe-perf.md +39 -0
  409. package/templates/skills/orc-pattern/references/fe-react.md +83 -0
  410. package/templates/skills/orc-pattern/references/fe-vue.md +75 -0
  411. package/templates/skills/orc-pattern/schemas/pattern-doc.md +62 -0
  412. package/templates/skills/orc-poly/SKILL.md +216 -0
  413. package/templates/skills/orc-poly/examples/poly-run-mock.md +51 -0
  414. package/templates/skills/orc-poly/references/gather.md +70 -0
  415. package/templates/skills/orc-poly/references/poly-spec.md +84 -0
  416. package/templates/skills/orc-pr-driver/README.md +349 -0
  417. package/templates/skills/orc-pr-driver/SKILL.md +167 -0
  418. package/templates/skills/orc-pr-driver/references/conflict-playbook.md +78 -0
  419. package/templates/skills/orc-pr-driver/references/green-gate.md +105 -0
  420. package/templates/skills/orc-pr-driver/references/orc-run-split.md +99 -0
  421. package/templates/skills/orc-pr-setup/README.md +436 -0
  422. package/templates/skills/orc-pr-setup/SKILL.md +184 -0
  423. package/templates/skills/orc-pr-setup/references/certainty-gate.md +66 -0
  424. package/templates/skills/orc-pr-setup/references/layer-taxonomy.md +67 -0
  425. package/templates/skills/orc-quick/README.md +423 -0
  426. package/templates/skills/orc-quick/SKILL.md +306 -0
  427. package/templates/skills/orc-quick/references/context-doc.md +114 -0
  428. package/templates/skills/orc-quick/references/dispatch-gate.md +163 -0
  429. package/templates/skills/orc-quick/references/gh-mode.md +127 -0
  430. package/templates/skills/orc-retro/SKILL.md +222 -0
  431. package/templates/skills/orc-retro/examples/retro-mock.md +171 -0
  432. package/templates/skills/orc-route/SKILL.md +165 -0
  433. package/templates/skills/orc-verify/SKILL.md +86 -0
  434. package/templates/skills/orc-verify/examples/verify-mock.md +33 -0
  435. package/templates/skills/orc-wiki/README.md +325 -0
  436. package/templates/skills/orc-wiki/SKILL.md +322 -0
  437. package/templates/skills/orc-wiki/examples/wiki-run-mock.md +37 -0
  438. package/templates/skills/orc-wiki/references/claude-md-injection.md +61 -0
  439. package/templates/skills/orc-wiki/references/crosslink-compile.md +39 -0
  440. package/templates/skills/orc-wiki/references/crosslink-kinds.md +57 -0
  441. package/templates/skills/orc-wiki/references/crosslink.md +284 -0
  442. package/templates/skills/orc-wiki/references/extra.md +79 -0
  443. package/templates/skills/orc-wiki/references/integrity-check.md +86 -0
  444. package/templates/skills/orc-wiki/references/orientation.md +51 -0
  445. package/templates/skills/orc-wiki/references/partial-refresh.md +203 -0
  446. package/templates/skills/orc-wiki/references/pattern-prewarm.md +19 -0
  447. package/templates/skills/orc-wiki/references/staleness.md +288 -0
  448. package/templates/skills/orc-wiki/schemas/crosslink-tag.md +166 -0
  449. package/templates/skills/orc-wiki/schemas/wiki-doc.md +120 -0
@@ -0,0 +1,82 @@
1
+ # Playbook — Express (BE)
2
+
3
+ Generic best-practice defaults for Express 4/5 (Node/TS). The codifier OVERRIDES
4
+ the Conventions with the project's observed style; the Invariants always stand.
5
+
6
+ **Activation triggers:** Express, `app.use`, middleware, `Router()`, req/res/next,
7
+ node backend, REST API in package.json with `express`.
8
+
9
+ ## Conventions (PROJECT-OVERRIDABLE — match the codebase)
10
+ - Router-per-resource (`routes/<resource>.ts`) with handlers delegated to a
11
+ service/controller layer — match the project's split (fat routes vs services).
12
+ - Validation layer: match the project (zod, joi, express-validator, celebrate).
13
+ - Error handling funneled to a single error middleware (match its error shape).
14
+ - Async style: match the project (async/await + wrapper vs explicit next(err)).
15
+ - Config loading: match the project (dotenv, convict, env objects).
16
+
17
+ ## Invariants (ALWAYS — BLOCKING)
18
+ - Every async handler routes rejections to `next(err)` (wrapper or try/catch) —
19
+ an unhandled rejection must never crash or hang a request.
20
+ - Validate every request body/param/query BEFORE use — no raw `req.body` into
21
+ the DB or business logic.
22
+ - Parameterized queries ONLY; never string-interpolate SQL.
23
+ - Central error middleware returns typed 4xx for expected failures; never leak
24
+ stack traces, internal messages, or secrets in a response.
25
+ - Config/secrets via env — never hardcoded.
26
+ - Pagination on every collection endpoint.
27
+ - Never mount user input into `res.redirect`/headers unvalidated.
28
+
29
+ ## Validation gate (default acceptance checks; measurable-only)
30
+ Enforce only what is machine-checkable in the target repo; anything needing
31
+ tooling the project lacks is advisory, never gating.
32
+ - Every new endpoint returns the expected status codes: 200 read · 201 create ·
33
+ 404 missing id · 409 conflict · 400/422 invalid body (match the project's
34
+ validator convention).
35
+ - Build/type-check clean IF the project uses TS; lint clean IF it has a linter.
36
+ - Every new async handler visibly routes errors to `next` (wrapper or catch).
37
+ - Every new collection endpoint paginates (params visible in the signature).
38
+ - Advisory only (never gate; requires tooling the project may lack): coverage
39
+ target on the new surface, p95 latency budget.
40
+
41
+ ## Worked example (SHAPE REFERENCE — the project's observed layout ALWAYS wins)
42
+ Imitate the SHAPE (validate → service → typed error → central middleware),
43
+ never this exact layout/naming when the project differs.
44
+
45
+ ```ts
46
+ // routes/orders.ts — validated input, async-safe, paginated
47
+ import { Router } from "express";
48
+ import { z } from "zod";
49
+
50
+ const router = Router();
51
+
52
+ const CreateOrder = z.object({ itemId: z.number().int(), quantity: z.number().int().positive() });
53
+ const ListQuery = z.object({ limit: z.coerce.number().max(100).default(50), offset: z.coerce.number().default(0) });
54
+
55
+ router.post("/", async (req, res, next) => {
56
+ try {
57
+ const data = CreateOrder.parse(req.body); // validate BEFORE use
58
+ const order = await orderService.create(data);
59
+ res.status(201).json(order);
60
+ } catch (err) { next(err); } // always to the funnel
61
+ });
62
+
63
+ router.get("/", async (req, res, next) => {
64
+ try {
65
+ const { limit, offset } = ListQuery.parse(req.query);
66
+ res.json(await orderService.list({ limit, offset })); // paginated
67
+ } catch (err) { next(err); }
68
+ });
69
+
70
+ export default router;
71
+
72
+ // middleware/error.ts — single funnel, typed 4xx, no leaks
73
+ export function errorHandler(err: unknown, req: Request, res: Response, _next: NextFunction) {
74
+ if (err instanceof z.ZodError) return res.status(400).json({ error: "Invalid input" });
75
+ if (err instanceof NotFoundError) return res.status(404).json({ error: err.publicMessage });
76
+ logger.error(err); // full detail stays server-side
77
+ res.status(500).json({ error: "Internal error" }); // never the stack trace
78
+ }
79
+ ```
80
+
81
+ ## Delivery order
82
+ route → validation schema → service → error wiring → test.
@@ -0,0 +1,107 @@
1
+ # Playbook — FastAPI (BE)
2
+
3
+ Generic best-practice defaults for FastAPI. The codifier OVERRIDES the Conventions
4
+ with the project's observed style; the Invariants always stand.
5
+
6
+ **Activation triggers:** FastAPI, Pydantic, async Python, APIRouter, Depends,
7
+ BaseModel, endpoint, router, CRUD.
8
+
9
+ ## Conventions (PROJECT-OVERRIDABLE — match the codebase)
10
+ - One `APIRouter` per resource (match the project's file layout — e.g.
11
+ `app/routers/<resource>.py`, CRUD split into `app/crud/` if the project does).
12
+ - Pydantic v2 schemas per resource (match the project's In/Out suffix + location).
13
+ - DI via `Depends(...)` (match the project's session/dependency names).
14
+ - Pagination style: match the project (limit/offset or cursor).
15
+
16
+ ## Invariants (ALWAYS — BLOCKING)
17
+ - `async def` for all I/O paths; never block the event loop with sync I/O.
18
+ - Validate every request body/param with a Pydantic model — no raw dicts in.
19
+ - Parameterized queries ONLY; never string-interpolate SQL.
20
+ - Typed HTTP errors (`HTTPException` w/ correct 4xx), never a generic 500 leak.
21
+ - Never expose passwords, secrets, or stack traces in a response.
22
+ - Config/secrets via settings/env — never hardcoded.
23
+ - Pagination on every collection endpoint.
24
+
25
+ ## Validation gate (default acceptance checks; measurable-only)
26
+ Enforce only what is machine-checkable in the target repo; anything needing
27
+ tooling the project lacks is advisory, never gating.
28
+ - Every new endpoint returns the expected status codes: 200 read · 201 create ·
29
+ 404 missing id · 409 conflict/duplicate · 422 invalid body (FastAPI default).
30
+ - Every collection endpoint paginates (params visible in the signature).
31
+ - Every request body/param passes through a Pydantic model (no raw `dict` params).
32
+ - Import/type check clean with the project's own tools (`ruff`/`mypy` IF present).
33
+ - OpenAPI (`/docs`) reflects the real contract (schemas registered, not `Any`).
34
+ - Advisory only (never gate; requires tooling the project may lack): coverage
35
+ target on the new surface, p95 latency budget.
36
+
37
+ ## Worked example (SHAPE REFERENCE — the project's observed layout ALWAYS wins)
38
+ A minimal-complete slice showing all layers. Imitate the SHAPE (schema → router
39
+ → CRUD → dependency), NEVER this exact layout/naming when the project differs —
40
+ the codifier's reconciled conventions override everything here.
41
+
42
+ ```python
43
+ # schemas/order.py — In/Out models (v2)
44
+ from pydantic import BaseModel, Field
45
+
46
+ class OrderIn(BaseModel):
47
+ item_id: int
48
+ quantity: int = Field(gt=0)
49
+
50
+ class OrderOut(BaseModel):
51
+ id: int
52
+ item_id: int
53
+ quantity: int
54
+ model_config = {"from_attributes": True}
55
+
56
+ # crud/order.py — data access, parameterized only
57
+ from sqlalchemy import select
58
+ from sqlalchemy.ext.asyncio import AsyncSession
59
+ from models import Order
60
+
61
+ async def create_order(db: AsyncSession, data: "OrderIn") -> Order:
62
+ order = Order(**data.model_dump())
63
+ db.add(order)
64
+ await db.commit()
65
+ await db.refresh(order)
66
+ return order
67
+
68
+ async def get_order(db: AsyncSession, order_id: int) -> Order | None:
69
+ return await db.scalar(select(Order).where(Order.id == order_id))
70
+
71
+ # deps.py — one isolated auth dependency
72
+ from fastapi import Depends, HTTPException, status
73
+ from fastapi.security import OAuth2PasswordBearer
74
+
75
+ oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
76
+
77
+ async def current_user(token: str = Depends(oauth2_scheme)) -> "User":
78
+ user = await resolve_user(token) # however the project resolves it
79
+ if user is None:
80
+ raise HTTPException(status.HTTP_401_UNAUTHORIZED, "Invalid credentials")
81
+ return user
82
+
83
+ # routers/order.py — endpoint wiring: typed errors, DI, pagination
84
+ from fastapi import APIRouter, Depends, HTTPException, status
85
+
86
+ router = APIRouter(prefix="/orders", tags=["orders"])
87
+
88
+ @router.post("", response_model=OrderOut, status_code=status.HTTP_201_CREATED)
89
+ async def create(data: OrderIn, db: AsyncSession = Depends(get_db),
90
+ user: User = Depends(current_user)) -> OrderOut:
91
+ return await crud.create_order(db, data)
92
+
93
+ @router.get("/{order_id}", response_model=OrderOut)
94
+ async def read(order_id: int, db: AsyncSession = Depends(get_db)) -> OrderOut:
95
+ order = await crud.get_order(db, order_id)
96
+ if order is None:
97
+ raise HTTPException(status.HTTP_404_NOT_FOUND, "Order not found")
98
+ return order
99
+
100
+ @router.get("", response_model=list[OrderOut])
101
+ async def list_orders(limit: int = 50, offset: int = 0,
102
+ db: AsyncSession = Depends(get_db)) -> list[OrderOut]:
103
+ return await crud.list_orders(db, limit=limit, offset=offset)
104
+ ```
105
+
106
+ ## Delivery order
107
+ schema → router/endpoint → CRUD/service → dependency wiring → test.
@@ -0,0 +1,96 @@
1
+ # Playbook — Go (BE)
2
+
3
+ Generic best-practice defaults for idiomatic Go services (HTTP + gRPC, with Redis
4
+ and SQL data layers). The codifier OVERRIDES the Conventions with the project's
5
+ observed style; the Invariants always stand. Covers the golang-pro surface:
6
+ concurrency, errors, interfaces, generics, project structure, testing — plus
7
+ transport (gRPC) and data (Redis/SQL).
8
+
9
+ **Activation triggers:** Go, Golang, goroutines, channels, context, gRPC, protobuf,
10
+ Redis, database/sql, sqlx, pgx, generics, `go.mod`, microservices.
11
+
12
+ ## Conventions (PROJECT-OVERRIDABLE — match the codebase)
13
+ - **Layout:** small, consumer-defined interfaces; composition over inheritance.
14
+ Match the project's `cmd/` (entrypoints), `internal/` (private), `pkg/` (public).
15
+ - **Config:** functional options or env-loaded struct (match the project's approach).
16
+ - **Transport:** match the project's router (net/http, chi, gin, echo) and, for
17
+ gRPC, its proto layout + generated-code location + interceptor chain.
18
+ - **Data:** match the project's DB access (database/sql, sqlx, pgx, or an ORM) and
19
+ its Redis client usage (go-redis) + key-naming scheme.
20
+ - **Concurrency:** match the project's worker-pool / errgroup / channel patterns.
21
+
22
+ ## Invariants (ALWAYS — BLOCKING)
23
+ **Errors & control flow**
24
+ - Handle EVERY error explicitly — no bare `_` discards of an `error`.
25
+ - Wrap propagated errors with `fmt.Errorf("...: %w", err)` (preserve the chain).
26
+ - Never `panic` for normal control flow.
27
+
28
+ **Concurrency**
29
+ - Pass `context.Context` as the first arg to all blocking/I/O ops; honor
30
+ cancellation (`<-ctx.Done()`) in every worker — no goroutine without a clear
31
+ lifecycle/shutdown path (no leaks).
32
+ - Protect shared state (mutex/channel); code must pass the race detector.
33
+
34
+ **Transport (HTTP / gRPC)**
35
+ - Every inbound handler/RPC threads the request `context.Context` down to I/O.
36
+ - Set server + client timeouts / deadlines; never an unbounded call.
37
+ - gRPC: return proper `status.Error(codes.…)` codes, never leak internal errors;
38
+ validate every request message; register health + reflection as the project does.
39
+ - Never expose secrets, stack traces, or internal error strings to callers.
40
+
41
+ **Data (Redis / SQL)**
42
+ - Parameterized queries ONLY; never string-interpolate SQL.
43
+ - Always close/release rows, statements, and acquired connections (`defer`).
44
+ - Redis: set TTLs on cache keys (no unbounded growth); handle cache-miss as a
45
+ normal path, not an error; never store secrets in plaintext cache values.
46
+ - Config/secrets (DSNs, Redis URLs, tokens) via env — never hardcoded.
47
+
48
+ ## Validation gate (default acceptance checks; measurable-only)
49
+ Enforce only what is machine-checkable in the target repo; anything needing
50
+ tooling the project lacks is advisory, never gating.
51
+ - `go build ./...` and `go vet ./...` clean.
52
+ - `golangci-lint run` clean IF the project uses it.
53
+ - Tests pass under the **race detector** (`go test -race ./...`).
54
+ - No bare `_` error discards and no un-wrapped propagated errors in the diff.
55
+ - For gRPC changes: proto regenerated + committed; server starts and serves.
56
+ - Advisory only (never gate; requires tooling the project may lack): coverage
57
+ target on the new surface, p95 latency budget.
58
+
59
+ ## Worked example (SHAPE REFERENCE — the project's observed layout ALWAYS wins)
60
+ Imitate the SHAPE (consumer-defined interface → implementation with wrapped
61
+ errors → ctx-aware worker), never this exact layout/naming when the project differs.
62
+
63
+ ```go
64
+ // order/service.go — consumer-defined contract + implementation
65
+ type OrderStore interface {
66
+ GetOrder(ctx context.Context, id int64) (*Order, error)
67
+ }
68
+
69
+ func (s *Service) OrderSummary(ctx context.Context, id int64) (*Summary, error) {
70
+ order, err := s.store.GetOrder(ctx, id) // ctx threads down to I/O
71
+ if err != nil {
72
+ return nil, fmt.Errorf("order summary %d: %w", id, err) // wrap, keep chain
73
+ }
74
+ return buildSummary(order), nil
75
+ }
76
+
77
+ // order/worker.go — goroutine with a clear lifecycle
78
+ func (s *Service) RunDigest(ctx context.Context, every time.Duration) error {
79
+ t := time.NewTicker(every)
80
+ defer t.Stop()
81
+ for {
82
+ select {
83
+ case <-ctx.Done():
84
+ return ctx.Err() // clean shutdown path
85
+ case <-t.C:
86
+ if err := s.sendDigest(ctx); err != nil {
87
+ s.log.Error("digest", "err", err) // handle, never discard
88
+ }
89
+ }
90
+ }
91
+ }
92
+ ```
93
+
94
+ ## Delivery order
95
+ proto/interface (contract) → implementation → data/transport wiring →
96
+ table-driven test (`-race`).
@@ -0,0 +1,86 @@
1
+ # Playbook — NestJS (BE)
2
+
3
+ Generic best-practice defaults for NestJS. The codifier OVERRIDES the Conventions
4
+ with the project's observed style; the Invariants always stand.
5
+
6
+ **Activation triggers:** NestJS, `@Injectable`, `@Controller`, module, provider,
7
+ DTO, guard, pipe, `@nestjs/swagger`.
8
+
9
+ ## Conventions (PROJECT-OVERRIDABLE — match the codebase)
10
+ - Feature module per domain: `*.module.ts` wiring `*.controller.ts` +
11
+ `*.service.ts` + `dto/*.dto.ts` (match the project's folder layout).
12
+ - Constructor injection for all services (match the project's provider naming).
13
+ - DTOs with `class-validator` decorators (match project's In/Out/Create naming).
14
+ - Swagger annotations on endpoints (match the project's decorator usage).
15
+
16
+ ## Invariants (ALWAYS — BLOCKING)
17
+ - Dependency injection ONLY — never `new SomeService()`; use `@Injectable()` +
18
+ constructor injection.
19
+ - Global `ValidationPipe` + `class-validator` on every DTO — no unvalidated input.
20
+ - Typed exceptions (`NotFoundException`, `ConflictException`), never generic errors.
21
+ - Never expose passwords, secrets, or stack traces in responses.
22
+ - Config/secrets via `ConfigModule`/env — never hardcoded.
23
+ - No circular module deps; `forwardRef()` is a last resort, not a default.
24
+ - No unjustified `any`.
25
+
26
+ ## Validation gate (default acceptance checks; measurable-only)
27
+ Enforce only what is machine-checkable in the target repo; anything needing
28
+ tooling the project lacks is advisory, never gating.
29
+ - Every new endpoint returns the expected status codes: 200 read · 201 create ·
30
+ 404 missing id · 409 conflict · 400 invalid body (ValidationPipe default).
31
+ - `nest build` clean; dependency graph resolves (no circular-dep errors).
32
+ - Every new DTO field carries a `class-validator` decorator (visible in diff).
33
+ - Lint clean IF the project has a linter.
34
+ - Swagger reflects the real contract IF the project uses `@nestjs/swagger`.
35
+ - Advisory only (never gate; requires tooling the project may lack): coverage
36
+ target on the new surface, p95 latency budget.
37
+
38
+ ## Worked example (SHAPE REFERENCE — the project's observed layout ALWAYS wins)
39
+ A minimal-complete feature slice. Imitate the SHAPE (module → controller →
40
+ service → DTO), never this exact layout/naming when the project differs.
41
+
42
+ ```ts
43
+ // dto/create-order.dto.ts — validated input
44
+ import { IsInt, IsPositive } from "class-validator";
45
+
46
+ export class CreateOrderDto {
47
+ @IsInt() itemId: number;
48
+ @IsInt() @IsPositive() quantity: number;
49
+ }
50
+
51
+ // order.service.ts — typed errors, injected deps
52
+ @Injectable()
53
+ export class OrderService {
54
+ constructor(private readonly repo: OrderRepository) {}
55
+
56
+ async findOne(id: number): Promise<Order> {
57
+ const order = await this.repo.findById(id);
58
+ if (!order) throw new NotFoundException(`Order ${id} not found`);
59
+ return order;
60
+ }
61
+
62
+ async create(dto: CreateOrderDto): Promise<Order> {
63
+ return this.repo.create(dto);
64
+ }
65
+ }
66
+
67
+ // order.controller.ts — thin, status codes explicit
68
+ @Controller("orders")
69
+ export class OrderController {
70
+ constructor(private readonly orders: OrderService) {}
71
+
72
+ @Post()
73
+ @HttpCode(HttpStatus.CREATED)
74
+ create(@Body() dto: CreateOrderDto) { return this.orders.create(dto); }
75
+
76
+ @Get(":id")
77
+ findOne(@Param("id", ParseIntPipe) id: number) { return this.orders.findOne(id); }
78
+ }
79
+
80
+ // order.module.ts — feature module wiring
81
+ @Module({ controllers: [OrderController], providers: [OrderService, OrderRepository] })
82
+ export class OrderModule {}
83
+ ```
84
+
85
+ ## Delivery order
86
+ module → controller → service → DTOs → unit test.
@@ -0,0 +1,98 @@
1
+ # Playbook — Postgres data-access (BE, cross-cutting)
2
+
3
+ Generic best-practice defaults for **Postgres query & data-access code** — the
4
+ `getDataUser`-style layer: repositories, DAOs, query builders, raw SQL, ORM calls.
5
+ Unlike a framework playbook this is **cross-cutting**: it co-applies on TOP of the
6
+ task's framework pattern (Express/FastAPI/NestJS/Django/Go/…) whenever a task
7
+ touches the DB layer. The codifier OVERRIDES the Conventions with the project's
8
+ observed data-access style; the Invariants always stand. Never connects to a
9
+ database — everything here is reconciled from the repo's own files.
10
+
11
+ **Activation triggers:** Postgres, `pg`, `psycopg`, `asyncpg`, `pgx`, `lib/pq`,
12
+ `Npgsql`, Prisma `provider = "postgresql"`, `postgrex`/Ecto, SQLAlchemy,
13
+ `repository`/`dao`/`queries` modules, `.sql` files, migrations, "query the DB",
14
+ `SELECT`/`INSERT`/`UPDATE`/`DELETE`, `getX`/`findX`/`listX` data-access functions.
15
+
16
+ ## Conventions (PROJECT-OVERRIDABLE — match the codebase)
17
+ - Access path: match the project — raw driver, query builder (Knex/Drizzle/sqlc),
18
+ or ORM (Prisma/TypeORM/SQLAlchemy/ActiveRecord/Ecto). NEVER introduce a second
19
+ client/ORM alongside the one already in use.
20
+ - Where data-access lives: match the project's layout (`repositories/`, `dao/`,
21
+ `db/queries/`, `models/`, co-located `*.sql`) and its file-per-resource split.
22
+ - Column selection: match the project — if it lists explicit columns, list them
23
+ (no `SELECT *`); if it maps rows to a DTO/entity, return that same type.
24
+ - Naming: match the project's table/column case (usually `snake_case`) and its
25
+ mapping to app-side field names.
26
+ - Error surface: match how the project turns a DB error / not-found into an app
27
+ error (typed error, `Result`, nullable return) — don't invent a new shape.
28
+ - Migrations: match the project's tool (Prisma, Alembic, Flyway, Liquibase,
29
+ `db/migrate`, sqlc) and file convention.
30
+
31
+ ## Invariants (ALWAYS — BLOCKING)
32
+ - **Parameterized / bound queries ONLY.** Never build SQL by string
33
+ concatenation or interpolation of any caller-supplied value — bind every
34
+ parameter. (SQL-injection.) Dynamic identifiers (table/column names) must come
35
+ from a fixed allow-list, never raw input.
36
+ - **No credentials or connection strings hardcoded** in data-access code — read
37
+ from the project's existing config/env source.
38
+ - **Atomic multi-write = one transaction.** Two+ writes that must all-or-nothing
39
+ succeed run in a single transaction with a clear commit/rollback path.
40
+ - **No DDL or migrations from a request/data-access function** — schema changes
41
+ go through the project's migration tool, not inline.
42
+ - **Use the configured connection pool** — never open a per-call connection or
43
+ bypass the pool.
44
+ - **Never leak DB errors verbatim** to the caller/response (no raw driver
45
+ messages, SQLSTATE, or query text in a user-facing error).
46
+
47
+ ## Validation gate (default acceptance checks; measurable-only)
48
+ Enforce only what is machine-checkable in the target repo; anything needing
49
+ tooling the project lacks is advisory, never gating.
50
+ - Every new query uses bound parameters — no user value inside the SQL string
51
+ (visible in the diff).
52
+ - New data-access functions go through the existing client/pool, not a fresh
53
+ connection.
54
+ - Multi-write operations are wrapped in a transaction (visible in the code).
55
+ - Build/type-check clean IF the project uses a typed stack; lint clean IF it has
56
+ a linter.
57
+ - Advisory only (never gate; needs tooling/data the project may lack): `EXPLAIN`
58
+ plan review, index coverage for new filter/join columns, N+1 audit under load.
59
+
60
+ ## Worked example (SHAPE REFERENCE — the project's observed layer ALWAYS wins)
61
+ Imitate the SHAPE (bound params → existing client → typed return → transaction on
62
+ multi-write), never this exact driver/naming when the project differs.
63
+
64
+ ```ts
65
+ // repositories/users.ts — bound params, pooled client, explicit columns, typed return
66
+ import { pool } from "../db/client"; // the project's existing pool
67
+ import type { User } from "../types";
68
+
69
+ export async function getDataUser(id: number): Promise<User | null> {
70
+ const { rows } = await pool.query(
71
+ `SELECT id, email, name, created_at
72
+ FROM users
73
+ WHERE id = $1`, // $1 bound — never `${id}`
74
+ [id],
75
+ );
76
+ return rows[0] ?? null; // not-found handled explicitly
77
+ }
78
+
79
+ // atomic multi-write → one transaction
80
+ export async function transferCredits(fromId: number, toId: number, amount: number) {
81
+ const client = await pool.connect();
82
+ try {
83
+ await client.query("BEGIN");
84
+ await client.query(`UPDATE accounts SET balance = balance - $1 WHERE id = $2`, [amount, fromId]);
85
+ await client.query(`UPDATE accounts SET balance = balance + $1 WHERE id = $2`, [amount, toId]);
86
+ await client.query("COMMIT");
87
+ } catch (err) {
88
+ await client.query("ROLLBACK");
89
+ throw err; // wrapped to a typed app error upstream
90
+ } finally {
91
+ client.release(); // always back to the pool
92
+ }
93
+ }
94
+ ```
95
+
96
+ ## Delivery order
97
+ migration (if schema changes) → data-access function (bound query) → app-error
98
+ mapping → wire into the calling service → test.
@@ -0,0 +1,36 @@
1
+ # Rule pack — Frontend Accessibility (impact-ordered, capped)
2
+
3
+ NOT a language playbook — a reviewer re-check pack. The orchestrator passes
4
+ these rules as `fe_rules[]` when the run touched FE files; the reviewer checks
5
+ ONLY the diff against them and emits **file:line** findings classified P1–P3 by
6
+ real user impact (an a11y rule hit is never automatic P0 — invariants own P0).
7
+
8
+ Deliberately capped at 15 rules, highest-impact first. Do NOT extend ad hoc —
9
+ a 100-rule sweep per FE slice buries real findings and blows the review context.
10
+
11
+ ## Rules (impact-ordered)
12
+
13
+ 1. Interactive elements are REAL controls — `<button>`/`<a>`/`<input>`, not
14
+ `div onClick` (keyboard + AT reachability). *(usually P1)*
15
+ 2. Every form input has a programmatic label (`<label for>`, `aria-label`, or
16
+ `aria-labelledby`) — placeholder text is not a label. *(P1)*
17
+ 3. Keyboard path exists for every new flow: focusable, Enter/Space activates,
18
+ no positive `tabindex`, no keyboard trap. *(P1)*
19
+ 4. Focus is managed on view changes: modals trap + restore focus; route changes
20
+ move focus to the new content. *(P1)*
21
+ 5. Images: meaningful images have real `alt`; decorative ones have `alt=""` —
22
+ never a missing attribute. *(P2)*
23
+ 6. Color is never the only signal (error states, required fields, chart series
24
+ also get text/icon/pattern). *(P2)*
25
+ 7. Text contrast meets 4.5:1 (3:1 for large text) against its actual background. *(P2)*
26
+ 8. Heading levels are hierarchical — no skipped levels, one `<h1>` per view. *(P2)*
27
+ 9. Dynamic status updates announce via `role="status"`/`aria-live` (loading,
28
+ save confirmations, async errors). *(P2)*
29
+ 10. Disabled/loading states communicated to AT (`aria-disabled`, `aria-busy`),
30
+ not just styled. *(P2)*
31
+ 11. Touch targets ≥ 44×44 CSS px on new interactive elements. *(P2)*
32
+ 12. `prefers-reduced-motion` respected for new animations/transitions. *(P3)*
33
+ 13. Semantic landmarks for new page regions (`<nav>`, `<main>`, `<aside>`)
34
+ instead of bare divs. *(P3)*
35
+ 14. Language of parts: content in another language gets a `lang` attribute. *(P3)*
36
+ 15. Autocomplete attributes on common personal fields (name, email, address). *(P3)*
@@ -0,0 +1,87 @@
1
+ # Playbook — Angular (FE)
2
+
3
+ Generic best-practice defaults for Angular 17+ (standalone components, signals).
4
+ The codifier OVERRIDES the Conventions with the project's observed style; the
5
+ Invariants always stand.
6
+
7
+ **Activation triggers:** Angular, `@Component`, `@Injectable`, standalone,
8
+ signals, RxJS, `angular.json`, NgModule, directive, `HttpClient`.
9
+
10
+ ## Conventions (PROJECT-OVERRIDABLE — match the codebase)
11
+ - Standalone components (match the project — NgModule projects stay NgModule).
12
+ - State: match the project (signals, RxJS services, NgRx) — never mix a new
13
+ state style in.
14
+ - Feature-folder layout (`features/<domain>/`) — match the project's structure.
15
+ - Data access via injected services wrapping `HttpClient`; components stay thin.
16
+ - Template style: match the project (control-flow `@if/@for` vs `*ngIf/*ngFor`).
17
+
18
+ ## Invariants (ALWAYS — BLOCKING)
19
+ - Every subscription is cleaned up (`takeUntilDestroyed`, `async` pipe, or
20
+ explicit unsubscribe) — no leaked subscriptions.
21
+ - `track` (or `trackBy`) on every `@for`/`*ngFor` over mutable lists.
22
+ - Never call functions with side effects from templates; keep change detection safe.
23
+ - Sanitize/never bypass DOM sanitization (`bypassSecurityTrust*` is a last
24
+ resort with justification, never a convenience).
25
+ - No secrets in client code or environment files that ship to the browser.
26
+ - Accessibility: semantic HTML + ARIA on interactive elements; label every input.
27
+ - HTTP errors handled (typed error path or interceptor) — no silent `subscribe()`.
28
+
29
+ ## Validation gate (default acceptance checks; measurable-only)
30
+ Enforce only what is machine-checkable in the target repo; anything needing
31
+ tooling the project lacks is advisory, never gating.
32
+ - `ng build` clean — **zero type errors** (strict IF the project uses it).
33
+ - Lint clean IF the project has a linter.
34
+ - Every new `@for`/`*ngFor` has a `track`/`trackBy` (visible in the diff).
35
+ - Every new subscription shows its cleanup path (visible in the diff).
36
+ - Advisory only (never gate; requires tooling the project may lack):
37
+ bundle-size budget, Lighthouse score on changed routes.
38
+
39
+ ## Worked example (SHAPE REFERENCE — the project's observed layout ALWAYS wins)
40
+ Standalone + signals flavor shown. Imitate the SHAPE (thin component → injected
41
+ service → cleaned-up stream), never this exact style when the project differs.
42
+
43
+ ```ts
44
+ // features/orders/order.service.ts — data access lives in the service
45
+ @Injectable({ providedIn: "root" })
46
+ export class OrderService {
47
+ private http = inject(HttpClient);
48
+ getOrder(id: string): Observable<Order> {
49
+ return this.http.get<Order>(`/api/orders/${id}`);
50
+ }
51
+ }
52
+
53
+ // features/orders/order-status.component.ts — thin, cleaned-up, tracked
54
+ @Component({
55
+ selector: "app-order-status",
56
+ standalone: true,
57
+ template: `
58
+ @if (order(); as o) {
59
+ <section aria-label="Order status">
60
+ <h2>{{ o.title }}</h2>
61
+ <ul>
62
+ @for (item of o.items; track item.id) {
63
+ <li>{{ item.name }}</li>
64
+ }
65
+ </ul>
66
+ </section>
67
+ } @else {
68
+ <p role="status">Loading order…</p>
69
+ }
70
+ `,
71
+ })
72
+ export class OrderStatusComponent {
73
+ private route = inject(ActivatedRoute);
74
+ private orders = inject(OrderService);
75
+
76
+ order = toSignal(
77
+ this.route.paramMap.pipe(
78
+ map((p) => p.get("id")!),
79
+ switchMap((id) => this.orders.getOrder(id)),
80
+ takeUntilDestroyed(), // cleanup, always
81
+ ),
82
+ );
83
+ }
84
+ ```
85
+
86
+ ## Delivery order
87
+ service → component → template/styles → route wiring → test.
@@ -0,0 +1,65 @@
1
+ # Playbook — Next.js (FE)
2
+
3
+ Generic best-practice defaults for Next.js App Router. The codifier OVERRIDES the
4
+ Conventions with the project's observed style; the Invariants always stand.
5
+
6
+ **Activation triggers:** Next.js, App Router, RSC, Server Components, Server
7
+ Actions, `use client`, route handlers, `generateMetadata`, revalidate.
8
+
9
+ ## Conventions (PROJECT-OVERRIDABLE — match the codebase)
10
+ - Server Components by default; add `'use client'` only at the LEAF that needs it.
11
+ - Route handlers in `app/**/route.ts`; pages in `app/**/page.tsx`.
12
+ - Mutations via Server Actions; call `revalidatePath()`/`revalidateTag()` after.
13
+ - Explicit cache directives on fetches (`next: { revalidate: N }` or `cache`).
14
+ - Metadata via `generateMetadata`/`metadata` export, not hand-written `<meta>`.
15
+ - (Project may still use the Pages Router — if so, MATCH it, don't force App Router.)
16
+
17
+ ## Invariants (ALWAYS — BLOCKING)
18
+ - Never put a plain `<img>` for content images — use `next/image`.
19
+ - Never leak server-only secrets into client components or `NEXT_PUBLIC_*`.
20
+ - Server Actions validate their input server-side (never trust the client).
21
+ - No blocking sync work in a Server Component render path.
22
+ - Accessibility: semantic HTML + ARIA; label every input.
23
+
24
+ ## Validation gate (default acceptance checks; measurable-only)
25
+ Enforce only what is machine-checkable in the target repo; anything needing
26
+ tooling the project lacks is advisory, never gating.
27
+ - `next build` locally → **zero type errors**.
28
+ - `NEXT_PUBLIC_*` vs server-only env vars correctly separated (visible in diff).
29
+ - Every new Server Action validates its input server-side (visible in diff).
30
+ - Content images in new code use `next/image`, not `<img>` (visible in diff).
31
+ - Advisory only (never gate; requires tooling the project may lack):
32
+ Lighthouse/Core Web Vitals score on changed routes, bundle-size budget.
33
+
34
+ ## Worked example (SHAPE REFERENCE — the project's observed layout ALWAYS wins)
35
+ Imitate the SHAPE (RSC fetch + validated Server Action), never this exact
36
+ layout/naming when the project differs — including Pages Router projects.
37
+
38
+ ```tsx
39
+ // app/orders/[id]/page.tsx — async Server Component, explicit cache directive
40
+ export default async function OrderPage({ params }: { params: { id: string } }) {
41
+ const res = await fetch(`${process.env.API_URL}/orders/${params.id}`, {
42
+ next: { revalidate: 60 },
43
+ });
44
+ if (!res.ok) notFound();
45
+ const order: Order = await res.json();
46
+ return <OrderView order={order} />;
47
+ }
48
+
49
+ // app/orders/actions.ts — Server Action: validate server-side, then revalidate
50
+ "use server";
51
+ import { z } from "zod";
52
+ import { revalidatePath } from "next/cache";
53
+
54
+ const UpdateQty = z.object({ orderId: z.string(), quantity: z.coerce.number().int().positive() });
55
+
56
+ export async function updateQuantity(formData: FormData) {
57
+ const parsed = UpdateQty.safeParse(Object.fromEntries(formData));
58
+ if (!parsed.success) return { error: "Invalid input" }; // never trust the client
59
+ await db.order.update(parsed.data); // the project's data layer
60
+ revalidatePath(`/orders/${parsed.data.orderId}`);
61
+ }
62
+ ```
63
+
64
+ ## Delivery order
65
+ page/layout → server component(s) → client leaf → server action → config → test.