@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,84 @@
1
+ # orc-poly — the source-of-truth doc set
2
+
3
+ Load at Phase P3. All three files live in the HOST repo under
4
+ `poly-repo-implementation/<slug>/` — a visible, committed deliverable, never
5
+ inside `.claude/`. Together they are the carried source of truth: the context a
6
+ human reads, the boundary both repos are pinned to, and the machine-readable
7
+ spec the planner splits on.
8
+
9
+ ## `poly-context.md` — the human-readable understanding
10
+
11
+ Free-form but structured. Cover:
12
+
13
+ - **Change** — one paragraph on what is being built across the repos.
14
+ - **Repos & roles** — a row per repo: name, absolute path, role
15
+ (`host` | `peer`), the side of the boundary it owns or consumes.
16
+ - **Per-repo touch points** — the real files/dirs each repo changes (anchored
17
+ to paths that actually exist — confirmed in P2), plus a one-line note of how
18
+ the local conventions do this kind of change.
19
+ - **Decisions** — the ambiguities resolved during the P2 question loop, each
20
+ with the answer that was pinned.
21
+
22
+ ## `interface-contract.md` — the FROZEN boundary
23
+
24
+ The anti-drift core. This is the one artifact every repo's plan is pinned to,
25
+ so it must be exact and self-contained. Cover the shared seam precisely:
26
+
27
+ - **Endpoint / RPC / event** — method + path, or RPC name, or event topic.
28
+ - **Request** — every field: name, type, nullability, constraints; auth
29
+ header/token.
30
+ - **Response** — success shape (every field, type, nullability), pagination if
31
+ any.
32
+ - **Errors** — each status/error code and when it is returned.
33
+ - **Auth & access** — who may call it and how.
34
+ - **Versioning** — additive vs breaking; compatibility notes for existing
35
+ consumers.
36
+
37
+ Once frozen (the user picks "pass to orc-plan"), treat it as immutable for the
38
+ run: if a later iteration changes the boundary, it is a NEW freeze — rewrite the
39
+ contract and re-split, never let a repo's plan diverge from it silently.
40
+
41
+ ## `poly-spec.md` — the machine-readable handoff
42
+
43
+ Carries the marker `orc-poly:spec` on its first line so the planner
44
+ self-activates poly mode. Shape:
45
+
46
+ ```
47
+ orc-poly:spec v1
48
+ slug: <slug>
49
+ contract: interface-contract.md # the frozen boundary, relative to this file
50
+ git_head: # HOST HEAD short-sha at freeze time (staleness stamp)
51
+ repos:
52
+ - name: <host-repo>
53
+ role: host
54
+ path: <absolute path>
55
+ in_scope[]: <files/dirs this repo changes>
56
+ requirements[]:
57
+ - id: R1
58
+ text: <what this repo must do>
59
+ contract_ref: <section of interface-contract.md it depends on>
60
+ - name: <peer-repo>
61
+ role: peer
62
+ path: <absolute path>
63
+ in_scope[]: ...
64
+ requirements[]: ...
65
+ ```
66
+
67
+ Rules:
68
+
69
+ - Every requirement cites a `contract_ref` — a requirement that does not touch
70
+ the boundary still names why it is in this poly change.
71
+ - `in_scope[]` paths are the ones confirmed to exist in P2 (new files are
72
+ allowed, marked as such — the planner grounds them like any new path).
73
+ - One `repos[]` entry per repo. N peers are allowed; the planner produces one
74
+ plan per entry.
75
+
76
+ ## How the planner consumes it (P5)
77
+
78
+ The shared planner (`orc-planner-opus-5-med`), on seeing `orc-poly:spec`,
79
+ produces **one planning-output per `repos[]` entry**, each scoped to that
80
+ repo's `in_scope[]` and each embedding the frozen `interface-contract.md`
81
+ verbatim so the later per-repo `/orc` build cannot drift from the boundary. The
82
+ HOST plan is written under `poly-repo-implementation/<slug>/`; each PEER plan is
83
+ written into that peer repo at the same relative path (the only write orc-poly
84
+ ever makes into a peer).
@@ -0,0 +1,349 @@
1
+ # ORC-PR-DRIVER — build and ship your stacked pull requests
2
+
3
+ **Guide for humans.** Plain, simple English. This skill takes a stack plan and
4
+ makes it real: one branch per layer, one PR per layer, each one tested on its
5
+ own.
6
+
7
+ Read the planning guide first if you have not:
8
+ **[ORC-PR-SETUP README](../orc-pr-setup/README.md)** — it explains what a stack
9
+ is, and it writes the plan this skill needs.
10
+
11
+ ---
12
+
13
+ ## 1. The short version
14
+
15
+ ```
16
+ stack-plan.md ──▶ /orc-pr-driver ──▶ branch per layer
17
+ ↳ build + test + lint each layer ALONE
18
+ ↳ gh stack submit → 3–6 small PRs
19
+ ↳ sync / rebase / merge from the bottom up
20
+ ```
21
+
22
+ Run it with:
23
+
24
+ ```
25
+ /orc-pr-driver
26
+ ```
27
+
28
+ **The one rule that matters:** a layer is never pushed, submitted, or merged
29
+ until it is green **on its own base**. Not "green when all layers are applied
30
+ together". Green alone. Because you may merge layer 1 today and layer 2 next
31
+ week — and layer 1 alone must not break your main branch.
32
+
33
+ ---
34
+
35
+ ## 2. Before you start: is the plan ready?
36
+
37
+ The plan lives at `stacked-pr/<slug>/stack-plan.md`. Check it:
38
+
39
+ ```bash
40
+ orc pr stack status # or: orc pr stack status my-feature
41
+ ```
42
+
43
+ | Result | Meaning | What to do |
44
+ |---|---|---|
45
+ | `✓ READY` (exit 0) | the plan is complete | run `/orc-pr-driver` |
46
+ | `✗ absent` (exit 1) | there is no plan | run `/orc-pr-setup`, or `orc pr stack template <slug>` |
47
+ | `✗ NOT READY` (exit 1) | the plan still has `<...>` gaps | fill them in; the message lists what is missing |
48
+
49
+ **The driver refuses to run** when the plan has any of these problems. It tells
50
+ you exactly which one, and it never fills in a value for you:
51
+
52
+ - a question in `## Decisions` that you never answered,
53
+ - no ticket number,
54
+ - a layer with no purpose, or no value class,
55
+ - a `FOUNDATION` layer that does not name the layer using it,
56
+ - fewer than 2 layers (that is not a stack — just open one PR),
57
+ - the build was red when the change was handed over.
58
+
59
+ It also re-checks the tools: `gh` version 2.0+, logged in,
60
+ `github/gh-stack` installed, and **your repo is not a fork** (GitHub cannot stack
61
+ across forks). If a check fails, it says so and recommends one normal PR.
62
+
63
+ ---
64
+
65
+ ## 3. Your work is protected first (the snapshot)
66
+
67
+ If your code already exists in your working tree — the normal case when `/orc`
68
+ hands the change over — the driver **saves everything before it touches any
69
+ branch**:
70
+
71
+ ```bash
72
+ git status --short > list-of-changed-files # the authoritative list
73
+ git checkout -b orc-stack-snapshot/<slug> # your files stay as they are
74
+ git add -A && git commit -m "<TICKET> snapshot" # now your work lives in a commit
75
+ ```
76
+
77
+ Then it checks that the snapshot really contains every changed file. If one file
78
+ is missing, it stops. It never starts branch work with a partial snapshot.
79
+
80
+ That snapshot branch:
81
+
82
+ - is **never pushed** and never becomes a PR,
83
+ - stays until the last layer is merged — it is your undo button,
84
+ - is deleted only after asking you.
85
+
86
+ Every layer is then filled from the snapshot, file by file:
87
+
88
+ ```bash
89
+ git checkout <snapshot> -- path/to/file.go # add/modify files of THIS layer
90
+ git rm path/to/deleted_file.go # deletions of THIS layer
91
+ ```
92
+
93
+ **Files are moved whole.** The driver never cuts a file in half (no
94
+ "hunk surgery", no `git add -p`). If one file's content seems to belong in two
95
+ layers, that is a question for you — and the usual answer is "put the whole file
96
+ in the lowest layer that needs it".
97
+
98
+ Before submitting anything, it proves nothing was lost:
99
+
100
+ ```bash
101
+ # file list of the top layer == file list of the snapshot → must be identical
102
+ ```
103
+
104
+ If they differ, a file was dropped or duplicated, and it stops. A silently
105
+ missing file is exactly the accident stacking is meant to prevent.
106
+
107
+ ---
108
+
109
+ ## 4. What happens, step by step
110
+
111
+ | Phase | What it does |
112
+ |---|---|
113
+ | **D0 Read the plan** | probe, read, refuse if incomplete, re-measure the real sizes, check the tools |
114
+ | **D1 Snapshot** | save your work (section 3). Skipped when the code is not written yet |
115
+ | **D2 Build the layers** | `gh stack init` → per layer: `gh stack add`, put that layer's files in, **run the green gate**, commit through your repo's hooks |
116
+ | **D3 Submit** | `gh stack submit`, then verify with `gh stack view --json` that each PR's base and diff are correct, and fill in every PR body |
117
+ | **D4 Maintain** | keep the stack healthy while review happens: `sync`, `rebase --upstack`, `modify` |
118
+ | **D5 Merge** | merge from the **bottom up**, checking each layer's own CI first |
119
+
120
+ After each layer it prints one line, for example:
121
+
122
+ ```
123
+ L2 PAY-4211-store — 9 files, 640 LoC — GATE GREEN
124
+ ```
125
+
126
+ ---
127
+
128
+ ## 5. The green gate (the part people get wrong)
129
+
130
+ Every layer runs four steps, in order. All four are required.
131
+
132
+ | Step | What | Why |
133
+ |---|---|---|
134
+ | 1 | **build** at this layer's base | the layer must compile alone |
135
+ | 2 | **tests** for this layer's code | the layer must pass alone |
136
+ | 3 | **lint, compared to this layer's own base** | so layer 4 is not blamed for layer 1's code |
137
+ | 4 | **your repo's own pre-commit hooks** — unbypassed | those hooks are the real gate; if they fail, the PR cannot land |
138
+
139
+ Common commands per language:
140
+
141
+ | Language | build | tests | lint |
142
+ |---|---|---|---|
143
+ | Go | `go build ./...` | `go test ./<pkgs>/...` | `golangci-lint run --new-from-rev <base>` |
144
+ | Node / TypeScript | `npm run build` | `npm test -- <paths>` | `eslint <changed files>` |
145
+ | Java / Kotlin | `./gradlew compileJava` | `./gradlew test --tests …` | checkstyle / detekt |
146
+ | Python | type-check / compile | `pytest <paths>` | `ruff check <paths>` |
147
+ | Rust | `cargo build` | `cargo test <filter>` | `cargo clippy -- -D warnings` |
148
+
149
+ Your project's own scripts always win over these examples. If your project
150
+ generates code (`mockery`, `go generate`, `protoc`, `npm run codegen`), that runs
151
+ first — a missing generated file looks like a compile error and sends you
152
+ hunting the wrong problem.
153
+
154
+ **If any step is red:** stop, fix it, and run **all four steps again from the
155
+ start** for that layer. Do not continue to the next layer. Do not push.
156
+
157
+ **`git commit --no-verify` is forbidden.** Skipping the hooks does not make the
158
+ PR mergeable; it only hides the problem until CI finds it.
159
+
160
+ ### The lint trap that only happens with stacks
161
+
162
+ Many projects tell their linter to check "new code since `origin/main`". In a
163
+ stack, that makes layer 4 look like it contains layers 1–3's code too — noisy and
164
+ wrong. The driver overrides the baseline per layer
165
+ (`--new-from-rev <that layer's base>`), so each layer is judged on **its own**
166
+ changes.
167
+
168
+ ### "unused function" on a low layer — a question, not a lint fix
169
+
170
+ Your storage layer adds `FindByRef()`. Only the handler layer (higher up) calls
171
+ it. Linters like Go's `unused`, TypeScript's `noUnusedLocals`, or Rust's
172
+ `dead_code` will mark it as dead code and the layer goes red.
173
+
174
+ That red is **useful information**: as a standalone PR, this layer really does
175
+ add unused code. So the driver stops and asks you:
176
+
177
+ ```
178
+ [a] merge the storage layer into the handler layer (recommended — no dead code)
179
+ [b] keep both layers, move the first caller down into the storage layer
180
+ [c] accept it: add one suppression comment that names the layer which will use it
181
+ (your decision only)
182
+ ```
183
+
184
+ It never adds a suppression by itself, never invents a fake caller, and never
185
+ deletes your code to make the linter quiet. Your answer goes into the plan's
186
+ `## Decisions`.
187
+
188
+ ### Code-quality scans (SonarQube and similar)
189
+
190
+ If your scan analyzes the project without pull-request decoration, layer 3's
191
+ scan measures layers 1+2+3 **together**, not layer 3 alone. So:
192
+
193
+ - do not trust "new code coverage" as a per-layer number — check coverage
194
+ locally, per layer,
195
+ - treat the scan as a **whole-stack** gate,
196
+ - a scan reported as `SKIPPED` usually means the test job failed first. Read it
197
+ as red, not as a flaky tool.
198
+
199
+ This is also why each layer keeps **its own tests with its own code**: a layer
200
+ with no tests can fail a coverage rule all by itself.
201
+
202
+ ---
203
+
204
+ ## 6. PR descriptions
205
+
206
+ Every PR body comes from the template chosen in the plan (`pr template:`). On top
207
+ of that template, every layer's body always shows four facts:
208
+
209
+ 1. **Layer 2 of 4** + the ticket number (GitHub also draws the stack map).
210
+ 2. **Purpose and value class** — why this layer exists, who it helps.
211
+ 3. **Deliberately NOT here → layer 3.** This is important: it stops a reviewer
212
+ from rejecting your layer for something the next layer fixes.
213
+ 4. **Files excluded from the size count** — generated code, lock files, vendored
214
+ folders. The numbers ignore them, but reviewers should still know they exist.
215
+
216
+ ---
217
+
218
+ ## 7. Keeping the stack healthy during review
219
+
220
+ Reviews take days. The trunk moves. Things need updating. Four events, four
221
+ answers:
222
+
223
+ | Event | Command | Then, always |
224
+ |---|---|---|
225
+ | the trunk moved | `gh stack sync` | run the green gate again at **every** layer, bottom to top |
226
+ | you changed a lower layer | `gh stack rebase --upstack` | run the green gate again from that layer upward |
227
+ | review asks for a structural change | `gh stack modify` (drop / combine / insert / reorder / rename) | update the plan file, then re-run the gate from the lowest changed layer |
228
+ | a layer was merged | nothing — GitHub retargets automatically | confirm the layers above retargeted and their CI re-ran |
229
+
230
+ **Why re-run the gate:** changing a lower layer rewrites every branch above it.
231
+ A layer that was green yesterday can be red now. "It was green when I made it" is
232
+ not evidence.
233
+
234
+ ### Conflicts during a rebase
235
+
236
+ 1. Fix the conflict **inside the layer where it appears**. Never pull content
237
+ down from a higher layer — that silently moves code between layers.
238
+ 2. If two layers really own the same file, the cut line was wrong. Stop, decide
239
+ with the skill (merge the layers, or move the whole file down), write the
240
+ decision into the plan, and re-cut.
241
+ 3. `gh stack rebase --continue` after each fix. `--abort` is always allowed and
242
+ is better than a guessed fix.
243
+
244
+ ### About force-pushes
245
+
246
+ Changing a lower layer force-pushes every branch above it, and reviewers lose
247
+ their in-progress review (comments detach, "viewed" marks reset). So while a
248
+ layer is under review, prefer:
249
+
250
+ - a new small commit on top of that layer instead of amending it,
251
+ - `gh stack modify` instead of hand-made history rewrites,
252
+ - and if a force-push cannot be avoided, leave a comment saying which layers
253
+ moved and why.
254
+
255
+ ---
256
+
257
+ ## 8. Merging (order is not optional)
258
+
259
+ Merge **from the bottom up**. For each layer, in order:
260
+
261
+ ```bash
262
+ gh pr view <n> --json statusCheckRollup # is THIS layer's CI green?
263
+ # reviewers approved?
264
+ gh stack merge <n> --squash # or --merge / --rebase
265
+ # then confirm: layers above retargeted, their CI re-ran
266
+ ```
267
+
268
+ - Merging the **top ready layer** lands every unmerged layer below it in one
269
+ action. Convenient — but only when all of those layers are green and approved.
270
+ - **Never** merge a middle layer while an unmerged layer is still below it.
271
+ - Merge queues for stacked PRs are still rolling out at GitHub. The skill checks
272
+ whether your repo has one; it never assumes.
273
+
274
+ When the last layer is merged, the driver offers to delete the snapshot branch.
275
+
276
+ ---
277
+
278
+ ## 9. Troubleshooting
279
+
280
+ | You see | What it means | Fix |
281
+ |---|---|---|
282
+ | `✗ absent — no stacked-pr/...` | no plan file | `/orc-pr-setup`, or `orc pr stack template <slug>` |
283
+ | `✗ NOT READY — 12 unfilled placeholders` | the skeleton is not filled in | fill in each `<...>`; the message shows examples |
284
+ | "2 stack plans — name one: a, b" | more than one plan exists | add the slug: `orc pr stack status a` |
285
+ | "refusing to overwrite a plan" | a plan with that slug already exists | edit it, use another slug, or pass `--force` |
286
+ | "this repo is a fork" | stacks cannot cross forks | use one normal PR |
287
+ | `gh: unknown command "stack"` | the extension is missing | `gh extension install github/gh-stack` |
288
+ | lint flags code from lower layers | the baseline is the trunk, not your layer | the driver sets `--new-from-rev <layer base>`; check your CI does the same |
289
+ | "unused" on a low layer | as a standalone PR, that code has no caller | answer the question in section 5 — never add a blind suppression |
290
+ | a layer was green, now it is red | a lower layer changed and rewrote this branch | fix, then re-run the gate at every layer above the change |
291
+ | `scan SKIPPED` in CI | the test job failed before the scan | treat as red; fix the tests |
292
+ | the file lists do not match at the end | a file was dropped or duplicated between layers | the driver stops; fix the layer file lists in the plan |
293
+
294
+ ---
295
+
296
+ ## 10. What this skill never does
297
+
298
+ - Never plans the layers. No plan → it sends you to `/orc-pr-setup` or the
299
+ template command.
300
+ - Never bypasses a gate: no `--no-verify`, no red push, no red submit, no red
301
+ merge.
302
+ - Never cuts a file in half.
303
+ - Never touches your work without a snapshot first.
304
+ - Never merges out of order.
305
+ - Never builds a "manual stack" by pushing branches and editing bases by hand
306
+ when the extension is missing — nothing would retarget on merge, and a
307
+ half-built stack is worse than one honest big PR.
308
+
309
+ ---
310
+
311
+ ## 11. FAQ
312
+
313
+ **Can I start here without `/orc-pr-setup`?**
314
+ Yes. That is a supported path. Run `orc pr stack template <slug>`, fill in the
315
+ file, then run this skill.
316
+
317
+ **What if I want to stop in the middle?**
318
+ The layers that are already green stay as normal branches/PRs. Your snapshot
319
+ branch still holds everything. `gh stack unstack` removes the stack tracking and
320
+ keeps the branches.
321
+
322
+ **Do I need to run CI myself?**
323
+ The green gate runs locally, per layer, before anything is pushed. GitHub then
324
+ runs your normal CI on each PR. Both matter: local gate finds problems in
325
+ seconds, CI is the official record.
326
+
327
+ **How many layers is too many?**
328
+ Above 6 you get a warning, above 8 the planner stops. Each layer is a full CI
329
+ run and one more review context.
330
+
331
+ **Can I use this for a change across two repositories?**
332
+ No. GitHub stacks live in one repository. Use `/orc-poly` for cross-repo
333
+ planning.
334
+
335
+ **Does this work with squash merges?**
336
+ Yes — `gh stack merge` supports merge, squash, and rebase.
337
+
338
+ ---
339
+
340
+ ## 12. Reference files (the skill loads these when it needs them)
341
+
342
+ | File | Contains |
343
+ |---|---|
344
+ | `references/green-gate.md` | the four-step ladder, the lint baseline trap, the dead-code question, re-verification rules |
345
+ | `references/orc-run-split.md` | the exact snapshot and file-by-file split procedure |
346
+ | `references/conflict-playbook.md` | sync / rebase / modify / merge, conflicts, force-push etiquette |
347
+ | `../_shared/stack-plan.md` | the plan format, size rules, the handoff file |
348
+ | `../_shared/gh-stack-commands.md` | every `gh stack` command, and what to do if GitHub renames one |
349
+ | `../_shared/pr-templates.md` | how a PR description is chosen, plus three ready-made templates |
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: orc-pr-driver
3
+ description: >
4
+ Stacked-PR DRIVER. Use for "/orc-pr-driver", "build the stacked PRs", "submit
5
+ the stack", "restack / sync / merge my stack". Takes an approved
6
+ stacked-pr/<slug>/stack-plan.md — written by /orc-pr-setup, generated by
7
+ `orc pr stack template` and filled in by hand, or handed over by ORC's ship
8
+ phase — and executes it: one branch per layer, only that layer's files, a
9
+ MANDATORY per-layer green gate (build + tests + lint scoped to the layer's own
10
+ base + the repo's own hooks, never --no-verify), then `gh stack submit`, PR
11
+ bodies from the resolved template, and the ongoing sync / rebase / conflict /
12
+ bottom-up merge care. Refuses to run on a plan with unanswered uncertainties,
13
+ a missing ticket or a red build.
14
+ ---
15
+
16
+ # ORC-PR-DRIVER (stacked-PR driver)
17
+
18
+ The half that touches git. `orc-pr-setup` decides WHERE the cut lines go; this
19
+ lane makes the layers real and keeps the stack healthy until every layer is
20
+ merged.
21
+
22
+ Its whole discipline is one sentence: **no layer is submitted, pushed or merged
23
+ until its own gate is green at its own base.** A layer that only builds when the
24
+ whole stack is applied is not a reviewable layer, and merging the layer below it
25
+ breaks the trunk.
26
+
27
+ **Tier.** Not effort-gated (the guard matches the exact skill name `orc`), so it
28
+ runs at whatever tier the chat is on.
29
+
30
+ **Human guide:** this skill's own `README.md` (step-by-step walkthrough, the green
31
+ gate per language, merge order, troubleshooting table) — point the USER there when
32
+ they ask how any of this works; never load it to drive the run.
33
+
34
+ **Load at their phase, never preloaded:**
35
+ `../_shared/stack-plan.md` (plan schema, probe, budgets, `STACK-FROM`, entry
36
+ modes) · `../_shared/gh-stack-commands.md` (preflight + command surface) ·
37
+ `../_shared/pr-templates.md` (per-layer body rules) ·
38
+ `references/green-gate.md` (the mandatory ladder) ·
39
+ `references/orc-run-split.md` (splitting an already-built worktree, file-granular) ·
40
+ `references/conflict-playbook.md` (sync, rebase, modify, merge).
41
+
42
+ ## Hard rules
43
+
44
+ 1. **Never `git commit --no-verify`.** The repo's hooks ARE the gate; bypassing
45
+ them means the PR cannot land anyway.
46
+ 2. **Never `gh stack submit` over a red layer**, and never push one.
47
+ 3. **Green means green at the layer's OWN base** — not "green once the whole
48
+ stack is applied".
49
+ 4. **After ANY lower-layer change, re-run the full ladder at every tip above it**,
50
+ bottom-up. "It was green when I cut it" is not evidence — a rebase rewrites
51
+ every upper branch.
52
+ 5. **Merge bottom-up only.** Never merge a middle layer while an unmerged layer
53
+ sits below it.
54
+ 6. **Hunk surgery is forbidden.** Splits are file-granular; a file that seems to
55
+ belong in two layers is a question, not a manual diff edit.
56
+ 7. **Never fabricate a green.** No `//nolint`, no fake caller, no deleted
57
+ identifier to silence a linter (`references/green-gate.md` — that is a P0
58
+ question about the seam).
59
+ 8. **The plan is the contract.** Re-cutting a seam mid-run means updating the
60
+ plan file (and its `## Decisions`) in the same step.
61
+
62
+ ## Phase D0 — Read the plan + hard gate
63
+
64
+ 1. **Probe, do not search:** `orc pr stack status [<slug>]` — exit 0 = READY,
65
+ exit 1 = absent or unfilled (`../_shared/stack-plan.md`). Exit 1 → say which
66
+ it is and offer `/orc-pr-setup` (plan it) or `orc pr stack template` (skeleton
67
+ to fill in by hand).
68
+ 2. Read `stacked-pr/<slug>/stack-plan.md`, plus
69
+ `stacked-pr/<slug>/STACK-FROM.md` when present (source, ticket, entry mode,
70
+ template, run dir, `BUILD-GREEN`).
71
+ 3. **REFUSE to run** — name the exact missing field, then stop — on: an
72
+ unanswered UNCERTAIN in `## Decisions`, a missing ticket, a layer with no
73
+ purpose or no value class, a FOUNDATION layer naming no consumer,
74
+ fewer than 2 layers, or `BUILD-GREEN: false`. Never fill a field in for the user.
75
+ 4. Re-validate the budgets against the real numbers (`git diff --numstat`,
76
+ exclusions applied). A layer that grew past a ceiling since planning → surface
77
+ it and ask: split it here, or log an accepted exception.
78
+ 5. Preflight per `../_shared/gh-stack-commands.md` (gh · auth · extension ·
79
+ **not a fork** · trunk · protections · merge queue). A hard fail → one
80
+ regular PR, and say so plainly.
81
+
82
+ ## Phase D1 — Snapshot (entry mode `orc-run` only)
83
+
84
+ The change already exists in the worktree, so **preserve it before touching
85
+ branches** — `references/orc-run-split.md` is the exact procedure: commit the
86
+ whole change to a scratch snapshot branch, verify the snapshot contains every
87
+ changed path from `git status --short`, and only then move to the trunk. Every
88
+ layer is later materialized with `git checkout <snapshot> -- <that layer's
89
+ files>`; deletions are applied as `git rm`. The snapshot branch stays until the
90
+ last layer merges — it is the undo button.
91
+
92
+ `greenfield` skips this phase: each layer's code is written in its own layer.
93
+
94
+ ## Phase D2 — Build the stack, layer by layer
95
+
96
+ `gh stack init -b <trunk>` → then, per layer, bottom-up:
97
+
98
+ 1. `gh stack add -m "<ticket> <layer title>"` (branch name from the plan).
99
+ 2. Materialize **only that layer's files** — `git checkout <snapshot> -- <files>`
100
+ (orc-run) or write them (greenfield). Nothing from another layer, ever.
101
+ 3. **Run the FULL green-gate ladder** (`references/green-gate.md`): build →
102
+ tests (the layer's scope) → lint attributed to **this layer's base** → the
103
+ repo's own pre-commit hooks, unbypassed. Any step red → stop, fix, re-run the
104
+ ladder from step 1 for that layer. Do not proceed, do not push.
105
+ 4. Commit through the hooks. Record the layer's gate status (`GREEN`) back into
106
+ the plan file.
107
+ 5. Report one line per layer to the user: `L<n> <branch> — <files> files, <LoC>
108
+ LoC — GATE GREEN`.
109
+
110
+ A layer that cannot go green alone is a **seam defect, not a lint problem**: stop
111
+ and ask (merge it into its consumer · land the first caller here · accept with an
112
+ explicit, reason-carrying suppression — user's call only), then record the answer
113
+ in the plan's `## Decisions`.
114
+
115
+ ## Phase D3 — Submit
116
+
117
+ 1. `gh stack submit` → then **verify with `gh stack view --json`**: the bases
118
+ chain correctly (bottom → trunk, each upper → the branch below) and each PR's
119
+ diff really is only its own layer.
120
+ 2. Fill each PR body from the resolved template per `../_shared/pr-templates.md`,
121
+ including the four per-layer facts: layer `n` of `N` + ticket · purpose +
122
+ value class · **deliberately NOT here** → which layer has it ·
123
+ excluded-from-budget files, listed.
124
+ 3. Show the user the stack map, each PR's URL, and the review order hint.
125
+
126
+ ## Phase D4 — Maintain
127
+
128
+ `references/conflict-playbook.md`. In short: `gh stack sync` after the trunk
129
+ moves · `gh stack rebase --upstack` after amending a lower layer, then **re-run
130
+ the ladder at every tip above, bottom-up** (hard rule 4) · `gh stack modify` to
131
+ insert / reorder / drop / combine when review demands it (prefer it, and
132
+ fixup-on-top, over history rewrites mid-review — a force-push destroys a
133
+ reviewer's in-progress context).
134
+
135
+ ## Phase D5 — Merge (bottom-up, gated)
136
+
137
+ Before each `gh stack merge`: confirm via `gh stack view --json` +
138
+ `gh pr view <n> --json statusCheckRollup` that **that layer's own CI is green**.
139
+ After each merge: confirm the upper layers auto-retargeted and their CI re-ran.
140
+ Never merge a middle layer with unmerged layers below it. When the last layer
141
+ lands, delete the snapshot branch (ask first) and report the final state.
142
+
143
+ ## Behavior trace (PERMANENT — every ORC entry point traces; always on)
144
+
145
+ Resolve `log_dir` (`../orc/config.md` default ← `.claude/orc.config.yaml`) at
146
+ start and follow `../orc/references/trace-protocol.md`: write
147
+ `log_dir/.current` = `run-prdriver-<slug>-<DDMMYY>-<HHMMSS>.txt` and
148
+ `touch the trace file` of that name in the SAME step, first. Narration is
149
+ dispatched, not remembered: dispatch the trace writer at every **layer
150
+ boundary** (one packet per layer close, per the multi-dispatch tier) and once at
151
+ run end. Events with their REAL timestamps: `PHASE D0..D5`,
152
+ `GATE layer-green pass|bounce :: L<n> <step>`, `QUESTION count=<n>`,
153
+ `GATE stack-certainty` on a mid-run re-cut, `FINISH`; `decisions` carries the WHY
154
+ (seam calls, accepted exceptions, the user's answers verbatim). A phase ending
155
+ with `zero new trace lines is a protocol violation`.
156
+
157
+ ## Boundaries
158
+
159
+ - **Never plans the layering.** No plan → `/orc-pr-setup` or
160
+ `orc pr stack template`. It executes a plan; it does not invent one.
161
+ - **Never bypasses a gate** — no `--no-verify`, no red submit, no red merge.
162
+ - **Never rewrites the user's work silently:** the snapshot branch exists before
163
+ any branch switch, and it survives until the stack is merged.
164
+ - Out of scope: cross-repo stacks (unsupported by GitHub) and retrofitting an
165
+ already-open PR into a stack.
166
+ - Reminder: to see usage limits, tell the user to run `/usage` (never invoke it
167
+ programmatically).
@@ -0,0 +1,78 @@
1
+ # Reference — stack maintenance & conflict playbook
2
+
3
+ Loaded at Phase D4/D5. A stack is a living chain: the trunk moves, review demands
4
+ changes, layers merge. Every one of those events rewrites branches above the
5
+ change, so every one of them ends with the same obligation — **re-run the green
6
+ gate at every tip above it, bottom-up** (`green-gate.md`).
7
+
8
+ ## The four events and their exact response
9
+
10
+ | Event | Command | Then |
11
+ |---|---|---|
12
+ | the trunk moved | `gh stack sync [--prune]` | re-run the ladder at EVERY layer tip, bottom-up |
13
+ | you amended layer N | `gh stack rebase --upstack` | re-run the ladder from layer N upward |
14
+ | review wants a structural change | `gh stack modify` (drop / combine / insert / reorder / rename) | update the plan file + `## Decisions`, then re-run the ladder from the lowest touched layer |
15
+ | a layer merged | (automatic retarget) | confirm the upper layers retargeted and their CI re-ran |
16
+
17
+ `gh stack rebase` also takes `--downstack`, `--no-trunk`, `--continue`,
18
+ `--abort` — see `../../_shared/gh-stack-commands.md`.
19
+
20
+ ## Conflict resolution during a rebase
21
+
22
+ 1. **Resolve in the layer where the conflict appears**, never by pulling content
23
+ down from a higher layer — that silently moves code between layers and breaks
24
+ the plan's file list.
25
+ 2. If the conflict shows that two layers genuinely own the same file, that is a
26
+ **seam defect**: stop, ask (merge the layers · move the file wholesale to the
27
+ lower one), record the answer in the plan, and re-cut.
28
+ 3. `gh stack rebase --continue` after each resolution; `--abort` to get back to a
29
+ known state — aborting is always allowed and always better than a guessed
30
+ resolution.
31
+ 4. After the rebase completes, the ladder runs at every tip above the conflict.
32
+ A conflict resolution is a code change like any other.
33
+
34
+ ## Force-push discipline
35
+
36
+ Amending a lower layer force-pushes every branch above it, and reviewers lose
37
+ in-progress review context (comments detach, "viewed" marks reset). So:
38
+
39
+ - prefer **fixup-on-top** (a new commit in the same layer) over an amend while a
40
+ layer is under active review;
41
+ - prefer `gh stack modify` over hand-rolled history rewrites;
42
+ - when a force-push is unavoidable, tell the reviewers in a PR comment which
43
+ layers moved and why.
44
+
45
+ ## Merge sequence (bottom-up, non-negotiable)
46
+
47
+ ```
48
+ for L in bottom..top:
49
+ gh pr view <L> --json statusCheckRollup # this layer's own CI green?
50
+ reviewers approved?
51
+ gh stack merge <L> [--squash|--merge|--rebase]
52
+ confirm: upper layers retargeted, their CI re-ran
53
+ ```
54
+
55
+ - Merging the **top ready layer** lands every unmerged layer below it in one
56
+ operation — convenient, but only when every one of those layers is green and
57
+ approved. Otherwise merge one at a time.
58
+ - Never merge a middle layer while an unmerged layer sits below it.
59
+ - A merge queue may or may not be enabled for stacked PRs on a given repo —
60
+ **probe, never assume** (`../../_shared/gh-stack-commands.md`).
61
+
62
+ ## Abandoning a stack
63
+
64
+ `gh stack unstack [<stack-no>] [--local]` removes tracking (and the stack on
65
+ GitHub). The branches survive. If the plan turned out wrong, this plus the
66
+ snapshot branch (`orc-run-split.md`) is a clean reset: unstack, re-plan with
67
+ `/orc-pr-setup`, re-cut from the snapshot.
68
+
69
+ ## When the preview breaks under you
70
+
71
+ Stacked PRs are a GitHub **public preview**. If a command in
72
+ `../../_shared/gh-stack-commands.md` is renamed or removed:
73
+
74
+ 1. Do NOT hand-roll the stack with bare `git push` + manual base edits — nothing
75
+ retargets on merge and a half-built stack is worse than one honest big PR.
76
+ 2. Say what broke, and fall back to a single regular PR (or leave the already-
77
+ submitted layers as plain PRs, merged bottom-up by hand).
78
+ 3. The fix is one file: update the command table.