@azure-id/orc 0.56.1 → 1.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 (162) hide show
  1. package/CHANGELOG.md +219 -0
  2. package/README-id.md +49 -107
  3. package/README.md +694 -719
  4. package/bin/build-agents.js +18 -11
  5. package/bin/cli.js +33699 -29855
  6. package/bin/onboarding-content.js +0 -3
  7. package/bin/test-run.js +491 -0
  8. package/bin/verify-contracts.js +4330 -3277
  9. package/bin/verify-package.js +76 -6
  10. package/bin/webui/api.js +1201 -1163
  11. package/bin/webui/app.html +210 -198
  12. package/bin/webui/css/06-responsive.css +120 -108
  13. package/bin/webui/css/panels/extra.css +29 -0
  14. package/bin/webui/css/panels/lanes.css +134 -0
  15. package/bin/webui/css/panels/settings.css +79 -3
  16. package/bin/webui/css/panels/wait.css +123 -0
  17. package/bin/webui/fixtures/extra.js +2036 -1934
  18. package/bin/webui/fixtures/flow.js +2 -2
  19. package/bin/webui/fixtures/index.js +510 -486
  20. package/bin/webui/fixtures/lanes.js +218 -0
  21. package/bin/webui/fixtures/settings.js +261 -34
  22. package/bin/webui/fixtures/stats.js +3 -3
  23. package/bin/webui/fixtures/wait.js +97 -0
  24. package/bin/webui/i18n/TERMS.md +135 -134
  25. package/bin/webui/i18n/en/extra.json +345 -313
  26. package/bin/webui/i18n/en/lanes.json +29 -0
  27. package/bin/webui/i18n/en/nav.json +21 -19
  28. package/bin/webui/i18n/en/overview.json +2 -0
  29. package/bin/webui/i18n/en/settings.json +16 -5
  30. package/bin/webui/i18n/en/wait.json +41 -0
  31. package/bin/webui/i18n/id/extra.json +345 -313
  32. package/bin/webui/i18n/id/lanes.json +29 -0
  33. package/bin/webui/i18n/id/nav.json +21 -19
  34. package/bin/webui/i18n/id/overview.json +2 -0
  35. package/bin/webui/i18n/id/settings.json +15 -4
  36. package/bin/webui/i18n/id/wait.json +41 -0
  37. package/bin/webui/js/01-i18n.js +151 -149
  38. package/bin/webui/js/panels/extra.js +3199 -3011
  39. package/bin/webui/js/panels/lanes.js +259 -0
  40. package/bin/webui/js/panels/overview.js +10 -0
  41. package/bin/webui/js/panels/settings.js +149 -3
  42. package/bin/webui/js/panels/wait.js +253 -0
  43. package/package.json +39 -39
  44. package/templates/agents/MODEL-MAPPING.md +23 -35
  45. package/templates/agents/orc-executor-opus-4-7-high.md +1 -1
  46. package/templates/agents/orc-executor-opus-4-7-med.md +1 -1
  47. package/templates/agents/orc-executor-opus-4-8-high.md +1 -1
  48. package/templates/agents/orc-executor-opus-5-high.md +1 -1
  49. package/templates/agents/orc-executor-opus-5-low.md +1 -1
  50. package/templates/agents/orc-executor-opus-5-med.md +1 -1
  51. package/templates/agents/orc-retro-opus-5-med.md +73 -73
  52. package/templates/agents/orc-retro-sonnet-5-high.md +72 -72
  53. package/templates/agents/orc-trace-writer-haiku-4-5.md +107 -107
  54. package/templates/commands/orc-route.md +1 -1
  55. package/templates/commands/orc-wait.md +19 -0
  56. package/templates/commands/orc.md +1 -1
  57. package/templates/hooks/orc-statusline.js +39 -0
  58. package/templates/skills/_shared/README.md +7 -3
  59. package/templates/skills/_shared/config-precedence.md +198 -0
  60. package/templates/skills/_shared/drift-recovery.md +1 -1
  61. package/templates/skills/_shared/extra-dispatch.md +159 -7
  62. package/templates/skills/_shared/interview.md +1 -1
  63. package/templates/skills/_shared/opus5-only.md +9 -7
  64. package/templates/skills/_shared/phases/README.md +82 -0
  65. package/templates/skills/{orc/references → _shared/phases}/analyst-gates.md +15 -3
  66. package/templates/skills/_shared/phases/execution.md +143 -0
  67. package/templates/skills/{orc/references → _shared/phases}/house-rules.md +13 -1
  68. package/templates/skills/{orc/references → _shared/phases}/intake.md +15 -2
  69. package/templates/skills/_shared/phases/mock-example.md +56 -0
  70. package/templates/skills/{orc/references → _shared/phases}/plan-handoff.md +16 -3
  71. package/templates/skills/_shared/phases/planning.md +135 -0
  72. package/templates/skills/_shared/phases/preflight.md +98 -0
  73. package/templates/skills/_shared/phases/review.md +53 -0
  74. package/templates/skills/_shared/phases/scoring.md +65 -0
  75. package/templates/skills/{orc/references → _shared/phases}/security-checklist.md +12 -1
  76. package/templates/skills/_shared/phases/security.md +55 -0
  77. package/templates/skills/_shared/phases/ship.md +88 -0
  78. package/templates/skills/{orc/references/stop-and-resume.md → _shared/phases/stop-resume.md} +169 -160
  79. package/templates/skills/_shared/phases/summary.md +48 -0
  80. package/templates/skills/_shared/phases/testgen.md +51 -0
  81. package/templates/skills/{orc/references/trace-protocol.md → _shared/phases/trace.md} +49 -6
  82. package/templates/skills/_shared/phases/verify.md +70 -0
  83. package/templates/skills/{orc/references → _shared/phases}/wave-grouping.md +14 -2
  84. package/templates/skills/{orc/references → _shared/phases}/wiki-consult.md +13 -1
  85. package/templates/skills/_shared/read-ladder.md +48 -0
  86. package/templates/skills/_shared/wait.md +240 -0
  87. package/templates/skills/context-combiner/SKILL.md +214 -187
  88. package/templates/skills/orc/README.md +148 -150
  89. package/templates/skills/orc/SKILL.md +75 -358
  90. package/templates/skills/orc/config.md +137 -389
  91. package/templates/skills/orc/examples/full-run-mock.md +1 -1
  92. package/templates/skills/orc/references/effort-and-mode.md +16 -18
  93. package/templates/skills/orc/references/phases/intake.md +47 -0
  94. package/templates/skills/orc/references/phases/integration.md +19 -0
  95. package/templates/skills/orc/references/preflight-report.md +4 -4
  96. package/templates/skills/orc/references/ultra-mode.md +117 -123
  97. package/templates/skills/orc/schemas/planning-output.md +279 -279
  98. package/templates/skills/orc/subskills/orc-planner/SKILL.md +260 -264
  99. package/templates/skills/orc/subskills/orc-pr/stack-gate.md +4 -1
  100. package/templates/skills/orc-aftermath/SKILL.md +158 -136
  101. package/templates/skills/orc-analyze/SKILL.md +252 -220
  102. package/templates/skills/orc-analyze/references/branching.md +51 -51
  103. package/templates/skills/orc-analyze/references/thin-input.md +1 -1
  104. package/templates/skills/orc-analyze-mini/SKILL.md +128 -112
  105. package/templates/skills/orc-boundary/SKILL.md +249 -208
  106. package/templates/skills/orc-brainstorm/SKILL.md +377 -339
  107. package/templates/skills/orc-budget/SKILL.md +248 -225
  108. package/templates/skills/orc-challenge/README.md +1 -1
  109. package/templates/skills/orc-challenge/SKILL.md +298 -255
  110. package/templates/skills/orc-challenge/examples/council-full-roster.md +1 -1
  111. package/templates/skills/orc-claude/SKILL.md +221 -199
  112. package/templates/skills/orc-diy/README.md +2 -1
  113. package/templates/skills/orc-diy/SKILL.md +132 -68
  114. package/templates/skills/orc-diy/references/blocks/analyze.md +1 -1
  115. package/templates/skills/orc-diy/references/compile.md +21 -7
  116. package/templates/skills/orc-diy/references/flow-schema.md +2 -2
  117. package/templates/skills/orc-doc/SKILL.md +49 -7
  118. package/templates/skills/orc-explain/SKILL.md +24 -0
  119. package/templates/skills/orc-export/SKILL.md +31 -5
  120. package/templates/skills/orc-fast/SKILL.md +218 -185
  121. package/templates/skills/orc-grill/SKILL.md +238 -207
  122. package/templates/skills/orc-handoff/SKILL.md +223 -204
  123. package/templates/skills/orc-learn/SKILL.md +181 -156
  124. package/templates/skills/orc-mini/SKILL.md +47 -24
  125. package/templates/skills/orc-pact/SKILL.md +255 -218
  126. package/templates/skills/orc-pattern/SKILL.md +154 -124
  127. package/templates/skills/orc-poly/SKILL.md +242 -216
  128. package/templates/skills/orc-poly/references/gather.md +1 -1
  129. package/templates/skills/orc-pr-driver/SKILL.md +196 -167
  130. package/templates/skills/orc-pr-driver/references/orc-run-split.md +1 -1
  131. package/templates/skills/orc-pr-setup/SKILL.md +212 -184
  132. package/templates/skills/orc-quick/README.md +2 -2
  133. package/templates/skills/orc-quick/SKILL.md +51 -13
  134. package/templates/skills/orc-quick/references/dispatch-gate.md +2 -3
  135. package/templates/skills/orc-retro/SKILL.md +249 -222
  136. package/templates/skills/orc-retro/examples/retro-mock.md +171 -171
  137. package/templates/skills/orc-route/SKILL.md +188 -165
  138. package/templates/skills/orc-verify/SKILL.md +103 -84
  139. package/templates/skills/orc-wait/SKILL.md +163 -0
  140. package/templates/skills/orc-wiki/SKILL.md +60 -206
  141. package/templates/skills/orc-wiki/references/phases/phase-0.md +71 -0
  142. package/templates/skills/orc-wiki/references/phases/phase-1.md +35 -0
  143. package/templates/skills/orc-wiki/references/phases/phase-2.md +52 -0
  144. package/templates/skills/orc-wiki/references/phases/phase-3.md +57 -0
  145. package/templates/skills/orc-wiki/references/phases/phase-3c.md +36 -0
  146. package/templates/agents/orc-advisor-fable-5.md +0 -50
  147. package/templates/agents/orc-analyst-fable-5.md +0 -115
  148. package/templates/agents/orc-judge-fable-5.md +0 -79
  149. package/templates/agents/orc-planner-fable-5.md +0 -152
  150. package/templates/agents/orc-reviewer-fable-5.md +0 -57
  151. package/templates/skills/_shared/fable5-override.md +0 -56
  152. package/templates/skills/orc-diy/references/blocks/execution.md +0 -42
  153. package/templates/skills/orc-diy/references/blocks/mock-example.md +0 -22
  154. package/templates/skills/orc-diy/references/blocks/planning.md +0 -34
  155. package/templates/skills/orc-diy/references/blocks/review.md +0 -18
  156. package/templates/skills/orc-diy/references/blocks/scoring.md +0 -16
  157. package/templates/skills/orc-diy/references/blocks/security.md +0 -25
  158. package/templates/skills/orc-diy/references/blocks/ship.md +0 -25
  159. package/templates/skills/orc-diy/references/blocks/summary.md +0 -18
  160. package/templates/skills/orc-diy/references/blocks/testgen.md +0 -17
  161. package/templates/skills/orc-diy/references/blocks/trace.md +0 -28
  162. package/templates/skills/orc-diy/references/blocks/verify.md +0 -25
@@ -1,199 +1,221 @@
1
- ---
2
- name: orc-claude
3
- description: >
4
- CLAUDE.md builder/updater for the LOCAL project. Use for "/orc-claude",
5
- "build a CLAUDE.md", "update the CLAUDE.md", or "refresh the CLAUDE.md".
6
- Runs INDEPENDENTLY — no orchestrator, no run folder. Scans the repo for
7
- ground-truth facts (verified commands, layout, conventions, boundaries) and
8
- writes a section-fenced, version-stamped CLAUDE.md at the repo root — even
9
- when ORC itself is installed globally. Never asks questions: P0 rules are a
10
- template the user fills in themself. Refresh regenerates ONLY stale sections
11
- and bumps the file version by 0.0.1. Never trims user-authored content;
12
- never touches the orc-wiki pointer block. The skill dispatches the pinned
13
- orc-claude-writer-opus-4-8-high agent — it never writes the file itself.
14
- ---
15
-
16
- # ORC-CLAUDE (standalone)
17
-
18
- Build or maintain the **local project's** `CLAUDE.md` from verified repo facts.
19
- The target is ALWAYS `<repo root>/CLAUDE.md` of the current working directory —
20
- never `~/.claude/CLAUDE.md`, even if ORC is installed globally.
21
-
22
- **Dispatch, don't do.** Whatever model this chat runs on, the skill itself only
23
- selects the mode and spawns `orc-claude-writer-opus-4-8-high` (the pinned
24
- engine) — so the scan + writing always run at Opus 4.8 high regardless of the
25
- caller's tier. When `opus5_only: true` the engine is
26
- `orc-claude-writer-opus-5-med` instead (that mode FORCES it — see
27
- `../_shared/opus5-only.md`), and it then needs an Opus 5 main session.
28
- The one exception: the skill also writes the
29
- trace pointer + a few markers around that spawn (behavior-trace logging is
30
- permanent; see "Behavior trace"); that
31
- tracing is its ONLY self-write — the `CLAUDE.md` write is always the writer's.
32
- **Fully non-interactive: ask the user NOTHING.** No AskUserQuestion, no
33
- confirmation prompts. Dispatch, relay the report, stop.
34
-
35
- **Worked example** (orient only — never execute from it):
36
- `examples/claude-run-mock.md`.
37
-
38
- ## The three modes (auto-selected, in this order)
39
-
40
- 1. **REFRESH** — `CLAUDE.md` exists AND contains an `orc-claude:meta` header.
41
- Recompute section fingerprints; regenerate ONLY stale fenced sections;
42
- bump `version` by exactly 0.0.1; update `updated:` (DD-MM-YYYY). Nothing
43
- stale → report "up to date (vX.Y.Z)" and write NOTHING (no bump, no bak).
44
- Protocol: `references/refresh.md`.
45
- 2. **UPDATE** — `CLAUDE.md` exists but has NO `orc-claude:meta` header (a
46
- foreign / hand-written file). Copy it to `CLAUDE.md.bak` first (one bak,
47
- overwritten each run; offer a `.gitignore` line for it in the report). Then
48
- inject the meta header at the top and append/merge fenced generated
49
- sections at version `0.0.1`.
50
- **NEVER trim, delete, reorder, or rewrite existing user content — not one
51
- line.** If a generated section would duplicate what the user already wrote,
52
- generate the slimmer remainder or skip that section. The merged file MAY
53
- exceed the budget (e.g. 600 existing lines + generated → 800): that is OK
54
- by design — end the report with a hard note that the user should trim
55
- unused content themself for better instruction-following.
56
- 3. **CREATE** — no `CLAUDE.md` at the repo root. Generate a fresh one from
57
- `references/template.md` at version `0.0.1`.
58
-
59
- Not inside a git repo / no project root findable → say so and stop.
60
-
61
- ## Dispatch (the skill's only real job)
62
-
63
- Behavior-trace logging is permanent (always on). Weave the **Trace:** steps below
64
- into the procedure — this skill owns a minimal one-dispatch trace (full marker
65
- set in "Behavior trace").
66
-
67
- 1. Detect the repo root and pick the mode (REFRESH / UPDATE / CREATE above —
68
- header sniff only; the writer re-verifies). **Trace:** open the run now —
69
- write `log_dir/.current` = `run-claude-<slug>-<DDMMYY>-<HHMMSS>.txt` and
70
- `touch the trace file` of that name in the SAME step, BEFORE the spawn (a
71
- pointer to a file that does not exist reads as dangling — the hook rotates
72
- away from it and the run splits across two files).
73
- 2. Spawn `orc-claude-writer-opus-4-8-high` — or `orc-claude-writer-opus-5-med`
74
- when `opus5_only` — with: `mode`, `repo_root`,
75
- `budget` (from a `budget=N` argument, else null), and the paths to
76
- `references/template.md` + `references/refresh.md`. **Trace:** emit
77
- `DISPATCH orc-claude-writer :: <mode> expect=opus-4-8/high` just before the
78
- spawn (`expect=opus-5/medium` under `opus5_only` — the expectation is
79
- derived from the agent NAME you actually dispatched, never from this line's
80
- default; the hook then adds `SPAWN`/`RETURN` on its own).
81
- 3. On return, check `actual_model`/`actual_effort` against the pinned tier —
82
- mismatch → prepend a tier-downgrade warning to the report. **Trace:** emit
83
- `VERIFY writer actual=<model>/<effort> ✅ MATCH` (or
84
- `⛔ DOWNGRADE expected=opus-4-8/high`).
85
- 4. Relay the Phase-3 report verbatim. **Trace:** emit
86
- `FINISH :: <mode_ran> CLAUDE.md v<X.Y.Z>` (mode_ran may be `noop`), then
87
- delete `log_dir/.current`. Then stop. The skill NEVER writes CLAUDE.md
88
- itself — not even in a "trivial" refresh.
89
-
90
- The writer performs Phases 1–3 below.
91
-
92
- ## Phase 1 — ground-truth scan (facts, never guesses)
93
-
94
- Read-only. Detect from real files, never from memory:
95
-
96
- - **Stack & manifests:** `package.json`, `pyproject.toml`, `go.mod`,
97
- `Cargo.toml`, `pom.xml`/`build.gradle`, `*.csproj`, `composer.json`,
98
- `Gemfile`, `mix.exs` Monorepo? (workspaces, `pnpm-workspace.yaml`,
99
- `turbo.json`, `nx.json`, multiple manifests).
100
- - **Commands:** only invocations that PROVABLY exist a script in a manifest,
101
- a Makefile/Taskfile target, a CI step. Prefer the single-test form when the
102
- runner supports one. **Never invent a command.** Unverifiable omit.
103
- - **Conventions:** lint/format/type configs (eslint, prettier, biome, ruff,
104
- black, clippy, tsconfig strictness…) + a small sample of real source files.
105
- Record only DEVIATIONS from language defaults.
106
- - **Boundaries:** generated/vendored/build dirs (from `.gitignore` + tree),
107
- lockfiles, migration dirs, obvious legacy zones.
108
- - **Environment:** env-var NAMES referenced in code/config/`.env.example`
109
- (never values), external services.
110
-
111
- ## Phase 2 generate / merge
112
-
113
- Follow `references/template.md` exactly: the meta header, the section order
114
- (Zone A rules Zone B reference), and the fence grammar. Every generated
115
- section sits inside `<!-- orc-claude:section <name> -->` …
116
- `<!-- /orc-claude:section -->` fences so refresh can replace it surgically.
117
- Sections whose scan came back empty are OMITTED, not stubbed.
118
-
119
- **P0 is user-authored, always.** Emit the P0 placeholder template from
120
- `references/template.md` with its hard fill-it-yourself note. Never invent P0
121
- rules, never ask for them. Same for the other `@user` sections (Boundaries'
122
- user half, Gotchas, Glossary): placeholder + note, then leave.
123
-
124
- **Line budget generated content only.** Default 400 lines, persisted as
125
- `line-budget:` in the meta header. The budget counts ONLY orc-claude's own
126
- output (header + fenced sections) — existing user content NEVER counts against
127
- it and is NEVER trimmed to meet it. If generation would exceed the budget,
128
- trim Zone B first: move overflow to a `docs/` file and leave an `@docs/...`
129
- pointer. Zone A is never cut. The user may pass a different budget as an
130
- argument (`/orc-claude budget=600`) honor it and persist it in the header.
131
-
132
- **Wiki block is untouchable.** If the file contains an `ORC-WIKI:START` /
133
- `ORC-WIKI:END` block (managed by orc-wiki), byte-preserve it and generate no
134
- wiki-overlapping content. orc-claude never writes inside another skill's
135
- markers.
136
-
137
- ## Phase 3 report
138
-
139
- Show a short summary and STOP:
140
-
141
- ```
142
- ORC-CLAUDE <create|update|refresh> CLAUDE.md v<X.Y.Z> (<DD-MM-YYYY>)
143
- Sections written: <list> · skipped (empty scan): <list>
144
- Sections stale→refreshed: <list> (refresh mode only)
145
- Preserved untouched: user content (<n> lines), wiki block
146
- Conflicts flagged (scan contradicts existing text — NOT auto-edited):
147
- - <file says X, repo shows Y>
148
- Backup: CLAUDE.md.bak <written|not needed> (add it to .gitignore)
149
- NOTE: file is <n> lines total (budget covers generated content only) — trim
150
- unused user content yourself for better instruction-following.
151
- Fill in the P0 / Gotchas / Glossary placeholders yourself — orc-claude never
152
- writes them for you.
153
- ```
154
-
155
- ## Behavior trace (PERMANENT a minimal one-dispatch orchestrator; always on)
156
-
157
- orc-claude owns the trace protocol for its run exactly
158
- like the full orchestrator but it is a SINGLE-DISPATCH lane, so it emits ONLY
159
- the markers it can truthfully witness. It does **not** emit `PHASE`/`SCORE`/
160
- `FINDING`/`VERDICT`: the scan/generate/report phases run INSIDE the writer
161
- sub-agent (which self-traces nothing — it only returns `actual_model`/
162
- `actual_effort`), and there is no scoring or review in this lane. Resolve
163
- `log_dir` (`../orc/config.md` default + `.claude/orc.config.yaml`)
164
- at start and follow `../orc/references/trace-protocol.md`. The marker set, in
165
- order (all under actor `orc`, plus the hook's `SPAWN`/`RETURN`):
166
-
167
- 1. `log_dir/.current` = `run-claude-<slug>-<DDMMYY>-<HHMMSS>.txt` written FIRST
168
- (the hook also bootstraps it on the writer dispatch, so the skeleton is never
169
- lost, and the end-of-run packet renames a bootstrapped file).
170
- 2. `DISPATCH orc-claude-writer :: <mode> expect=opus-4-8/high` before the
171
- spawn. The hook then appends `SPAWN`/`RETURN` around the dispatch. The mode
172
- rides in this line's tail (and in `FINISH`), so no separate mode marker.
173
- 3. `VERIFY writer actual=<model>/<effort> ✅ MATCH` or
174
- `⛔ DOWNGRADE expected=opus-4-8/high` from the writer's returned
175
- `actual_model`/`actual_effort` (the one honesty signal this lane feeds
176
- `/orc-retro`).
177
- 4. `FINISH :: <mode_ran> CLAUDE.md v<X.Y.Z>` (mode_ran may be `noop`), then
178
- delete `.current`.
179
-
180
- Narration is **dispatched, never remembered**: record each marker with its REAL
181
- timestamp as its event happens, then as a single-dispatch lane — dispatch the
182
- trace writer ONCE with the whole event list plus `decisions` (the WHY: mode
183
- choice, what the user asked) after the writer return validates and BEFORE you
184
- delete `.current`. Stamps are the run's timeline, never the write time, and a run
185
- that ends with zero new trace lines is a protocol violation. A noop refresh still
186
- traces the full cycle (ending `FINISH :: noop`) and still deletes `.current`.
187
-
188
- ## Boundaries
189
-
190
- - **Writes ONLY** `CLAUDE.md`, `CLAUDE.md.bak`, and (on budget overflow) a
191
- `docs/` overflow file. Never edits source code, never commits, never pushes.
192
- - **Never asks the user anything.** Placeholders + report notes replace every
193
- question.
194
- - **Never deletes or rewrites user-authored lines** — contradictions are
195
- flagged in the report, not fixed.
196
- - **Never touches** the orc-wiki managed block or any other skill's markers.
197
- - Version bumps are always exactly +0.0.1; dates are always DD-MM-YYYY.
198
- - Reminder: to see usage limits, tell the user to run `/usage` (never invoke
199
- it programmatically).
1
+ ---
2
+ name: orc-claude
3
+ description: >
4
+ CLAUDE.md builder/updater for the LOCAL project. Use for "/orc-claude",
5
+ "build a CLAUDE.md", "update the CLAUDE.md", or "refresh the CLAUDE.md".
6
+ Runs INDEPENDENTLY — no orchestrator, no run folder. Scans the repo for
7
+ ground-truth facts (verified commands, layout, conventions, boundaries) and
8
+ writes a section-fenced, version-stamped CLAUDE.md at the repo root — even
9
+ when ORC itself is installed globally. Never asks questions: P0 rules are a
10
+ template the user fills in themself. Refresh regenerates ONLY stale sections
11
+ and bumps the file version by 0.0.1. Never trims user-authored content;
12
+ never touches the orc-wiki pointer block. The skill dispatches the pinned
13
+ orc-claude-writer-opus-4-8-high agent — it never writes the file itself.
14
+ ---
15
+
16
+ # ORC-CLAUDE (standalone)
17
+
18
+ Build or maintain the **local project's** `CLAUDE.md` from verified repo facts.
19
+ The target is ALWAYS `<repo root>/CLAUDE.md` of the current working directory —
20
+ never `~/.claude/CLAUDE.md`, even if ORC is installed globally.
21
+
22
+ **Dispatch, don't do.** Whatever model this chat runs on, the skill itself only
23
+ selects the mode and spawns `orc-claude-writer-opus-4-8-high` (the pinned
24
+ engine) — so the scan + writing always run at Opus 4.8 high regardless of the
25
+ caller's tier. When `opus5_only: true` the engine is
26
+ `orc-claude-writer-opus-5-med` instead (that mode FORCES it — see
27
+ `../_shared/opus5-only.md`), and it then needs an Opus 5 main session.
28
+ The one exception: the skill also writes the
29
+ trace pointer + a few markers around that spawn (behavior-trace logging is
30
+ permanent; see "Behavior trace"); that
31
+ tracing is its ONLY self-write — the `CLAUDE.md` write is always the writer's.
32
+ **Fully non-interactive: ask the user NOTHING.** No AskUserQuestion, no
33
+ confirmation prompts. Dispatch, relay the report, stop.
34
+
35
+ **Worked example** (orient only — never execute from it):
36
+ `examples/claude-run-mock.md`.
37
+
38
+ ## The three modes (auto-selected, in this order)
39
+
40
+ 1. **REFRESH** — `CLAUDE.md` exists AND contains an `orc-claude:meta` header.
41
+ Recompute section fingerprints; regenerate ONLY stale fenced sections;
42
+ bump `version` by exactly 0.0.1; update `updated:` (DD-MM-YYYY). Nothing
43
+ stale → report "up to date (vX.Y.Z)" and write NOTHING (no bump, no bak).
44
+ Protocol: `references/refresh.md`.
45
+ 2. **UPDATE** — `CLAUDE.md` exists but has NO `orc-claude:meta` header (a
46
+ foreign / hand-written file). Copy it to `CLAUDE.md.bak` first (one bak,
47
+ overwritten each run; offer a `.gitignore` line for it in the report). Then
48
+ inject the meta header at the top and append/merge fenced generated
49
+ sections at version `0.0.1`.
50
+ **NEVER trim, delete, reorder, or rewrite existing user content — not one
51
+ line.** If a generated section would duplicate what the user already wrote,
52
+ generate the slimmer remainder or skip that section. The merged file MAY
53
+ exceed the budget (e.g. 600 existing lines + generated → 800): that is OK
54
+ by design — end the report with a hard note that the user should trim
55
+ unused content themself for better instruction-following.
56
+ 3. **CREATE** — no `CLAUDE.md` at the repo root. Generate a fresh one from
57
+ `references/template.md` at version `0.0.1`.
58
+
59
+ Not inside a git repo / no project root findable → say so and stop.
60
+
61
+ ## Dispatch (the skill's only real job)
62
+
63
+ Behavior-trace logging is permanent (always on). Weave the **Trace:** steps below
64
+ into the procedure — this skill owns a minimal one-dispatch trace (full marker
65
+ set in "Behavior trace").
66
+
67
+ 1. Detect the repo root and pick the mode (REFRESH / UPDATE / CREATE above —
68
+ header sniff only; the writer re-verifies). **Trace:** open the run now —
69
+ write `log_dir/.current` = `run-claude-<slug>-<DDMMYY>-<HHMMSS>.txt` and
70
+ `touch the trace file` of that name in the SAME step, BEFORE the spawn (a
71
+ pointer to a file that does not exist reads as dangling — the hook rotates
72
+ away from it and the run splits across two files).
73
+ 2. Spawn `orc-claude-writer-opus-4-8-high` — or `orc-claude-writer-opus-5-med`
74
+ when `opus5_only` — with: `mode`, `repo_root`,
75
+ `budget` (from a `budget=N` argument, else null), and the paths to
76
+ `references/template.md` + `references/refresh.md`. **Trace:** emit
77
+ `DISPATCH orc-claude-writer :: <mode> expect=opus-4-8/high` just before the
78
+ spawn (`expect=opus-5/medium` under `opus5_only` — the expectation is
79
+ derived from the agent NAME you actually dispatched, never from this line's
80
+ default; the hook then adds `SPAWN`/`RETURN` on its own).
81
+ 3. On return, check `actual_model`/`actual_effort` against the pinned tier —
82
+ mismatch → prepend a tier-downgrade warning to the report. **Trace:** emit
83
+ `VERIFY writer actual=<model>/<effort> ✅ MATCH` (or
84
+ `⛔ DOWNGRADE expected=opus-4-8/high`).
85
+ 4. Relay the Phase-3 report verbatim. **Trace:** emit
86
+ `FINISH :: <mode_ran> CLAUDE.md v<X.Y.Z>` (mode_ran may be `noop`), then
87
+ delete `log_dir/.current`. Then stop. The skill NEVER writes CLAUDE.md
88
+ itself — not even in a "trivial" refresh.
89
+
90
+ The writer performs Phases 1–3 below.
91
+
92
+ ## Phases
93
+
94
+ `orc lane phases orc-claude --json` is this lane's pipeline: the ordered list, where
95
+ each phase lives, and how much of it to read. **The CLI owns the order** — never
96
+ derive it from the headings below, and never renumber or rename one without the
97
+ manifest, because a `read: section` pointer names a HEADING and a renamed heading
98
+ is a pointer into nothing.
99
+
100
+ ## Phase 1ground-truth scan (facts, never guesses)
101
+
102
+ Read-only. Detect from real files, never from memory:
103
+
104
+ - **Stack & manifests:** `package.json`, `pyproject.toml`, `go.mod`,
105
+ `Cargo.toml`, `pom.xml`/`build.gradle`, `*.csproj`, `composer.json`,
106
+ `Gemfile`, `mix.exs` Monorepo? (workspaces, `pnpm-workspace.yaml`,
107
+ `turbo.json`, `nx.json`, multiple manifests).
108
+ - **Commands:** only invocations that PROVABLY exist — a script in a manifest,
109
+ a Makefile/Taskfile target, a CI step. Prefer the single-test form when the
110
+ runner supports one. **Never invent a command.** Unverifiable → omit.
111
+ - **Conventions:** lint/format/type configs (eslint, prettier, biome, ruff,
112
+ black, clippy, tsconfig strictness…) + a small sample of real source files.
113
+ Record only DEVIATIONS from language defaults.
114
+ - **Boundaries:** generated/vendored/build dirs (from `.gitignore` + tree),
115
+ lockfiles, migration dirs, obvious legacy zones.
116
+ - **Environment:** env-var NAMES referenced in code/config/`.env.example`
117
+ (never values), external services.
118
+
119
+ ## Phase 2 generate / merge
120
+
121
+ Follow `references/template.md` exactly: the meta header, the section order
122
+ (Zone A rules Zone B reference), and the fence grammar. Every generated
123
+ section sits inside `<!-- orc-claude:section <name> -->` …
124
+ `<!-- /orc-claude:section -->` fences so refresh can replace it surgically.
125
+ Sections whose scan came back empty are OMITTED, not stubbed.
126
+
127
+ **P0 is user-authored, always.** Emit the P0 placeholder template from
128
+ `references/template.md` with its hard fill-it-yourself note. Never invent P0
129
+ rules, never ask for them. Same for the other `@user` sections (Boundaries'
130
+ user half, Gotchas, Glossary): placeholder + note, then leave.
131
+
132
+ **Line budget generated content only.** Default 400 lines, persisted as
133
+ `line-budget:` in the meta header. The budget counts ONLY orc-claude's own
134
+ output (header + fenced sections) existing user content NEVER counts against
135
+ it and is NEVER trimmed to meet it. If generation would exceed the budget,
136
+ trim Zone B first: move overflow to a `docs/` file and leave an `@docs/...`
137
+ pointer. Zone A is never cut. The user may pass a different budget as an
138
+ argument (`/orc-claude budget=600`) — honor it and persist it in the header.
139
+
140
+ **Wiki block is untouchable.** If the file contains an `ORC-WIKI:START` /
141
+ `ORC-WIKI:END` block (managed by orc-wiki), byte-preserve it and generate no
142
+ wiki-overlapping content. orc-claude never writes inside another skill's
143
+ markers.
144
+
145
+ ## Phase 3 report
146
+
147
+ Show a short summary and STOP:
148
+
149
+ ```
150
+ ORC-CLAUDE <create|update|refresh> CLAUDE.md v<X.Y.Z> (<DD-MM-YYYY>)
151
+ Sections written: <list> · skipped (empty scan): <list>
152
+ Sections stale→refreshed: <list> (refresh mode only)
153
+ Preserved untouched: user content (<n> lines), wiki block
154
+ Conflicts flagged (scan contradicts existing text — NOT auto-edited):
155
+ - <file says X, repo shows Y>
156
+ Backup: CLAUDE.md.bak <written|not needed> (add it to .gitignore)
157
+ NOTE: file is <n> lines total (budget covers generated content only) — trim
158
+ unused user content yourself for better instruction-following.
159
+ Fill in the P0 / Gotchas / Glossary placeholders yourself orc-claude never
160
+ writes them for you.
161
+ ```
162
+
163
+ ## Behavior trace (always on)
164
+
165
+ `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names
166
+ the file and the layers). Lane token `claude`, tier **Single-dispatch** —
167
+ exactly ONE end-of-run packet, dispatched solo after the writer return
168
+ validates and BEFORE `.current` is deleted.
169
+ At run start write `log_dir/.current` = `run-claude-<slug>-<DDMMYY>-<HHMMSS>.txt` AND
170
+ `touch the trace file` of that name in the SAME step.
171
+ Nothing else about the protocol is restated here; a phase that ends with
172
+ `zero new trace lines is a protocol violation`.
173
+
174
+ Dispatch-only lane: emit ONLY the markers it can truthfully witness — **not**
175
+ `PHASE`/`SCORE`/`FINDING`/`VERDICT`, because scan/generate/report run INSIDE
176
+ the writer sub-agent and there is no scoring or review here. The marker set, in
177
+ order (actor `orc`, plus the hook's `SPAWN`/`RETURN`): `DISPATCH
178
+ orc-claude-writer :: <mode> expect=opus-4-8/high` before the spawn (the mode
179
+ rides in this tail and in `FINISH`, so no separate mode marker) · `VERIFY writer
180
+ actual=<model>/<effort>` · `FINISH :: <mode_ran> CLAUDE.md v<X.Y.Z>`, where
181
+ `mode_ran` may be `noop`. A noop refresh still traces the full cycle.
182
+
183
+ ## Boundaries
184
+
185
+ - **Writes ONLY** `CLAUDE.md`, `CLAUDE.md.bak`, and (on budget overflow) a
186
+ `docs/` overflow file. Never edits source code, never commits, never pushes.
187
+ - **Never asks the user anything.** Placeholders + report notes replace every
188
+ question.
189
+ - **Never deletes or rewrites user-authored lines** — contradictions are
190
+ flagged in the report, not fixed.
191
+ - **Never touches** the orc-wiki managed block or any other skill's markers.
192
+ - Version bumps are always exactly +0.0.1; dates are always DD-MM-YYYY.
193
+ - Reminder: to see usage limits, tell the user to run `/usage` (never invoke
194
+ it programmatically).
195
+
196
+ ## Config
197
+
198
+ **ONE resolver, and it is not you:** `orc lane config orc-claude --json`. Obey
199
+ `effective`, print every line in `announce[]` VERBATIM at preflight, and honour
200
+ `stops[]` before wave 1. Never re-derive a value, a precedence or an inertness
201
+ from `.claude/orc.config.yaml` — a key this lane does not read is not in the
202
+ answer, and a key another key shadows comes back already marked. Exit ≠ 0 → say
203
+ the CLI is unavailable and fall back to `../_shared/config-precedence.md`'s
204
+ documented defaults, out loud. Priorities and families:
205
+ `../_shared/config-precedence.md`.
206
+
207
+ ## Calls
208
+
209
+ **ONE catalogue, and it is not you:** `orc lane calls orc-claude --json` names every
210
+ CLI call this lane makes, each with its exit-code contract, its cost, when to run
211
+ it, and what an EMPTY answer means. Never invent a spelling, never re-word an
212
+ exit code, and never re-derive a state word — the CLI's state words are the only
213
+ state words, and **an exit code is an ANSWER wherever that contract says so, not
214
+ a failure**. A call the answer does not name is a call this lane does not make.
215
+ Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
216
+ command you are about to run, out loud, before running it.
217
+
218
+ ## Waiting mid-run (`/orc-wait`)
219
+
220
+ Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
221
+ Checkpoint **none** · safe point **single dispatch**. Nothing here to checkpoint, so all three modes behave identically — say so rather than asking. Never begin a wait between a dispatch and its validated return, or before the smoke gate has reported.
@@ -68,7 +68,8 @@ The full key table lives in `references/flow-schema.md`. Highlights:
68
68
  full grid: `sonnet-4-6-{med,high}`, `opus-4-7-{med,high}`,
69
69
  `opus-4-8-{med,high,xhigh,max}`, `opus-5-{med,high,xhigh,max}`,
70
70
  `fable-5-{med,high,xhigh,max}` (default
71
- `opus-4-8-high`). The effort guard enforces the effort half deterministically
71
+ `opus-5-high` D29 moved it there at v1.0.0 so the wizard's own default
72
+ does not clip the two Opus 5 bands the score table ships). The effort guard enforces the effort half deterministically
72
73
  (the compiled effort OR higher on the ladder); the statusline warns on the
73
74
  model half. Executor choices above the tier are rejected at validate time; the
74
75
  score table is clipped to the tier at compile time.