@azure-id/orc 2.1.1 → 2.2.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 (145) hide show
  1. package/CHANGELOG.md +320 -0
  2. package/README.md +48 -23
  3. package/bin/build-agents.js +207 -205
  4. package/bin/cli.js +48188 -47417
  5. package/bin/fix.js +21 -18
  6. package/bin/graph-extract.js +314 -6
  7. package/bin/graph-gain.js +83 -2
  8. package/bin/graph-map.js +23 -1
  9. package/bin/graph-notes.js +1 -1
  10. package/bin/graph-query.js +1362 -37
  11. package/bin/graph-resolve.js +1 -1
  12. package/bin/graph-shard.js +29 -6
  13. package/bin/graph-signals.js +5 -3
  14. package/bin/graph.js +7 -3
  15. package/bin/habit.js +1 -1
  16. package/bin/pricing.json +8 -1
  17. package/bin/trace-write.js +40 -11
  18. package/bin/verify-contracts.js +5661 -5552
  19. package/bin/verify-package.js +716 -716
  20. package/bin/webui/api.js +8 -0
  21. package/bin/webui/fixtures/extra.js +2036 -2036
  22. package/bin/webui/fixtures/flow.js +1 -1
  23. package/bin/webui/fixtures/index.js +2 -2
  24. package/bin/webui/fixtures/knowledge.js +8 -1
  25. package/bin/webui/fixtures/pact.js +112 -111
  26. package/bin/webui/fixtures/stats.js +2 -2
  27. package/bin/webui/i18n/en/knowledge.json +2 -0
  28. package/bin/webui/i18n/id/knowledge.json +2 -0
  29. package/bin/webui/js/panels/knowledge.js +17 -0
  30. package/guides/code-graph-benefit.md +116 -0
  31. package/guides/configuration.md +150 -0
  32. package/guides/documents.md +262 -0
  33. package/guides/extra-models.md +448 -0
  34. package/guides/habits-and-gotchas.md +152 -0
  35. package/guides/knowledge-reads.md +190 -0
  36. package/guides/model-selection.md +186 -0
  37. package/guides/rules.md +305 -0
  38. package/guides/status-line.md +344 -0
  39. package/mock-run/orc-cli.md +3 -2
  40. package/mock-run/orc-doc.md +452 -448
  41. package/mock-run/orc.md +157 -157
  42. package/package.json +2 -1
  43. package/templates/agents/MODEL-MAPPING.md +176 -176
  44. package/templates/agents/{orc-executor-haiku-4-5.md → orc-executor-haiku-5-high.md} +21 -8
  45. package/templates/agents/orc-executor-opus-4-7-high.md +17 -5
  46. package/templates/agents/orc-executor-opus-4-7-med.md +17 -5
  47. package/templates/agents/orc-executor-opus-4-8-high.md +17 -5
  48. package/templates/agents/orc-executor-opus-5-high.md +17 -5
  49. package/templates/agents/orc-executor-opus-5-low.md +17 -5
  50. package/templates/agents/orc-executor-opus-5-med.md +17 -5
  51. package/templates/agents/orc-executor-sonnet-4-6-high.md +17 -5
  52. package/templates/agents/orc-executor-sonnet-5-high.md +17 -5
  53. package/templates/agents/orc-executor-sonnet-5-low.md +17 -5
  54. package/templates/agents/orc-executor-sonnet-5-med.md +17 -5
  55. package/templates/agents/{orc-graph-noter-sonnet-4-6-med.md → orc-graph-noter-haiku-5-high.md} +4 -4
  56. package/templates/agents/orc-planner-mini-opus-5-med.md +3 -1
  57. package/templates/agents/orc-planner-mini-sonnet-5-high.md +3 -1
  58. package/templates/agents/orc-planner-opus-5-med.md +3 -1
  59. package/templates/agents/{orc-trace-writer-haiku-4-5.md → orc-trace-writer-haiku-5-high.md} +4 -3
  60. package/templates/commands/orc-doc.md +128 -128
  61. package/templates/commands/orc-export.md +51 -46
  62. package/templates/hooks/README.md +8 -3
  63. package/templates/hooks/orc-effort-guard.js +105 -27
  64. package/templates/hooks/orc-graph-hook.js +252 -4
  65. package/templates/hooks/orc-statusline.js +13 -6
  66. package/templates/hooks/orc-trace.js +1 -1
  67. package/templates/skills/_shared/README.md +2 -2
  68. package/templates/skills/_shared/code-graph.md +185 -251
  69. package/templates/skills/_shared/extra-dispatch.md +1331 -1331
  70. package/templates/skills/_shared/lane-contract.md +7 -3
  71. package/templates/skills/_shared/opus5-only.md +137 -137
  72. package/templates/skills/_shared/phases/execution.md +13 -11
  73. package/templates/skills/_shared/phases/planning.md +27 -9
  74. package/templates/skills/_shared/phases/preflight.md +3 -3
  75. package/templates/skills/_shared/phases/review.md +4 -3
  76. package/templates/skills/_shared/phases/ship.md +7 -10
  77. package/templates/skills/_shared/phases/summary.md +2 -3
  78. package/templates/skills/_shared/phases/trace-verbs.md +21 -16
  79. package/templates/skills/_shared/phases/trace.md +3 -3
  80. package/templates/skills/_shared/phases/wiki-consult.md +2 -2
  81. package/templates/skills/_shared/pr-templates.md +108 -106
  82. package/templates/skills/_shared/read-ladder.md +8 -2
  83. package/templates/skills/_shared/return-validation.md +10 -6
  84. package/templates/skills/_shared/review-slice.md +1 -1
  85. package/templates/skills/_shared/stack-plan.md +135 -135
  86. package/templates/skills/_shared/wait.md +14 -2
  87. package/templates/skills/context-combiner/SKILL.md +2 -2
  88. package/templates/skills/orc/SKILL.md +227 -227
  89. package/templates/skills/orc/config.md +2 -2
  90. package/templates/skills/orc/examples/full-run-mock.md +74 -74
  91. package/templates/skills/orc/schemas/planning-output.md +3 -0
  92. package/templates/skills/orc-aftermath/SKILL.md +15 -15
  93. package/templates/skills/orc-analyze/SKILL.md +2 -2
  94. package/templates/skills/orc-analyze-mini/SKILL.md +2 -2
  95. package/templates/skills/orc-boundary/SKILL.md +15 -15
  96. package/templates/skills/orc-boundary/references/card.md +81 -78
  97. package/templates/skills/orc-boundary/references/gate.md +113 -113
  98. package/templates/skills/orc-brainstorm/SKILL.md +15 -15
  99. package/templates/skills/orc-budget/SKILL.md +15 -15
  100. package/templates/skills/orc-challenge/README.md +1 -1
  101. package/templates/skills/orc-challenge/SKILL.md +16 -16
  102. package/templates/skills/orc-challenge/examples/council-full-roster.md +1 -1
  103. package/templates/skills/orc-claude/SKILL.md +4 -4
  104. package/templates/skills/orc-claude/examples/claude-run-mock.md +1 -1
  105. package/templates/skills/orc-diy/SKILL.md +2 -2
  106. package/templates/skills/orc-diy/references/blocks/wiki.md +26 -26
  107. package/templates/skills/orc-diy/references/flow-schema.md +2 -2
  108. package/templates/skills/orc-doc/README.md +2 -2
  109. package/templates/skills/orc-doc/SKILL.md +501 -490
  110. package/templates/skills/orc-doc/examples/orc-doc-prd-run.md +12 -1
  111. package/templates/skills/orc-doc/references/chunking.md +6 -4
  112. package/templates/skills/orc-doc/references/gates.md +311 -311
  113. package/templates/skills/orc-doc/references/resume-protocol.md +229 -228
  114. package/templates/skills/orc-explain/SKILL.md +88 -88
  115. package/templates/skills/orc-export/SKILL.md +190 -187
  116. package/templates/skills/orc-fast/SKILL.md +213 -210
  117. package/templates/skills/orc-grill/SKILL.md +245 -245
  118. package/templates/skills/orc-handoff/SKILL.md +11 -11
  119. package/templates/skills/orc-learn/SKILL.md +13 -13
  120. package/templates/skills/orc-learn/examples/learn-run-mock.md +2 -2
  121. package/templates/skills/orc-mini/SKILL.md +12 -12
  122. package/templates/skills/orc-mini/examples/mini-run-mock.md +4 -5
  123. package/templates/skills/orc-pact/SKILL.md +15 -15
  124. package/templates/skills/orc-pact/references/gate.md +70 -70
  125. package/templates/skills/orc-pattern/SKILL.md +3 -3
  126. package/templates/skills/orc-poly/SKILL.md +4 -4
  127. package/templates/skills/orc-poly/examples/poly-run-mock.md +51 -51
  128. package/templates/skills/orc-pr-driver/SKILL.md +4 -3
  129. package/templates/skills/orc-pr-driver/references/orc-run-split.md +108 -99
  130. package/templates/skills/orc-pr-setup/SKILL.md +2 -2
  131. package/templates/skills/orc-quick/README.md +535 -536
  132. package/templates/skills/orc-quick/SKILL.md +29 -32
  133. package/templates/skills/orc-quick/references/context-doc.md +145 -145
  134. package/templates/skills/orc-quick/references/dispatch-gate.md +220 -220
  135. package/templates/skills/orc-quick/references/gh-mode.md +2 -1
  136. package/templates/skills/orc-quick/references/look.md +34 -12
  137. package/templates/skills/orc-retro/SKILL.md +2 -2
  138. package/templates/skills/orc-retro/examples/retro-mock.md +2 -2
  139. package/templates/skills/orc-route/SKILL.md +2 -2
  140. package/templates/skills/orc-test/SKILL.md +6 -3
  141. package/templates/skills/orc-verify/SKILL.md +2 -2
  142. package/templates/skills/orc-wait/SKILL.md +10 -2
  143. package/templates/skills/orc-wiki/SKILL.md +4 -4
  144. package/templates/skills/orc-wiki/references/pattern-prewarm.md +19 -19
  145. package/templates/agents/orc-executor-sonnet-4-6-med.md +0 -155
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-5 high
77
- T3 checkout note box 2 files · imitate 35 sonnet-5 high
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)
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-5 high
77
+ T3 checkout note box 2 files · imitate 35 sonnet-5 high
78
+ T4 order page shows the note 1 file · mechanical 12 haiku-5-high
79
+ T5 label text 1 file · mechanical 4 haiku-5-high
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": "2.1.1",
3
+ "version": "2.2.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"
@@ -10,6 +10,7 @@
10
10
  "README-id.md",
11
11
  "CHANGELOG.md",
12
12
  "bin/",
13
+ "guides/",
13
14
  "mock-run/",
14
15
  "templates/"
15
16
  ],