@azure-id/orc 1.9.2 → 2.1.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 (228) hide show
  1. package/CHANGELOG.md +722 -0
  2. package/README-id.md +56 -42
  3. package/README.md +58 -41
  4. package/bin/build-agents.js +125 -29
  5. package/bin/clear-logs.js +620 -0
  6. package/bin/cli.js +1873 -180
  7. package/bin/fix.js +459 -0
  8. package/bin/gotcha-import.js +1081 -0
  9. package/bin/gotcha.js +1566 -0
  10. package/bin/graph-query.js +1 -1
  11. package/bin/graph.js +717 -717
  12. package/bin/habit.js +1538 -0
  13. package/bin/mockrun-catalog.js +284 -276
  14. package/bin/onboarding-content.js +2 -1
  15. package/bin/pricing.json +28 -21
  16. package/bin/run-undo.js +398 -0
  17. package/bin/trace-write.js +869 -0
  18. package/bin/verify-contracts.js +627 -100
  19. package/bin/verify-package.js +68 -10
  20. package/bin/webui/api.js +151 -6
  21. package/bin/webui/app.html +239 -232
  22. package/bin/webui/css/00-tokens.css +110 -92
  23. package/bin/webui/css/04-motion.css +87 -0
  24. package/bin/webui/css/06-responsive.css +203 -178
  25. package/bin/webui/css/panels/behaviour.css +205 -0
  26. package/bin/webui/css/panels/hookui.css +79 -0
  27. package/bin/webui/fixtures/behaviour.js +562 -0
  28. package/bin/webui/fixtures/extra.js +9 -9
  29. package/bin/webui/fixtures/flow.js +81 -81
  30. package/bin/webui/fixtures/hookui.js +506 -431
  31. package/bin/webui/fixtures/index.js +66 -3
  32. package/bin/webui/fixtures/knowledge.js +9 -3
  33. package/bin/webui/fixtures/maintenance.js +123 -42
  34. package/bin/webui/fixtures/rules.js +1007 -1002
  35. package/bin/webui/fixtures/settings.js +6 -7
  36. package/bin/webui/fixtures/stats.js +25 -6
  37. package/bin/webui/fixtures/wait.js +98 -97
  38. package/bin/webui/i18n/en/behaviour.json +156 -0
  39. package/bin/webui/i18n/en/hookui.json +290 -194
  40. package/bin/webui/i18n/en/maintenance.json +71 -52
  41. package/bin/webui/i18n/en/nav.json +25 -24
  42. package/bin/webui/i18n/en/settings.json +60 -60
  43. package/bin/webui/i18n/en/tour.json +37 -35
  44. package/bin/webui/i18n/id/behaviour.json +156 -0
  45. package/bin/webui/i18n/id/hookui.json +290 -194
  46. package/bin/webui/i18n/id/maintenance.json +71 -52
  47. package/bin/webui/i18n/id/nav.json +25 -24
  48. package/bin/webui/i18n/id/settings.json +60 -60
  49. package/bin/webui/i18n/id/tour.json +37 -35
  50. package/bin/webui/js/01-i18n.js +155 -154
  51. package/bin/webui/js/05-banners.js +181 -172
  52. package/bin/webui/js/06-edit.js +193 -183
  53. package/bin/webui/js/90-tour.js +498 -494
  54. package/bin/webui/js/91-shortcuts.js +126 -126
  55. package/bin/webui/js/99-boot.js +121 -118
  56. package/bin/webui/js/panels/behaviour.js +1087 -0
  57. package/bin/webui/js/panels/hookui.js +2196 -1691
  58. package/bin/webui/js/panels/maintenance.js +336 -235
  59. package/bin/webui/js/panels/settings.js +726 -719
  60. package/mock-run/INDEX.md +110 -107
  61. package/mock-run/extra-slots.md +1 -1
  62. package/mock-run/gotcha-import.md +118 -0
  63. package/mock-run/habits.md +129 -0
  64. package/mock-run/orc-aftermath.md +392 -392
  65. package/mock-run/orc-budget.md +29 -33
  66. package/mock-run/orc-cli.md +200 -200
  67. package/mock-run/orc-explain.md +86 -86
  68. package/mock-run/orc-extra.md +389 -392
  69. package/mock-run/orc-fix.md +87 -0
  70. package/mock-run/orc-pattern.md +112 -112
  71. package/mock-run/orc-quick.md +6 -1
  72. package/mock-run/orc.md +157 -157
  73. package/package.json +1 -1
  74. package/templates/agents/MODEL-MAPPING.md +37 -34
  75. package/templates/agents/orc-advisor-opus-5-xhigh.md +1 -7
  76. package/templates/agents/orc-analyze-mini-opus-5-med.md +1 -6
  77. package/templates/agents/orc-analyze-mini-sonnet-5-high.md +2 -5
  78. package/templates/agents/{orc-claude-writer-opus-4-8-high.md → orc-claude-writer-opus-5-low.md} +48 -53
  79. package/templates/agents/orc-context-combiner-opus-5-high.md +1 -11
  80. package/templates/agents/orc-executor-haiku-4-5.md +14 -6
  81. package/templates/agents/orc-executor-opus-4-7-high.md +14 -6
  82. package/templates/agents/orc-executor-opus-4-7-med.md +14 -6
  83. package/templates/agents/orc-executor-opus-4-8-high.md +14 -6
  84. package/templates/agents/orc-executor-opus-5-high.md +14 -6
  85. package/templates/agents/orc-executor-opus-5-low.md +14 -6
  86. package/templates/agents/orc-executor-opus-5-med.md +14 -6
  87. package/templates/agents/orc-executor-sonnet-4-6-high.md +14 -6
  88. package/templates/agents/orc-executor-sonnet-4-6-med.md +14 -6
  89. package/templates/agents/orc-executor-sonnet-5-high.md +15 -7
  90. package/templates/agents/orc-executor-sonnet-5-low.md +155 -0
  91. package/templates/agents/orc-executor-sonnet-5-med.md +155 -0
  92. package/templates/agents/orc-graph-noter-sonnet-4-6-med.md +1 -10
  93. package/templates/agents/orc-judge-opus-5-xhigh.md +5 -9
  94. package/templates/agents/orc-learn-writer-opus-5-low.md +1 -7
  95. package/templates/agents/orc-pattern-codifier-opus-5-med.md +1 -8
  96. package/templates/agents/orc-pattern-codifier-sonnet-5-high.md +58 -63
  97. package/templates/agents/orc-planner-mini-opus-5-med.md +1 -4
  98. package/templates/agents/orc-planner-mini-sonnet-5-high.md +2 -3
  99. package/templates/agents/orc-planner-opus-5-med.md +1 -4
  100. package/templates/agents/orc-recon-opus-5-low.md +1 -8
  101. package/templates/agents/orc-recon-sonnet-4-6-med.md +1 -8
  102. package/templates/agents/orc-retro-opus-5-med.md +6 -8
  103. package/templates/agents/orc-retro-sonnet-5-high.md +7 -8
  104. package/templates/agents/orc-reviewer-opus-5-low.md +96 -0
  105. package/templates/agents/orc-scout-opus-5-low.md +1 -6
  106. package/templates/agents/orc-scout-sonnet-4-6-high.md +35 -39
  107. package/templates/agents/orc-system-analyst-opus-5-high.md +1 -6
  108. package/templates/agents/orc-test-author-opus-5-med.md +4 -5
  109. package/templates/agents/orc-trace-writer-haiku-4-5.md +3 -7
  110. package/templates/agents/orc-verifier-opus-5-med.md +16 -8
  111. package/templates/agents/{orc-wiki-scanner-opus-4-8-high.md → orc-wiki-scanner-opus-5-low.md} +74 -79
  112. package/templates/agents/orc-wiki-scanner-sonnet-5-high.md +97 -106
  113. package/templates/commands/orc-analyze.md +13 -21
  114. package/templates/commands/orc-fast.md +10 -15
  115. package/templates/commands/orc-fix.md +18 -0
  116. package/templates/commands/orc-poly.md +12 -21
  117. package/templates/commands/orc-pr-driver.md +11 -30
  118. package/templates/commands/orc-pr-setup.md +10 -31
  119. package/templates/commands/orc-route.md +11 -41
  120. package/templates/commands/orc-test.md +5 -60
  121. package/templates/commands/orc-wiki.md +64 -64
  122. package/templates/hooks/README.md +109 -7
  123. package/templates/hooks/orc-session-hook.js +339 -0
  124. package/templates/hooks/orc-statusline-render.js +317 -23
  125. package/templates/hooks/orc-statusline.js +165 -50
  126. package/templates/hooks/orc-subagent-line.js +23 -5
  127. package/templates/hooks/orc-weather-fetch.js +123 -0
  128. package/templates/skills/_shared/README.md +9 -0
  129. package/templates/skills/_shared/code-graph.md +47 -55
  130. package/templates/skills/_shared/config-precedence.md +3 -1
  131. package/templates/skills/_shared/extra-dispatch.md +78 -93
  132. package/templates/skills/_shared/gotchas.md +248 -177
  133. package/templates/skills/_shared/habits.md +101 -0
  134. package/templates/skills/_shared/lane-contract.md +84 -0
  135. package/templates/skills/_shared/opus5-only.md +14 -14
  136. package/templates/skills/_shared/phases/README.md +142 -83
  137. package/templates/skills/_shared/phases/analyst-gates.md +10 -21
  138. package/templates/skills/_shared/phases/execution.md +8 -14
  139. package/templates/skills/_shared/phases/house-rules.md +27 -32
  140. package/templates/skills/_shared/phases/intake.md +127 -133
  141. package/templates/skills/_shared/phases/mock-example.md +46 -56
  142. package/templates/skills/_shared/phases/plan-handoff.md +91 -97
  143. package/templates/skills/_shared/phases/planning.md +7 -17
  144. package/templates/skills/_shared/phases/preflight.md +19 -42
  145. package/templates/skills/_shared/phases/review.md +24 -28
  146. package/templates/skills/_shared/phases/rules.md +18 -42
  147. package/templates/skills/_shared/phases/scoring.md +55 -65
  148. package/templates/skills/_shared/phases/security-checklist.md +46 -50
  149. package/templates/skills/_shared/phases/security.md +45 -55
  150. package/templates/skills/_shared/phases/ship.md +6 -15
  151. package/templates/skills/_shared/phases/stop-resume.md +2 -5
  152. package/templates/skills/_shared/phases/summary.md +73 -48
  153. package/templates/skills/_shared/phases/testgen.md +41 -51
  154. package/templates/skills/_shared/phases/trace-verbs.md +447 -0
  155. package/templates/skills/_shared/phases/trace.md +66 -297
  156. package/templates/skills/_shared/phases/verify.md +62 -70
  157. package/templates/skills/_shared/phases/wave-grouping.md +128 -133
  158. package/templates/skills/_shared/phases/wiki-consult.md +10 -6
  159. package/templates/skills/_shared/read-ladder.md +2 -55
  160. package/templates/skills/_shared/return-validation.md +17 -70
  161. package/templates/skills/_shared/review-slice.md +106 -0
  162. package/templates/skills/_shared/smoke-gate.md +46 -28
  163. package/templates/skills/_shared/wait.md +1 -0
  164. package/templates/skills/context-combiner/SKILL.md +15 -44
  165. package/templates/skills/orc/README.md +2 -2
  166. package/templates/skills/orc/SKILL.md +35 -63
  167. package/templates/skills/orc/config.md +25 -27
  168. package/templates/skills/orc/examples/full-run-mock.md +2 -1
  169. package/templates/skills/orc/references/effort-and-mode.md +17 -17
  170. package/templates/skills/orc/references/pattern-gate.md +89 -89
  171. package/templates/skills/orc/references/phases/intake.md +41 -47
  172. package/templates/skills/orc/references/phases/integration.md +13 -19
  173. package/templates/skills/orc/references/preflight-report.md +11 -12
  174. package/templates/skills/orc/references/ultra-mode.md +9 -7
  175. package/templates/skills/orc/schemas/checkpoint.md +122 -122
  176. package/templates/skills/orc/subskills/orc-execution/SKILL.md +27 -73
  177. package/templates/skills/orc/subskills/orc-execution/core.md +12 -99
  178. package/templates/skills/orc/subskills/orc-execution/subagent.md +14 -13
  179. package/templates/skills/orc/subskills/orc-review-verify/SKILL.md +12 -53
  180. package/templates/skills/orc/subskills/orc-review-verify/core.md +52 -135
  181. package/templates/skills/orc/subskills/orc-review-verify/subagent.md +7 -7
  182. package/templates/skills/orc/subskills/orc-testgen/SKILL.md +11 -22
  183. package/templates/skills/orc/subskills/orc-testgen/core.md +20 -59
  184. package/templates/skills/orc/subskills/orc-testgen/subagent.md +7 -7
  185. package/templates/skills/orc-advisor/SKILL.md +56 -60
  186. package/templates/skills/orc-analyze/SKILL.md +33 -67
  187. package/templates/skills/orc-analyze/schemas/report-audit.md +2 -1
  188. package/templates/skills/orc-analyze/schemas/report-prose.md +2 -1
  189. package/templates/skills/orc-analyze-mini/SKILL.md +35 -70
  190. package/templates/skills/orc-claude/SKILL.md +14 -14
  191. package/templates/skills/orc-claude/examples/claude-run-mock.md +65 -65
  192. package/templates/skills/orc-diy/README.md +31 -0
  193. package/templates/skills/orc-diy/SKILL.md +27 -78
  194. package/templates/skills/orc-diy/references/blocks/pattern.md +18 -18
  195. package/templates/skills/orc-fast/SKILL.md +49 -75
  196. package/templates/skills/orc-fix/SKILL.md +110 -0
  197. package/templates/skills/orc-judge/SKILL.md +77 -82
  198. package/templates/skills/orc-mini/SKILL.md +64 -112
  199. package/templates/skills/orc-mini/examples/mini-run-mock.md +4 -2
  200. package/templates/skills/orc-pattern/SKILL.md +27 -48
  201. package/templates/skills/orc-poly/SKILL.md +32 -61
  202. package/templates/skills/orc-pr-driver/SKILL.md +25 -51
  203. package/templates/skills/orc-pr-driver/references/green-gate.md +113 -105
  204. package/templates/skills/orc-pr-setup/SKILL.md +20 -45
  205. package/templates/skills/orc-quick/README.md +44 -3
  206. package/templates/skills/orc-quick/SKILL.md +77 -108
  207. package/templates/skills/orc-quick/references/dispatch-gate.md +18 -6
  208. package/templates/skills/orc-quick/references/gh-mode.md +50 -1
  209. package/templates/skills/orc-quick/references/look.md +3 -1
  210. package/templates/skills/orc-retro/SKILL.md +20 -19
  211. package/templates/skills/orc-retro/examples/retro-mock.md +17 -17
  212. package/templates/skills/orc-route/SKILL.md +25 -45
  213. package/templates/skills/orc-test/SKILL.md +16 -37
  214. package/templates/skills/orc-verify/SKILL.md +14 -32
  215. package/templates/skills/orc-wait/SKILL.md +156 -163
  216. package/templates/skills/orc-wiki/README.md +325 -325
  217. package/templates/skills/orc-wiki/SKILL.md +195 -195
  218. package/templates/skills/orc-wiki/examples/wiki-run-mock.md +37 -37
  219. package/templates/skills/orc-wiki/references/extra.md +2 -2
  220. package/templates/skills/orc-wiki/references/partial-refresh.md +276 -271
  221. package/templates/skills/orc-wiki/references/phases/phase-0.md +2 -7
  222. package/templates/skills/orc-wiki/references/phases/phase-1.md +1 -6
  223. package/templates/skills/orc-wiki/references/phases/phase-2.md +4 -9
  224. package/templates/skills/orc-wiki/references/phases/phase-3.md +1 -6
  225. package/templates/skills/orc-wiki/references/phases/phase-3c.md +4 -8
  226. package/templates/agents/orc-claude-writer-opus-5-med.md +0 -55
  227. package/templates/agents/orc-reviewer-opus-5-med.md +0 -60
  228. package/templates/agents/orc-wiki-scanner-opus-5-med.md +0 -81
@@ -0,0 +1,87 @@
1
+ # Mock run — `/orc-fix`
2
+
3
+ > You fixed something, and the fix says something about an earlier review.
4
+ > Type this, and ORC records what the fix fixes, so the next review sees it.
5
+
6
+ ---
7
+
8
+ ## 1. What it does
9
+
10
+ It records ONE fix and what it fixes. It looks at the evidence first: what
11
+ found the problem (Sonar, a failed check, a defect, a PR comment) and who wrote
12
+ the bad lines (an ORC run, an AI tool, a person). It asks you once. Then it
13
+ records the fix and goes back to exactly where you were.
14
+
15
+ It opens no run of its own. You can type it in the middle of another run, also
16
+ while that run waits at a question.
17
+
18
+ - **A run is open** → it only records. The run you are in makes the fix.
19
+ - **No run is open** → it can also make the fix, like `/orc-quick`: you pick
20
+ the agent, the build and the tests must be green, and then it records.
21
+
22
+ ---
23
+
24
+ ## 2. The run
25
+
26
+ Rina is in an `/orc-quick` run. Sonar flagged `computeTotal()` as too complex,
27
+ and those lines came from last week's `/orc-mini` run, which had a review.
28
+
29
+ ```
30
+ > /orc-fix this fixes Sonar typescript:S3776 in src/orders/total.ts:40-58
31
+ ```
32
+
33
+ ```
34
+ This fix: source sonar · introduced by ORC (run-mini-total-290926-101500)
35
+ - a Sonar rule key (typescript:S3776)
36
+ - git blame → 4c1e2a9: the commit falls inside the run's trace window and
37
+ src/orders/total.ts is in the run's changed set
38
+ host run: run-quick-total-fix-021026-091200 — record only, the host lane
39
+ makes the fix
40
+
41
+ 1. confirm 2. change the class 3. cancel
42
+ ```
43
+
44
+ ```
45
+ > 1
46
+ ```
47
+
48
+ ```
49
+ recorded F-9f2c41ab · sonar typescript:S3776 · introduced by ORC
50
+ (run-mini-total-290926-101500) · missed by review run-mini-total-290926-101500
51
+ · the next review sees it
52
+
53
+ Back to the run. Entry 3 is waiting for your "go".
54
+ ```
55
+
56
+ The next time a reviewer looks at `src/orders/total.ts`, its card has this line:
57
+
58
+ ```
59
+ fix: src/orders/total.ts — Sonar typescript:S3776 after ORC run
60
+ run-mini-total-290926-101500 · missed by review
61
+ ```
62
+
63
+ ---
64
+
65
+ ## 3. What to notice
66
+
67
+ - **It classifies from evidence, and your word wins.** `orc fix classify` reads
68
+ `git blame`, the traces and the run snapshots. If you change the class, the
69
+ record says `class_by: user`.
70
+ - **"Missed by review" is computed.** Every review stores the line ranges it
71
+ read. A fix on those lines, from an earlier run, is a miss. ORC never guesses
72
+ it, and you never type it.
73
+ - **A fix is never a review.** The record's author is who FOUND the problem
74
+ (Sonar is a bot, a user report is a person). Review Quality counts reviews
75
+ apart, and shows fixes in their own block: **Fixes after review**.
76
+ - **A Sonar fix and the Sonar import are the same row.** With the issue key, the
77
+ record uses the importer's id, so the next `orc gotcha sync` completes it.
78
+ - **One trace line.** `orc fix record` writes ONE `FIX` line into the run you
79
+ are in. It never writes the run pointer.
80
+
81
+ ---
82
+
83
+ ## 4. Related
84
+
85
+ - The panel: `orc ui` ▸ Behaviour ▸ Review quality ▸ **Fixes after review**
86
+ - The records: `orc fix list`
87
+ - The Sonar import: [gotcha-import](gotcha-import.md)
@@ -1,112 +1,112 @@
1
- # Mock run — `/orc-pattern`
2
-
3
- > Learns how **your** code is actually written, and caches it, so every future
4
- > executor writes code that looks like yours.
5
-
6
- ---
7
-
8
- ## 1. What it does
9
-
10
- ORC ships a generic best-practice playbook for each language (React, Vue,
11
- Next.js, Angular, Express, NestJS, Django, FastAPI, Go, Postgres, plus a11y and
12
- performance rule packs). On its own, a playbook would fight your codebase.
13
-
14
- So the pattern is a **reconciliation** of two things, with two different rules:
15
-
16
- | Rule class | Example | Who wins |
17
- |---|---|---|
18
- | **Conventions** — style and shape | folder layout, naming, how you do DI | **Your project wins**, even if the playbook disagrees |
19
- | **Invariants** — correctness and security | no SQL built by string concat, no stack traces in a response, no index as a React key | **Always applied.** A project breaking these is buggy, not different |
20
-
21
- The result is cached at `.claude/orc/patterns/<lang>-pattern.md` and copied
22
- **word for word** into every executor slice from then on.
23
-
24
- ---
25
-
26
- ## 2. The run
27
-
28
- ```
29
- > /orc-pattern
30
- ```
31
-
32
- ```
33
- Languages I can see in this repo:
34
- express api/ 38 files no cached pattern
35
- react web/ 52 files no cached pattern
36
-
37
- Learning a pattern reads your most recently changed files with a subagent.
38
- That costs tokens once, and every run after it is cheaper and more accurate.
39
-
40
- Codify which? [both / express / react / none]
41
-
42
- > both
43
- ```
44
-
45
- ```
46
- Dispatching orc-pattern-codifier-sonnet-5-high (express) …
47
- returned as: claude-sonnet-5 / high ✓
48
-
49
- PATTERN — express source: reconciled 14 recent files read
50
-
51
- Conventions taken FROM YOUR CODE (the playbook lost these)
52
- · routes live in api/<area>/routes.ts, handlers in the same folder
53
- · every handler is `export async function`, never an arrow const
54
- · errors go through next(err) — you do not try/catch in handlers
55
- · money is always integer minor units (api/payments/*.ts, 6 files)
56
-
57
- Invariants KEPT from the playbook (not negotiable)
58
- · no SQL string interpolation — you use parameterised queries already ✓
59
- · no stack trace or raw error in a response body
60
- · every route that reads :id re-checks ownership
61
-
62
- Conflicts I will not guess about (1)
63
- · api/refunds/ uses try/catch in 3 handlers while api/orders/ uses
64
- next(err). Most recently modified wins → next(err). Say so if that is
65
- backwards and I will flip it.
66
-
67
- Written: .claude/orc/patterns/express-pattern.md
68
-
69
- Dispatching orc-pattern-codifier-sonnet-5-high (react) …
70
- Written: .claude/orc/patterns/react-pattern.md
71
- ```
72
-
73
- ---
74
-
75
- ## 3. How other lanes see it
76
-
77
- ```
78
- $ orc pattern status express
79
- express cached 2026-08-12 (exit 0)
80
-
81
- $ orc pattern status svelte
82
- svelte unknown language key (exit 2)
83
- keys come from orc-pattern/references/INDEX.md — it is a framework
84
- name, never a file extension
85
-
86
- $ orc pattern status go
87
- go not cached (exit 1)
88
- ```
89
-
90
- That exit code is how `/orc-fast` decides whether it is allowed to run. It is
91
- a deterministic probe, never a guess and never a file search — the `.claude/`
92
- folder is hidden, so a plain search would say "missing" from the wrong folder.
93
-
94
- ---
95
-
96
- ## 4. What to notice
97
-
98
- - **ORC does not codify by itself.** It sends a subagent, reads the answer,
99
- and writes the cache itself.
100
- - **The cache survives updates.** It lives outside `templates/`, so
101
- `orc update` never touches it.
102
- - **Ambiguity is reported once, not guessed silently.** The try/catch conflict
103
- above is a real example of that rule.
104
- - **A brand new language folder gets the plain playbook**, marked
105
- `source: generic` — there is nothing to reconcile yet.
106
-
107
- ---
108
-
109
- ## 5. Related
110
-
111
- - The lane that requires this: [`/orc-fast`](orc-fast.md)
112
- - Build the other half of the knowledge: [`/orc-wiki`](../templates/skills/orc-wiki/examples/wiki-run-mock.md)
1
+ # Mock run — `/orc-pattern`
2
+
3
+ > Learns how **your** code is actually written, and caches it, so every future
4
+ > executor writes code that looks like yours.
5
+
6
+ ---
7
+
8
+ ## 1. What it does
9
+
10
+ ORC ships a generic best-practice playbook for each language (React, Vue,
11
+ Next.js, Angular, Express, NestJS, Django, FastAPI, Go, Postgres, plus a11y and
12
+ performance rule packs). On its own, a playbook would fight your codebase.
13
+
14
+ So the pattern is a **reconciliation** of two things, with two different rules:
15
+
16
+ | Rule class | Example | Who wins |
17
+ |---|---|---|
18
+ | **Conventions** — style and shape | folder layout, naming, how you do DI | **Your project wins**, even if the playbook disagrees |
19
+ | **Invariants** — correctness and security | no SQL built by string concat, no stack traces in a response, no index as a React key | **Always applied.** A project breaking these is buggy, not different |
20
+
21
+ The result is cached at `.claude/orc/patterns/<lang>-pattern.md` and copied
22
+ **word for word** into every executor slice from then on.
23
+
24
+ ---
25
+
26
+ ## 2. The run
27
+
28
+ ```
29
+ > /orc-pattern
30
+ ```
31
+
32
+ ```
33
+ Languages I can see in this repo:
34
+ express api/ 38 files no cached pattern
35
+ react web/ 52 files no cached pattern
36
+
37
+ Learning a pattern reads your most recently changed files with a subagent.
38
+ That costs tokens once, and every run after it is cheaper and more accurate.
39
+
40
+ Codify which? [both / express / react / none]
41
+
42
+ > both
43
+ ```
44
+
45
+ ```
46
+ Dispatching orc-pattern-codifier-sonnet-5-high (express) …
47
+ returned as: claude-sonnet-5-5 / high ✓
48
+
49
+ PATTERN — express source: reconciled 14 recent files read
50
+
51
+ Conventions taken FROM YOUR CODE (the playbook lost these)
52
+ · routes live in api/<area>/routes.ts, handlers in the same folder
53
+ · every handler is `export async function`, never an arrow const
54
+ · errors go through next(err) — you do not try/catch in handlers
55
+ · money is always integer minor units (api/payments/*.ts, 6 files)
56
+
57
+ Invariants KEPT from the playbook (not negotiable)
58
+ · no SQL string interpolation — you use parameterised queries already ✓
59
+ · no stack trace or raw error in a response body
60
+ · every route that reads :id re-checks ownership
61
+
62
+ Conflicts I will not guess about (1)
63
+ · api/refunds/ uses try/catch in 3 handlers while api/orders/ uses
64
+ next(err). Most recently modified wins → next(err). Say so if that is
65
+ backwards and I will flip it.
66
+
67
+ Written: .claude/orc/patterns/express-pattern.md
68
+
69
+ Dispatching orc-pattern-codifier-sonnet-5-high (react) …
70
+ Written: .claude/orc/patterns/react-pattern.md
71
+ ```
72
+
73
+ ---
74
+
75
+ ## 3. How other lanes see it
76
+
77
+ ```
78
+ $ orc pattern status express
79
+ express cached 2026-08-12 (exit 0)
80
+
81
+ $ orc pattern status svelte
82
+ svelte unknown language key (exit 2)
83
+ keys come from orc-pattern/references/INDEX.md — it is a framework
84
+ name, never a file extension
85
+
86
+ $ orc pattern status go
87
+ go not cached (exit 1)
88
+ ```
89
+
90
+ That exit code is how `/orc-fast` decides whether it is allowed to run. It is
91
+ a deterministic probe, never a guess and never a file search — the `.claude/`
92
+ folder is hidden, so a plain search would say "missing" from the wrong folder.
93
+
94
+ ---
95
+
96
+ ## 4. What to notice
97
+
98
+ - **ORC does not codify by itself.** It sends a subagent, reads the answer,
99
+ and writes the cache itself.
100
+ - **The cache survives updates.** It lives outside `templates/`, so
101
+ `orc update` never touches it.
102
+ - **Ambiguity is reported once, not guessed silently.** The try/catch conflict
103
+ above is a real example of that rule.
104
+ - **A brand new language folder gets the plain playbook**, marked
105
+ `source: generic` — there is nothing to reconcile yet.
106
+
107
+ ---
108
+
109
+ ## 5. Related
110
+
111
+ - The lane that requires this: [`/orc-fast`](orc-fast.md)
112
+ - Build the other half of the knowledge: [`/orc-wiki`](../templates/skills/orc-wiki/examples/wiki-run-mock.md)
@@ -125,7 +125,12 @@ Your next request becomes entry 2 in the same file, and so on.
125
125
  thread, approves or merges. PR comments are treated as data, never as
126
126
  instructions.
127
127
  - **It never undoes your work.** If you stop while things are red, it prints
128
- the `git` command and leaves your tree alone.
128
+ `orc undo --run <slug>` and leaves your tree alone. That command reverts only
129
+ the files the run changed, and only when you add `--apply`.
130
+ - **The review offer uses the repair memory.** A review gets the gotcha card of
131
+ the files it reads, and the outcome of each finding is recorded. With
132
+ [habits](habits.md) on, your usual answer is marked — the dispatch gate is
133
+ still asked every time.
129
134
  - **A defect is shown red first.** If it cannot be reproduced — no runner, no
130
135
  reachable entry point — the entry says *not reproduced* with the reason, and
131
136
  says it again at the commit offer. It never invents a reproduction.
package/mock-run/orc.md CHANGED
@@ -1,157 +1,157 @@
1
- # Mock run — `/orc`
2
-
3
- > The full pipeline: understand → plan → score → build in parallel → review →
4
- > verify → ship.
5
-
6
- Use this when the job is a real feature, not a one-line fix.
7
-
8
- ---
9
-
10
- ## 1. What it does
11
-
12
- `/orc` never writes code itself. It is the **coordinator**. It splits the work
13
- into tasks, gives each task a score from 0 to 100, and sends each task to the
14
- **cheapest model that can still do it**. Tasks that do not touch the same files
15
- run at the same time (a "wave").
16
-
17
- It writes everything to disk as it goes, so you can stop any time and come back
18
- tomorrow — even in a brand new chat.
19
-
20
- ---
21
-
22
- ## 2. The run
23
-
24
- Rina wants order notes on the checkout page and a new API field.
25
-
26
- ```
27
- > /orc add order notes: a note field on checkout, saved with the order,
28
- shown on the order page
29
- ```
30
-
31
- ### Phase 0 — Intake (it asks, you sign off)
32
-
33
- ```
34
- Run folder: .claude/orc/run/order-notes/
35
-
36
- I read the repo: TypeScript, vitest, Express. I will not ask you about that.
37
- Size looks medium. Four questions, one round:
38
-
39
- 1 What must exist when this is done?
40
- 2 What is NOT part of this?
41
- 3 How will we know it works?
42
- 4 Any file or pattern to stay away from?
43
-
44
- > 1 note box on checkout + note saved + note shown on order page
45
- > 2 no editing a note after the order is placed, no admin view
46
- > 3 a new order keeps its note after a page reload
47
- > 4 follow api/orders/, do not touch api/payments/
48
-
49
- Draft written: .claude/orc/run/order-notes/intent-spec.md
50
- Sign-off: gate (I stop until you approve) or soft?
51
-
52
- > gate
53
-
54
- Approved.
55
- ```
56
-
57
- ### Phase 1 — Planning
58
-
59
- ```
60
- Planner: ORC's own planner.
61
-
62
- 5 tasks. Every file path checked against the real repo:
63
- 14 of 15 paths exist. `api/orders/note_servce.ts` does NOT exist (typo).
64
- → plan sent back to the planner → corrected to note_service.ts ✓
65
-
66
- TDD: 3 tasks get a red-proof task first. 2 do not:
67
- T4 covered-by-existing → api/orders/orders.test.ts:120 (checked, it exists)
68
- T5 no-behavior → a string in web/locales/en.json
69
- ```
70
-
71
- ### Phase 2 — Scoring (arithmetic, not opinion)
72
-
73
- ```
74
- Task facets score model
75
- T1 order note column + migration 3 files · new · stateful 62 sonnet-5 high
76
- T2 POST /orders accepts note 2 files · imitate 38 sonnet-4-6 med
77
- T3 checkout note box 2 files · imitate 35 sonnet-4-6 med
78
- T4 order page shows the note 1 file · mechanical 12 haiku-4-5
79
- T5 label text 1 file · mechanical 4 haiku-4-5
80
-
81
- Waves: W1 {T1} W2 {T2, T3} W3 {T4, T5}
82
- Pause every 2 waves. OK to start?
83
-
84
- > yes
85
- ```
86
-
87
- ### Phase 3 — Building
88
-
89
- ```
90
- ▶ W1 orc-executor-sonnet-5-high (T1)
91
- 40% … 100% returned: build green, `npx vitest run db/` exit 0
92
- answered as: claude-sonnet-5 / high ✓ matches what I asked for
93
-
94
- ▶ W2 two agents at the same time
95
- T3 asked me a question: "note max length?" → your call:
96
-
97
- > 500 characters
98
-
99
- Answered. Both returned ✓. No two tasks touched the same file.
100
-
101
- ⏸ PAUSE (2 waves done)
102
- Checkpoint saved. To continue in a fresh chat, paste this:
103
-
104
- | Continue ORC run `order-notes`.
105
- | Read .claude/orc/run/order-notes/state-of-play.md, then checkpoint.json.
106
- | Do not re-plan. Do not redo finished tasks.
107
-
108
- > continue
109
-
110
- ▶ W3 two haiku agents → done. 5 of 5 tasks complete.
111
- ```
112
-
113
- ### Phases 5–6 — Review, then verify
114
-
115
- ```
116
- Review (orc-reviewer-opus-5-med):
117
- P1 note is not length-checked on the server — api/orders/create.ts:44
118
- I re-read line 44 myself. The quote matches. Fix it? > yes
119
- P3 naming nit ×2 (counted, not fixed)
120
-
121
- Verify (orc-verifier-opus-5-med) — against YOUR definition of done:
122
- note saved ✓ orders.test.ts:131
123
- note survives F5 ✗ no test covers a reload → P0, fixed once, re-checked ✓
124
- PASSED 18/18 tests green
125
- ```
126
-
127
- ### Phase 8 — Ship
128
-
129
- ```
130
- Branch feat/order-notes. Commit? Push? Open a PR? > yes to all
131
- Ticket / title / target? > SHOP-214 / Add order notes / develop
132
-
133
- ✓ committed ✓ pushed ✓ PR body written from your pr.md template
134
-
135
- 5 tasks · 3 waves · 5 subagents · 1 pause · 1 question to you · 0 downgrades
136
- ```
137
-
138
- ---
139
-
140
- ## 3. What to notice
141
-
142
- - **The orchestrator never wrote a line of code.** Even the 4-point label task
143
- went to a subagent. That is what keeps it able to run for hours.
144
- - **A bad file path was caught before any agent started.** The planner claimed
145
- `note_servce.ts`; ORC checked the disk and bounced the plan.
146
- - **The score picked the model, and the trace proves what answered.** Every
147
- return says which model really replied, so a silent downgrade is visible.
148
- - **The pause is real.** It stops. It does not "keep going a bit more".
149
-
150
- ---
151
-
152
- ## 4. Related
153
-
154
- - The dense, annotated version of this run (written for the model, not for
155
- people): [`templates/skills/orc/examples/full-run-mock.md`](../templates/skills/orc/examples/full-run-mock.md)
156
- - Smaller job? [`/orc-mini`](../templates/skills/orc-mini/examples/mini-run-mock.md)
157
- - Not sure which lane? [`/orc-route`](orc-route.md)
1
+ # Mock run — `/orc`
2
+
3
+ > The full pipeline: understand → plan → score → build in parallel → review →
4
+ > verify → ship.
5
+
6
+ Use this when the job is a real feature, not a one-line fix.
7
+
8
+ ---
9
+
10
+ ## 1. What it does
11
+
12
+ `/orc` never writes code itself. It is the **coordinator**. It splits the work
13
+ into tasks, gives each task a score from 0 to 100, and sends each task to the
14
+ **cheapest model that can still do it**. Tasks that do not touch the same files
15
+ run at the same time (a "wave").
16
+
17
+ It writes everything to disk as it goes, so you can stop any time and come back
18
+ tomorrow — even in a brand new chat.
19
+
20
+ ---
21
+
22
+ ## 2. The run
23
+
24
+ Rina wants order notes on the checkout page and a new API field.
25
+
26
+ ```
27
+ > /orc add order notes: a note field on checkout, saved with the order,
28
+ shown on the order page
29
+ ```
30
+
31
+ ### Phase 0 — Intake (it asks, you sign off)
32
+
33
+ ```
34
+ Run folder: .claude/orc/run/order-notes/
35
+
36
+ I read the repo: TypeScript, vitest, Express. I will not ask you about that.
37
+ Size looks medium. Four questions, one round:
38
+
39
+ 1 What must exist when this is done?
40
+ 2 What is NOT part of this?
41
+ 3 How will we know it works?
42
+ 4 Any file or pattern to stay away from?
43
+
44
+ > 1 note box on checkout + note saved + note shown on order page
45
+ > 2 no editing a note after the order is placed, no admin view
46
+ > 3 a new order keeps its note after a page reload
47
+ > 4 follow api/orders/, do not touch api/payments/
48
+
49
+ Draft written: .claude/orc/run/order-notes/intent-spec.md
50
+ Sign-off: gate (I stop until you approve) or soft?
51
+
52
+ > gate
53
+
54
+ Approved.
55
+ ```
56
+
57
+ ### Phase 1 — Planning
58
+
59
+ ```
60
+ Planner: ORC's own planner.
61
+
62
+ 5 tasks. Every file path checked against the real repo:
63
+ 14 of 15 paths exist. `api/orders/note_servce.ts` does NOT exist (typo).
64
+ → plan sent back to the planner → corrected to note_service.ts ✓
65
+
66
+ TDD: 3 tasks get a red-proof task first. 2 do not:
67
+ T4 covered-by-existing → api/orders/orders.test.ts:120 (checked, it exists)
68
+ T5 no-behavior → a string in web/locales/en.json
69
+ ```
70
+
71
+ ### Phase 2 — Scoring (arithmetic, not opinion)
72
+
73
+ ```
74
+ Task facets score model
75
+ T1 order note column + migration 3 files · new · stateful 62 sonnet-5 high
76
+ T2 POST /orders accepts note 2 files · imitate 38 sonnet-4-6 med
77
+ T3 checkout note box 2 files · imitate 35 sonnet-4-6 med
78
+ T4 order page shows the note 1 file · mechanical 12 haiku-4-5
79
+ T5 label text 1 file · mechanical 4 haiku-4-5
80
+
81
+ Waves: W1 {T1} W2 {T2, T3} W3 {T4, T5}
82
+ Pause every 2 waves. OK to start?
83
+
84
+ > yes
85
+ ```
86
+
87
+ ### Phase 3 — Building
88
+
89
+ ```
90
+ ▶ W1 orc-executor-sonnet-5-high (T1)
91
+ 40% … 100% returned: build green, `npx vitest run db/` exit 0
92
+ answered as: claude-sonnet-5-5 / high ✓ matches what I asked for
93
+
94
+ ▶ W2 two agents at the same time
95
+ T3 asked me a question: "note max length?" → your call:
96
+
97
+ > 500 characters
98
+
99
+ Answered. Both returned ✓. No two tasks touched the same file.
100
+
101
+ ⏸ PAUSE (2 waves done)
102
+ Checkpoint saved. To continue in a fresh chat, paste this:
103
+
104
+ | Continue ORC run `order-notes`.
105
+ | Read .claude/orc/run/order-notes/state-of-play.md, then checkpoint.json.
106
+ | Do not re-plan. Do not redo finished tasks.
107
+
108
+ > continue
109
+
110
+ ▶ W3 two haiku agents → done. 5 of 5 tasks complete.
111
+ ```
112
+
113
+ ### Phases 5–6 — Review, then verify
114
+
115
+ ```
116
+ Review (orc-reviewer-opus-5-low):
117
+ P1 note is not length-checked on the server — api/orders/create.ts:44
118
+ I re-read line 44 myself. The quote matches. Fix it? > yes
119
+ P3 naming nit ×2 (counted, not fixed)
120
+
121
+ Verify (orc-verifier-opus-5-med) — against YOUR definition of done:
122
+ note saved ✓ orders.test.ts:131
123
+ note survives F5 ✗ no test covers a reload → P0, fixed once, re-checked ✓
124
+ PASSED 18/18 tests green
125
+ ```
126
+
127
+ ### Phase 8 — Ship
128
+
129
+ ```
130
+ Branch feat/order-notes. Commit? Push? Open a PR? > yes to all
131
+ Ticket / title / target? > SHOP-214 / Add order notes / develop
132
+
133
+ ✓ committed ✓ pushed ✓ PR body written from your pr.md template
134
+
135
+ 5 tasks · 3 waves · 5 subagents · 1 pause · 1 question to you · 0 downgrades
136
+ ```
137
+
138
+ ---
139
+
140
+ ## 3. What to notice
141
+
142
+ - **The orchestrator never wrote a line of code.** Even the 4-point label task
143
+ went to a subagent. That is what keeps it able to run for hours.
144
+ - **A bad file path was caught before any agent started.** The planner claimed
145
+ `note_servce.ts`; ORC checked the disk and bounced the plan.
146
+ - **The score picked the model, and the trace proves what answered.** Every
147
+ return says which model really replied, so a silent downgrade is visible.
148
+ - **The pause is real.** It stops. It does not "keep going a bit more".
149
+
150
+ ---
151
+
152
+ ## 4. Related
153
+
154
+ - The dense, annotated version of this run (written for the model, not for
155
+ people): [`templates/skills/orc/examples/full-run-mock.md`](../templates/skills/orc/examples/full-run-mock.md)
156
+ - Smaller job? [`/orc-mini`](../templates/skills/orc-mini/examples/mini-run-mock.md)
157
+ - Not sure which lane? [`/orc-route`](orc-route.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-id/orc",
3
- "version": "1.9.2",
3
+ "version": "2.1.0",
4
4
  "description": "ORC — an orchestrator skill constellation for Claude Code: intake, planning, scored parallel subagents, code-pattern matching, review, verify, ship, plus a project knowledge-base wiki.",
5
5
  "bin": {
6
6
  "orc": "bin/cli.js"