@azure-id/orc 0.56.1 → 1.0.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 (153) hide show
  1. package/CHANGELOG.md +2367 -2218
  2. package/README-id.md +49 -107
  3. package/README.md +45 -133
  4. package/bin/build-agents.js +18 -11
  5. package/bin/cli.js +33060 -29855
  6. package/bin/onboarding-content.js +0 -3
  7. package/bin/test-run.js +491 -0
  8. package/bin/verify-contracts.js +4256 -3277
  9. package/bin/verify-package.js +563 -498
  10. package/bin/webui/api.js +1186 -1163
  11. package/bin/webui/app.html +9 -0
  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/fixtures/extra.js +2036 -1934
  17. package/bin/webui/fixtures/flow.js +2 -2
  18. package/bin/webui/fixtures/index.js +503 -486
  19. package/bin/webui/fixtures/lanes.js +218 -0
  20. package/bin/webui/fixtures/settings.js +261 -34
  21. package/bin/webui/fixtures/stats.js +3 -3
  22. package/bin/webui/i18n/TERMS.md +135 -134
  23. package/bin/webui/i18n/en/extra.json +345 -313
  24. package/bin/webui/i18n/en/lanes.json +29 -0
  25. package/bin/webui/i18n/en/nav.json +1 -0
  26. package/bin/webui/i18n/en/overview.json +2 -0
  27. package/bin/webui/i18n/en/settings.json +16 -5
  28. package/bin/webui/i18n/id/extra.json +345 -313
  29. package/bin/webui/i18n/id/lanes.json +29 -0
  30. package/bin/webui/i18n/id/nav.json +1 -0
  31. package/bin/webui/i18n/id/overview.json +2 -0
  32. package/bin/webui/i18n/id/settings.json +15 -4
  33. package/bin/webui/js/01-i18n.js +1 -0
  34. package/bin/webui/js/panels/extra.js +3199 -3011
  35. package/bin/webui/js/panels/lanes.js +259 -0
  36. package/bin/webui/js/panels/overview.js +10 -0
  37. package/bin/webui/js/panels/settings.js +149 -3
  38. package/package.json +39 -39
  39. package/templates/agents/MODEL-MAPPING.md +23 -35
  40. package/templates/agents/orc-executor-opus-4-7-high.md +1 -1
  41. package/templates/agents/orc-executor-opus-4-7-med.md +1 -1
  42. package/templates/agents/orc-executor-opus-4-8-high.md +1 -1
  43. package/templates/agents/orc-executor-opus-5-high.md +1 -1
  44. package/templates/agents/orc-executor-opus-5-low.md +1 -1
  45. package/templates/agents/orc-executor-opus-5-med.md +1 -1
  46. package/templates/agents/orc-retro-opus-5-med.md +73 -73
  47. package/templates/agents/orc-retro-sonnet-5-high.md +72 -72
  48. package/templates/agents/orc-trace-writer-haiku-4-5.md +107 -107
  49. package/templates/commands/orc-route.md +1 -1
  50. package/templates/commands/orc.md +1 -1
  51. package/templates/skills/_shared/README.md +7 -3
  52. package/templates/skills/_shared/config-precedence.md +198 -0
  53. package/templates/skills/_shared/drift-recovery.md +1 -1
  54. package/templates/skills/_shared/extra-dispatch.md +159 -7
  55. package/templates/skills/_shared/interview.md +1 -1
  56. package/templates/skills/_shared/opus5-only.md +9 -7
  57. package/templates/skills/_shared/phases/README.md +82 -0
  58. package/templates/skills/{orc/references → _shared/phases}/analyst-gates.md +15 -3
  59. package/templates/skills/_shared/phases/execution.md +143 -0
  60. package/templates/skills/{orc/references → _shared/phases}/house-rules.md +13 -1
  61. package/templates/skills/{orc/references → _shared/phases}/intake.md +15 -2
  62. package/templates/skills/_shared/phases/mock-example.md +56 -0
  63. package/templates/skills/{orc/references → _shared/phases}/plan-handoff.md +16 -3
  64. package/templates/skills/_shared/phases/planning.md +135 -0
  65. package/templates/skills/_shared/phases/preflight.md +76 -0
  66. package/templates/skills/_shared/phases/review.md +53 -0
  67. package/templates/skills/_shared/phases/scoring.md +65 -0
  68. package/templates/skills/{orc/references → _shared/phases}/security-checklist.md +12 -1
  69. package/templates/skills/_shared/phases/security.md +55 -0
  70. package/templates/skills/_shared/phases/ship.md +88 -0
  71. package/templates/skills/{orc/references/stop-and-resume.md → _shared/phases/stop-resume.md} +169 -160
  72. package/templates/skills/_shared/phases/summary.md +48 -0
  73. package/templates/skills/_shared/phases/testgen.md +51 -0
  74. package/templates/skills/{orc/references/trace-protocol.md → _shared/phases/trace.md} +49 -6
  75. package/templates/skills/_shared/phases/verify.md +70 -0
  76. package/templates/skills/{orc/references → _shared/phases}/wave-grouping.md +14 -2
  77. package/templates/skills/{orc/references → _shared/phases}/wiki-consult.md +13 -1
  78. package/templates/skills/_shared/read-ladder.md +48 -0
  79. package/templates/skills/context-combiner/SKILL.md +214 -187
  80. package/templates/skills/orc/README.md +148 -150
  81. package/templates/skills/orc/SKILL.md +70 -358
  82. package/templates/skills/orc/config.md +137 -389
  83. package/templates/skills/orc/examples/full-run-mock.md +1 -1
  84. package/templates/skills/orc/references/effort-and-mode.md +16 -18
  85. package/templates/skills/orc/references/phases/intake.md +47 -0
  86. package/templates/skills/orc/references/phases/integration.md +19 -0
  87. package/templates/skills/orc/references/preflight-report.md +4 -4
  88. package/templates/skills/orc/references/ultra-mode.md +117 -123
  89. package/templates/skills/orc/schemas/planning-output.md +279 -279
  90. package/templates/skills/orc/subskills/orc-planner/SKILL.md +260 -264
  91. package/templates/skills/orc/subskills/orc-pr/stack-gate.md +4 -1
  92. package/templates/skills/orc-aftermath/SKILL.md +153 -136
  93. package/templates/skills/orc-analyze/SKILL.md +247 -220
  94. package/templates/skills/orc-analyze/references/branching.md +51 -51
  95. package/templates/skills/orc-analyze/references/thin-input.md +1 -1
  96. package/templates/skills/orc-analyze-mini/SKILL.md +128 -112
  97. package/templates/skills/orc-boundary/SKILL.md +244 -208
  98. package/templates/skills/orc-brainstorm/SKILL.md +372 -339
  99. package/templates/skills/orc-budget/SKILL.md +243 -225
  100. package/templates/skills/orc-challenge/README.md +1 -1
  101. package/templates/skills/orc-challenge/SKILL.md +293 -255
  102. package/templates/skills/orc-challenge/examples/council-full-roster.md +1 -1
  103. package/templates/skills/orc-claude/SKILL.md +216 -199
  104. package/templates/skills/orc-diy/README.md +2 -1
  105. package/templates/skills/orc-diy/SKILL.md +129 -70
  106. package/templates/skills/orc-diy/references/blocks/analyze.md +1 -1
  107. package/templates/skills/orc-diy/references/compile.md +21 -7
  108. package/templates/skills/orc-diy/references/flow-schema.md +2 -2
  109. package/templates/skills/orc-doc/SKILL.md +44 -7
  110. package/templates/skills/orc-explain/SKILL.md +19 -0
  111. package/templates/skills/orc-export/SKILL.md +26 -5
  112. package/templates/skills/orc-fast/SKILL.md +215 -187
  113. package/templates/skills/orc-grill/SKILL.md +233 -207
  114. package/templates/skills/orc-handoff/SKILL.md +223 -204
  115. package/templates/skills/orc-learn/SKILL.md +176 -156
  116. package/templates/skills/orc-mini/SKILL.md +41 -23
  117. package/templates/skills/orc-pact/SKILL.md +250 -218
  118. package/templates/skills/orc-pattern/SKILL.md +149 -124
  119. package/templates/skills/orc-poly/SKILL.md +237 -216
  120. package/templates/skills/orc-poly/references/gather.md +1 -1
  121. package/templates/skills/orc-pr-driver/SKILL.md +196 -167
  122. package/templates/skills/orc-pr-driver/references/orc-run-split.md +1 -1
  123. package/templates/skills/orc-pr-setup/SKILL.md +212 -184
  124. package/templates/skills/orc-quick/README.md +2 -2
  125. package/templates/skills/orc-quick/SKILL.md +45 -12
  126. package/templates/skills/orc-quick/references/dispatch-gate.md +2 -3
  127. package/templates/skills/orc-retro/SKILL.md +244 -222
  128. package/templates/skills/orc-retro/examples/retro-mock.md +171 -171
  129. package/templates/skills/orc-route/SKILL.md +183 -165
  130. package/templates/skills/orc-verify/SKILL.md +100 -86
  131. package/templates/skills/orc-wiki/SKILL.md +55 -206
  132. package/templates/skills/orc-wiki/references/phases/phase-0.md +71 -0
  133. package/templates/skills/orc-wiki/references/phases/phase-1.md +35 -0
  134. package/templates/skills/orc-wiki/references/phases/phase-2.md +52 -0
  135. package/templates/skills/orc-wiki/references/phases/phase-3.md +57 -0
  136. package/templates/skills/orc-wiki/references/phases/phase-3c.md +36 -0
  137. package/templates/agents/orc-advisor-fable-5.md +0 -50
  138. package/templates/agents/orc-analyst-fable-5.md +0 -115
  139. package/templates/agents/orc-judge-fable-5.md +0 -79
  140. package/templates/agents/orc-planner-fable-5.md +0 -152
  141. package/templates/agents/orc-reviewer-fable-5.md +0 -57
  142. package/templates/skills/_shared/fable5-override.md +0 -56
  143. package/templates/skills/orc-diy/references/blocks/execution.md +0 -42
  144. package/templates/skills/orc-diy/references/blocks/mock-example.md +0 -22
  145. package/templates/skills/orc-diy/references/blocks/planning.md +0 -34
  146. package/templates/skills/orc-diy/references/blocks/review.md +0 -18
  147. package/templates/skills/orc-diy/references/blocks/scoring.md +0 -16
  148. package/templates/skills/orc-diy/references/blocks/security.md +0 -25
  149. package/templates/skills/orc-diy/references/blocks/ship.md +0 -25
  150. package/templates/skills/orc-diy/references/blocks/summary.md +0 -18
  151. package/templates/skills/orc-diy/references/blocks/testgen.md +0 -17
  152. package/templates/skills/orc-diy/references/blocks/trace.md +0 -28
  153. package/templates/skills/orc-diy/references/blocks/verify.md +0 -25
@@ -1,156 +1,176 @@
1
- ---
2
- name: orc-learn
3
- description: >
4
- Per-feature onboarding docs for the LOCAL project. Use for "/orc-learn",
5
- "help me learn feature X", "onboard me to this feature", or "orc-learn
6
- refresh". Runs INDEPENDENTLY — no orchestrator, no run folder. Picks one
7
- feature (wiki topics first), then generates learning-docs/<feature>/ with
8
- learning.md (pedagogy: mental model, walkthrough, recipes, FAQ) and
9
- knowledge.md (reference: file:line-anchored functions & flow, contracts,
10
- fingerprints). Output is LOCAL and git-ignored — each dev regenerates their
11
- own. Refresh lists every generated feature with a computed freshness flag
12
- and regenerates only what the user picks. The skill dispatches the pinned
13
- orc-learn-writer-opus-5-low agent — it never writes the docs itself.
14
- ---
15
-
16
- # ORC-LEARN (standalone)
17
-
18
- Teach a developer ONE feature of the local repo well enough to safely extend
19
- it — the human-onboarding lane. It is NOT the wiki: the wiki grounds the
20
- *pipeline* (repo-wide, contract-level); orc-learn goes one level deeper for a
21
- *person* — function-level, full-flow, pedagogical. Target is always
22
- `<repo root>/learning-docs/<feature-slug>/` (git-ignored, local per dev).
23
-
24
- **Dispatch, don't do.** Whatever model this chat runs on, the skill only picks
25
- the topic/mode and spawns `orc-learn-writer-opus-5-low` (the pinned
26
- engine) — the deepening scan + all writes run at Opus 5 low regardless of
27
- the caller's tier. The skill's only self-writes are the behavior-trace
28
- markers around the spawn. Interactivity is DELIBERATELY minimal but non-zero
29
- (unlike orc-claude): exactly one question per mode — "which feature?" (INIT)
30
- or "which to refresh?" (REFRESH). Never more.
31
-
32
- **Grounding precedence** (constellation rule, unchanged):
33
- `code > fresh wiki > stale wiki (hints) > model priors`. The writer re-verifies
34
- every wiki claim it uses against the code; on conflict the code wins.
35
-
36
- **Worked example** (orient only — never execute from it):
37
- `examples/learn-run-mock.md`.
38
-
39
- ## The two modes (auto-selected by argument)
40
-
41
- 1. **INIT** (default: `/orc-learn`, optional `focus=<hint>`) — pick ONE
42
- feature, generate `learning-docs/<slug>/learning.md` + `knowledge.md`,
43
- derive `learning-docs/INDEX.md`.
44
- 2. **REFRESH** (`/orc-learn refresh`) — list every generated feature with a
45
- computed freshness flag; regenerate only the ones the user picks.
46
- Protocol: `references/refresh.md`.
47
-
48
- Not inside a git repo / no project root findable → say so and stop.
49
-
50
- ## Mode A — INIT
51
-
52
- Behavior-trace logging is permanent (always on). Resolve `log_dir`
53
- (`../orc/config.md` default + `.claude/orc.config.yaml`) at start and follow
54
- `../orc/references/trace-protocol.md`; the marker set is in "Behavior trace"
55
- below. Weave the **Trace:** steps in as each event happens.
56
-
57
- 1. **Topic pick (wiki-first).** Read `wiki/INDEX.md` +
58
- `.claude/orc/wiki-meta.json` and compute the freshness tier
59
- (`../orc-wiki/references/staleness.md` — computed on read, never stored).
60
- **Trace:** `WIKI-CONSULT tier=<FRESH|AGING|STALE|none> :: topic-pick`
61
- (emitted even when the wiki is absent, with `none`).
62
- - Wiki FRESH/AGING present its feature areas as a pick-list; the chosen
63
- area's `covers` globs seed the writer's file set.
64
- - No wiki / STALE / topic not covered → ask the user to point at the
65
- feature (a directory or a `focus=` hint); the writer will do a
66
- **targeted** scan of just those files — never repo-wide. A stale wiki
67
- doc may still ride along as hints (precedence above).
68
- - Ask which feature as ONE question (one feature per invoke). Derive
69
- `feature_slug` (kebab-case) from the chosen topic/area.
70
- 2. **Trace:** write `log_dir/.current` = `run-learn-<slug>-<DDMMYY>-<HHMMSS>.txt` and
71
- `touch the trace file` of that name in the SAME step, BEFORE the spawn (a
72
- pointer to a missing file reads as dangling and the hook rotates away).
73
- 3. Spawn `orc-learn-writer-opus-5-low` with: `mode=init`, `repo_root`,
74
- `feature_slug`, `topic_area`, `covers[]` (from wiki or user pointer),
75
- `wiki_tier`, `focus_hint|null`, and the paths to
76
- `references/deepen.md`, `references/template-learning.md`,
77
- `references/template-knowledge.md`. **Trace:**
78
- `DISPATCH orc-learn-writer :: init <slug> expect=opus-5/low` just
79
- before the spawn (the hook adds `SPAWN`/`RETURN` on its own).
80
- 4. On return, check `actual_model`/`actual_effort` against the pinned tier
81
- mismatch prepend a tier-downgrade warning to the report. **Trace:**
82
- `VERIFY writer actual=<model>/<effort> MATCH` (or
83
- `⛔ DOWNGRADE expected=opus-5/low`).
84
- 5. Relay the writer's report verbatim. If `learning-docs/` is not in
85
- `.gitignore`, offer the line (`learning-docs/`) — append only on an
86
- explicit yes; never edit silently. **Trace:** `FINISH :: init <slug>`,
87
- then delete `log_dir/.current`. Stop. The skill NEVER writes the docs
88
- itself not even a "trivial" INDEX touch.
89
-
90
- ## Mode B REFRESH
91
-
92
- 1. No `learning-docs/` (or no feature folders inside) → "nothing generated
93
- yet; run `/orc-learn` first." Stopno trace run needed.
94
- 2. Read every `learning-docs/<feature>/knowledge.md` fingerprint header
95
- (`source_commit` + per-file hashes) and compute FRESH/AGING/STALE per
96
- feature`references/refresh.md`. Freshness is computed on read, never
97
- stored as a status.
98
- 3. Present the FULL list, each with its computed flag; the user
99
- multi-selects which to regenerate (one question, multi-select). Nothing
100
- selected stop, no writes.
101
- 4. **Trace:** write `log_dir/.current` = `run-learn-<slug>-<DDMMYY>-<HHMMSS>.txt`. For each
102
- selected feature, spawn the writer with `mode=refresh` and that feature's
103
- slice (re-deepen just that feature; a FRESH/AGING wiki may again seed the
104
- boundaryemit one `WIKI-CONSULT tier=<tier> :: refresh` when the wiki is
105
- read). One `DISPATCH`/`VERIFY` pair per feature, same markers as INIT.
106
- 5. The (last) writer re-derives `learning-docs/INDEX.md` from all current
107
- feature headers. Relay the combined report. **Trace:**
108
- `FINISH :: refresh <n> features`, then delete `log_dir/.current`.
109
-
110
- ## Behavior trace (PERMANENT minimal dispatch-lane protocol; always on)
111
-
112
- orc-learn owns the trace for its run like every trace-owning lane, but it is
113
- a dispatch-only lane: it emits ONLY markers it can truthfully witness — no
114
- phase/score/finding/verdict markers (deepening and writing happen inside the
115
- writer, which self-traces nothing and only returns `actual_model`/
116
- `actual_effort`). The marker set, in order (actor `orc`, plus the hook's
117
- `SPAWN`/`RETURN`):
118
-
119
- 1. `WIKI-CONSULT tier=<tier> :: <topic-pick|refresh>` — at every wiki read
120
- (orc-learn is a wiki-grounding lane; the consult is always traced, absent
121
- wiki included).
122
- 2. `log_dir/.current` = `run-learn-<slug>-<DDMMYY>-<HHMMSS>.txt` before the first spawn.
123
- 3. `DISPATCH orc-learn-writer :: <mode> <slug> expect=opus-5/low` one
124
- per spawn; REFRESH runs one per selected feature.
125
- 4. `VERIFY writer actual=<model>/<effort> MATCH` or
126
- `⛔ DOWNGRADE expected=opus-5/low` from the returned
127
- `actual_model`/`actual_effort` (this lane's honesty signal for
128
- `/orc-retro`).
129
- 5. `FINISH :: <init <slug>|refresh <n> features>`, then delete `.current`.
130
-
131
- Narration is **dispatched, never remembered**: record each marker with its REAL
132
- timestamp as its event happens, then as a single-dispatch lane — dispatch the
133
- trace writer ONCE with the whole event list plus `decisions` (the WHY: which
134
- feature was picked and why, the user's answer verbatim) after the writer return
135
- validates and BEFORE you delete `.current`. Stamps are the run's timeline, never
136
- the write time, and a run that
137
- ends with zero new trace lines is a protocol violation.
138
-
139
- ## Boundaries
140
-
141
- - **Writes ONLY** under `learning-docs/` (via the writer) and, on an explicit
142
- yes, one `.gitignore` line. Never edits source code, never commits, never
143
- pushes.
144
- - **One question per mode, ever.** Which feature (INIT); which to refresh
145
- (REFRESH). Everything else is decided or reported, never asked.
146
- - `learning-docs/` is LOCAL git-ignored, regenerated per dev, never a
147
- committed shared artifact. A stale copy costs one regeneration, nothing
148
- more.
149
- - `INDEX.md` is DERIVED by the writer from the feature headers in the same
150
- dispatch never hand-maintained, never edited by the skill.
151
- - The wiki is consumed read-only as a boundary source; orc-learn never
152
- writes wiki files, never triggers a wiki scan, never treats "not in the
153
- wiki" as a blocker (it falls back to a targeted scan of user-pointed
154
- files).
155
- - Reminder: to see usage limits, tell the user to run `/usage` (never invoke
156
- it programmatically).
1
+ ---
2
+ name: orc-learn
3
+ description: >
4
+ Per-feature onboarding docs for the LOCAL project. Use for "/orc-learn",
5
+ "help me learn feature X", "onboard me to this feature", or "orc-learn
6
+ refresh". Runs INDEPENDENTLY — no orchestrator, no run folder. Picks one
7
+ feature (wiki topics first), then generates learning-docs/<feature>/ with
8
+ learning.md (pedagogy: mental model, walkthrough, recipes, FAQ) and
9
+ knowledge.md (reference: file:line-anchored functions & flow, contracts,
10
+ fingerprints). Output is LOCAL and git-ignored — each dev regenerates their
11
+ own. Refresh lists every generated feature with a computed freshness flag
12
+ and regenerates only what the user picks. The skill dispatches the pinned
13
+ orc-learn-writer-opus-5-low agent — it never writes the docs itself.
14
+ ---
15
+
16
+ # ORC-LEARN (standalone)
17
+
18
+ Teach a developer ONE feature of the local repo well enough to safely extend
19
+ it — the human-onboarding lane. It is NOT the wiki: the wiki grounds the
20
+ *pipeline* (repo-wide, contract-level); orc-learn goes one level deeper for a
21
+ *person* — function-level, full-flow, pedagogical. Target is always
22
+ `<repo root>/learning-docs/<feature-slug>/` (git-ignored, local per dev).
23
+
24
+ **Dispatch, don't do.** Whatever model this chat runs on, the skill only picks
25
+ the topic/mode and spawns `orc-learn-writer-opus-5-low` (the pinned
26
+ engine) — the deepening scan + all writes run at Opus 5 low regardless of
27
+ the caller's tier. The skill's only self-writes are the behavior-trace
28
+ markers around the spawn. Interactivity is DELIBERATELY minimal but non-zero
29
+ (unlike orc-claude): exactly one question per mode — "which feature?" (INIT)
30
+ or "which to refresh?" (REFRESH). Never more.
31
+
32
+ **Grounding precedence** (constellation rule, unchanged):
33
+ `code > fresh wiki > stale wiki (hints) > model priors`. The writer re-verifies
34
+ every wiki claim it uses against the code; on conflict the code wins.
35
+
36
+ **Worked example** (orient only — never execute from it):
37
+ `examples/learn-run-mock.md`.
38
+
39
+ ## The two modes (auto-selected by argument)
40
+
41
+ 1. **INIT** (default: `/orc-learn`, optional `focus=<hint>`) — pick ONE
42
+ feature, generate `learning-docs/<slug>/learning.md` + `knowledge.md`,
43
+ derive `learning-docs/INDEX.md`.
44
+ 2. **REFRESH** (`/orc-learn refresh`) — list every generated feature with a
45
+ computed freshness flag; regenerate only the ones the user picks.
46
+ Protocol: `references/refresh.md`.
47
+
48
+ Not inside a git repo / no project root findable → say so and stop.
49
+
50
+ ## Phases
51
+
52
+ `orc lane phases orc-learn --json` is this lane's pipeline: the ordered list, where
53
+ each phase lives, and how much of it to read. **The CLI owns the order** — never
54
+ derive it from the headings below, and never renumber or rename one without the
55
+ manifest, because a `read: section` pointer names a HEADING and a renamed heading
56
+ is a pointer into nothing.
57
+
58
+ ## Mode A INIT
59
+
60
+ Behavior-trace logging is permanent (always on). Resolve `log_dir`
61
+ (`../orc/config.md` default + `.claude/orc.config.yaml`) at start and follow
62
+ `../_shared/phases/trace.md`; the marker set is in "Behavior trace"
63
+ below. Weave the **Trace:** steps in as each event happens.
64
+
65
+ 1. **Topic pick (wiki-first).** Read `wiki/INDEX.md` +
66
+ `.claude/orc/wiki-meta.json` and compute the freshness tier
67
+ (`../orc-wiki/references/staleness.md` computed on read, never stored).
68
+ **Trace:** `WIKI-CONSULT tier=<FRESH|AGING|STALE|none> :: topic-pick`
69
+ (emitted even when the wiki is absent, with `none`).
70
+ - Wiki FRESH/AGING present its feature areas as a pick-list; the chosen
71
+ area's `covers` globs seed the writer's file set.
72
+ - No wiki / STALE / topic not covered → ask the user to point at the
73
+ feature (a directory or a `focus=` hint); the writer will do a
74
+ **targeted** scan of just those files never repo-wide. A stale wiki
75
+ doc may still ride along as hints (precedence above).
76
+ - Ask which feature as ONE question (one feature per invoke). Derive
77
+ `feature_slug` (kebab-case) from the chosen topic/area.
78
+ 2. **Trace:** write `log_dir/.current` = `run-learn-<slug>-<DDMMYY>-<HHMMSS>.txt` and
79
+ `touch the trace file` of that name in the SAME step, BEFORE the spawn (a
80
+ pointer to a missing file reads as dangling and the hook rotates away).
81
+ 3. Spawn `orc-learn-writer-opus-5-low` with: `mode=init`, `repo_root`,
82
+ `feature_slug`, `topic_area`, `covers[]` (from wiki or user pointer),
83
+ `wiki_tier`, `focus_hint|null`, and the paths to
84
+ `references/deepen.md`, `references/template-learning.md`,
85
+ `references/template-knowledge.md`. **Trace:**
86
+ `DISPATCH orc-learn-writer :: init <slug> expect=opus-5/low` just
87
+ before the spawn (the hook adds `SPAWN`/`RETURN` on its own).
88
+ 4. On return, check `actual_model`/`actual_effort` against the pinned tier —
89
+ mismatch → prepend a tier-downgrade warning to the report. **Trace:**
90
+ `VERIFY writer actual=<model>/<effort> MATCH` (or
91
+ `⛔ DOWNGRADE expected=opus-5/low`).
92
+ 5. Relay the writer's report verbatim. If `learning-docs/` is not in
93
+ `.gitignore`, offer the line (`learning-docs/`)append only on an
94
+ explicit yes; never edit silently. **Trace:** `FINISH :: init <slug>`,
95
+ then delete `log_dir/.current`. Stop. The skill NEVER writes the docs
96
+ itselfnot even a "trivial" INDEX touch.
97
+
98
+ ## Mode B REFRESH
99
+
100
+ 1. No `learning-docs/` (or no feature folders inside) → "nothing generated
101
+ yet; run `/orc-learn` first." Stop no trace run needed.
102
+ 2. Read every `learning-docs/<feature>/knowledge.md` fingerprint header
103
+ (`source_commit` + per-file hashes) and compute FRESH/AGING/STALE per
104
+ feature — `references/refresh.md`. Freshness is computed on read, never
105
+ stored as a status.
106
+ 3. Present the FULL list, each with its computed flag; the user
107
+ multi-selects which to regenerate (one question, multi-select). Nothing
108
+ selected stop, no writes.
109
+ 4. **Trace:** write `log_dir/.current` = `run-learn-<slug>-<DDMMYY>-<HHMMSS>.txt`. For each
110
+ selected feature, spawn the writer with `mode=refresh` and that feature's
111
+ slice (re-deepen just that feature; a FRESH/AGING wiki may again seed the
112
+ boundary emit one `WIKI-CONSULT tier=<tier> :: refresh` when the wiki is
113
+ read). One `DISPATCH`/`VERIFY` pair per feature, same markers as INIT.
114
+ 5. The (last) writer re-derives `learning-docs/INDEX.md` from all current
115
+ feature headers. Relay the combined report. **Trace:**
116
+ `FINISH :: refresh <n> features`, then delete `log_dir/.current`.
117
+
118
+ ## Behavior trace (always on)
119
+
120
+ `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names
121
+ the file and the layers). Lane token `learn`, tier **Single-dispatch** —
122
+ exactly ONE end-of-run packet, dispatched solo after the writer return
123
+ validates and BEFORE `.current` is deleted.
124
+ At run start write `log_dir/.current` = `run-learn-<slug>-<DDMMYY>-<HHMMSS>.txt` AND
125
+ `touch the trace file` of that name in the SAME step.
126
+ Nothing else about the protocol is restated here; a phase that ends with
127
+ `zero new trace lines is a protocol violation`.
128
+
129
+ Dispatch-only lane: emit ONLY the markers it can truthfully witness — no
130
+ `PHASE`/`SCORE`/`FINDING`/`VERDICT`, because deepening and writing happen
131
+ inside the writer, which self-traces nothing and returns only
132
+ `actual_model`/`actual_effort`. The marker set, in order (actor `orc`, plus the
133
+ hook's `SPAWN`/`RETURN`): `WIKI-CONSULT tier=<tier> :: <topic-pick|refresh>` at
134
+ every wiki read · `DISPATCH orc-learn-writer :: <mode> <slug> expect=opus-5/low`
135
+ per spawn (REFRESH runs one per selected feature) · `VERIFY writer
136
+ actual=<model>/<effort>` · `FINISH :: <init <slug>|refresh <n> features>`.
137
+ `decisions` carries which feature was picked and why, plus the user's answer
138
+ verbatim.
139
+
140
+ ## Boundaries
141
+
142
+ - **Writes ONLY** under `learning-docs/` (via the writer) and, on an explicit
143
+ yes, one `.gitignore` line. Never edits source code, never commits, never
144
+ pushes.
145
+ - **One question per mode, ever.** Which feature (INIT); which to refresh
146
+ (REFRESH). Everything else is decided or reported, never asked.
147
+ - `learning-docs/` is LOCAL git-ignored, regenerated per dev, never a
148
+ committed shared artifact. A stale copy costs one regeneration, nothing
149
+ more.
150
+ - `INDEX.md` is DERIVED by the writer from the feature headers in the same
151
+ dispatch never hand-maintained, never edited by the skill.
152
+ - The wiki is consumed read-only as a boundary source; orc-learn never
153
+ writes wiki files, never triggers a wiki scan, never treats "not in the
154
+ wiki" as a blocker (it falls back to a targeted scan of user-pointed
155
+ files).
156
+ - Reminder: to see usage limits, tell the user to run `/usage` (never invoke
157
+ it programmatically).
158
+
159
+ ## Config
160
+
161
+ Resolve with `orc lane config orc-learn --json` and obey `effective`. Never merge
162
+ `.claude/orc.config.yaml` yourself, and never re-derive a precedence. Exit ≠ 0 →
163
+ say so and use `../_shared/config-precedence.md`'s documented defaults, out
164
+ loud. Nothing this lane reads is contested, gated or a stop, so it owes no
165
+ preflight line and has no gate to honour.
166
+
167
+ ## Calls
168
+
169
+ **ONE catalogue, and it is not you:** `orc lane calls orc-learn --json` names every
170
+ CLI call this lane makes, each with its exit-code contract, its cost, when to run
171
+ it, and what an EMPTY answer means. Never invent a spelling, never re-word an
172
+ exit code, and never re-derive a state word — the CLI's state words are the only
173
+ state words, and **an exit code is an ANSWER wherever that contract says so, not
174
+ a failure**. A call the answer does not name is a call this lane does not make.
175
+ Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
176
+ command you are about to run, out loud, before running it.
@@ -35,7 +35,7 @@ a read-only build+test run, not implementation — you still never write code.
35
35
  3. **No dispatch-style and no batch-pause questions** — a single subagent
36
36
  makes both meaningless; never ask them.
37
37
  4. **Lighter intake.** Ask only the **Always + medium tier** (Q1–Q4 in
38
- `../orc/references/intake.md`); skip the high tier (Q5/Q6). Run the Step
38
+ `../_shared/phases/intake.md`); skip the high tier (Q5/Q6). Run the Step
39
39
  3.5 repo cross-check at NAMES-ONLY depth (Glob/Grep-confirm what the draft
40
40
  names, tag the rest `UNVERIFIED`, resolve tags in the sign-off line; >3
41
41
  tags → recommend the full flow or `orc-analyze`). Sign-off **defaults to
@@ -52,7 +52,7 @@ Phase 0 intake (Q1–Q4, soft sign-off) + run folder + intent-spec
52
52
  Phase 1 planning (dispatch orc-planner-mini; analyst first only on real docs)
53
53
  → one-line complexity read (mini-ok? or recommend switch-to-full)
54
54
  Phase 3 dispatch ONE executor (orc-executor-sonnet-5-high) — slice carries
55
- the standing `house_rules` card (../orc/references/house-rules.md,
55
+ the standing `house_rules` card (../_shared/phases/house-rules.md,
56
56
  injected literally) + the cached `postgres` pattern on a data-access
57
57
  task (cache HIT only) — collect + validate return
58
58
  Phase M SMOKE GATE — run build+test → GREEN proceed · RED block ship + surface
@@ -111,20 +111,18 @@ Validate the returned `test_plan_path`/`curl_bundle_path` are under that folder
111
111
  (else malformed → re-dispatch); relay + state the exact path (committed on ship,
112
112
  not gitignored). No → ship. Either way this NEVER runs tests.
113
113
 
114
- ## Behavior trace (PERMANENT — same rule as full; always on)
115
-
116
- Mini does NOT drop the trace. Follow `../orc/references/trace-protocol.md` (load
117
- at run start): create `log_dir`, write `.current` =
118
- `run-mini-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
119
- in the SAME step, store `trace_path`. Narration is
120
- **dispatched, never remembered**: record each event with its REAL timestamp into
121
- a packet (`PHASE`, `DISPATCH`, `VERIFY` per return `actual_model`/
122
- `actual_effort` vs expected, surface any DOWNGRADE `OUTCOME band=mini`,
123
- `VERDICT`, plus `decisions` = the WHY), then dispatch
124
- `orc-trace-writer-haiku-4-5` PAIRED with the next dispatch; mini batches to
125
- **3 packets** (intake+plan, execution, ship). A phase with
126
- zero new trace lines is a protocol violation — dispatch its packet NOW.
127
- Run end: the `FINISH` packet returns, then delete `log_dir/.current`.
114
+ ## Behavior trace (always on)
115
+
116
+ `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names
117
+ the file and the layers). Lane token `mini`, tier **Build lanes** —
118
+ per phase, batched to **3 packets** (intake+plan · execution · ship), each
119
+ paired with the next phase's first dispatch.
120
+ At run start write `log_dir/.current` = `run-mini-<slug>-<DDMMYY>-<HHMMSS>.txt` AND
121
+ `touch the trace file` of that name in the SAME step.
122
+ Nothing else about the protocol is restated here; a phase that ends with
123
+ `zero new trace lines is a protocol violation`.
124
+
125
+ Mini does NOT drop the trace. `OUTCOME band=mini` per task.
128
126
 
129
127
  ## Complexity read (replaces the scoring table)
130
128
 
@@ -163,12 +161,32 @@ Models pinned in `.claude/agents/`; look up here, never reconstruct a name (agen
163
161
 
164
162
  ## Config
165
163
 
166
- Resolve at run start: `../orc/config.md` defaults merged with
167
- `.claude/orc.config.yaml` read `generate_tests` (the Phase T offer default),
168
- `mock_example`, `tdd_loop_max`, and `log_dir`. Wave/scoring/scout keys never
169
- apply to mini never render or ask them.
164
+ **ONE resolver, and it is not you:** `orc lane config orc-mini --json`. Obey
165
+ `effective`, print every line in `announce[]` VERBATIM at preflight, and honour
166
+ `stops[]` before wave 1. Never re-derive a value, a precedence or an inertness
167
+ from `.claude/orc.config.yaml`a key this lane does not read is not in the
168
+ answer, and a key another key shadows comes back already marked. Exit ≠ 0 → say
169
+ the CLI is unavailable and fall back to `../_shared/config-precedence.md`'s
170
+ documented defaults, out loud. Priorities and families:
171
+ `../_shared/config-precedence.md`.
172
+
173
+ Wave/scoring/scout keys never apply to mini — and they are not in the answer,
174
+ so there is nothing to render or ask.
175
+
176
+ ## Calls
177
+
178
+ **ONE catalogue, and it is not you:** `orc lane calls orc-mini --json` names every
179
+ CLI call this lane makes, each with its exit-code contract, its cost, when to run
180
+ it, and what an EMPTY answer means. Never invent a spelling, never re-word an
181
+ exit code, and never re-derive a state word — the CLI's state words are the only
182
+ state words, and **an exit code is an ANSWER wherever that contract says so, not
183
+ a failure**. A call the answer does not name is a call this lane does not make.
184
+ Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
185
+ command you are about to run, out loud, before running it.
186
+
187
+ ## TDD (ONE intake question — mini's whole TDD policy)
170
188
 
171
- **TDD (ONE intake question — mini's whole TDD policy):** at intake ask once:
189
+ At intake ask once:
172
190
  *"Anchor this in plan-time acceptance tests (TDD — red tests first, implement
173
191
  to green)? [yes/no]"*. Yes → the planner slice carries `tdd: on` (the mini
174
192
  planner authors `tdd_spec` per requirement, **scoped by the same `disposition` set the full lane uses** — `new-surface | behavior-change | covered-by-existing | no-behavior | no-runner`, derived from the `facets`, same safety floor: a cited `risk[]` is never scoped out, so a constant or a translation string gets no test but an auth change always does). Mini keeps its SINGLE executor — no paired TDD task; that executor materializes the failing tests FIRST, then implements to green
@@ -188,7 +206,7 @@ mode, no scouts**; it escalates to `/orc-analyze` deep on its concrete
188
206
  thresholds and the user chooses. You never analyze or plan yourself.
189
207
 
190
208
  **Mini-lane gates (yours, deterministic — same as full; full detail in
191
- `../orc/references/analyst-gates.md`; emit `GATE` trace lines).** On
209
+ `../_shared/phases/analyst-gates.md`; emit `GATE` trace lines).** On
192
210
  mini-analyst return: evidence spot-check + derivation lint; refuse
193
211
  take-into-build on open `UNVERIFIED`/missing `scope_closed`; `git_head` ≠
194
212
  HEAD at plan time → re-run the spot-check first. On mini-planner return: Glob
@@ -199,7 +217,7 @@ escalate). At dispatch, append the task's `spec_invariants` to the slice's
199
217
 
200
218
  ## Wiki consult (if present)
201
219
 
202
- Same rule as the full skill — load `../orc/references/wiki-consult.md` at the
220
+ Same rule as the full skill — load `../_shared/phases/wiki-consult.md` at the
203
221
  planning/complexity-read step: compute the FRESH / AGING / STALE tier from
204
222
  `.claude/orc/wiki-meta.json`, pull the relevant pages (incl. cross-cutting
205
223
  maps like `orc-reference-api-surface` when their domain applies), apply