claude-dev-env 2.28.1 → 2.29.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 (110) hide show
  1. package/.agents/agents/AGENTS.md +0 -31
  2. package/.agents/agents/clean-coder.md +1 -1
  3. package/.agents/agents/test_agent_frontmatter.py +3 -1
  4. package/.agents/skills/AGENTS.md +0 -70
  5. package/.agents/skills/_shared/AGENTS.md +0 -44
  6. package/.agents/skills/_shared/advisor/AGENTS.md +0 -8
  7. package/.agents/skills/_shared/pr-loop/AGENTS.md +0 -57
  8. package/.agents/skills/_shared/pr-loop/prompts/AGENTS.md +0 -8
  9. package/.agents/skills/_shared/pr-loop/scripts/AGENTS.md +0 -34
  10. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/AGENTS.md +0 -23
  11. package/.agents/skills/autoconverge/AGENTS.md +0 -35
  12. package/.agents/skills/autoconverge/reference/AGENTS.md +0 -15
  13. package/.agents/skills/autoconverge/workflow/AGENTS.md +0 -25
  14. package/.agents/skills/autoconverge/workflow/autoconverge_report_constants/AGENTS.md +0 -15
  15. package/.agents/skills/everything-search/AGENTS.md +0 -16
  16. package/.agents/skills/fresh-branch/AGENTS.md +0 -13
  17. package/.agents/skills/grok-spawn/AGENTS.md +0 -27
  18. package/.agents/skills/orchestrator/.claude/CLAUDE.md +1 -0
  19. package/.agents/skills/orchestrator/AGENTS.md +1 -0
  20. package/.agents/skills/orchestrator/SKILL.md +44 -53
  21. package/.agents/skills/orchestrator/reference/.claude/CLAUDE.md +1 -0
  22. package/.agents/skills/orchestrator/reference/AGENTS.md +1 -0
  23. package/.agents/skills/orchestrator/reference/consult-the-orchestrator.md +70 -0
  24. package/.agents/skills/orchestrator/reference/executor-consult-block.md +62 -0
  25. package/.agents/skills/orchestrator/reference/host-detect.md +15 -0
  26. package/.agents/skills/orchestrator/test_orchestrator_skill_contract.py +62 -0
  27. package/.agents/skills/orchestrator-refresh/SKILL.md +16 -34
  28. package/.agents/skills/rebase/AGENTS.md +0 -31
  29. package/.agents/skills/session-log/AGENTS.md +0 -31
  30. package/.agents/skills/session-tidy/AGENTS.md +0 -35
  31. package/.agents/skills/skill-builder/AGENTS.md +0 -48
  32. package/.agents/skills/skill-builder/references/AGENTS.md +0 -24
  33. package/.agents/skills/skill-builder/templates/AGENTS.md +0 -13
  34. package/.agents/skills/skill-builder/workflows/AGENTS.md +0 -18
  35. package/.agents/skills/task-build/AGENTS.md +0 -28
  36. package/.agents/skills/update/AGENTS.md +0 -37
  37. package/.agents/skills-archived/AGENTS.md +0 -44
  38. package/.agents/skills-archived/anthropic-plan/AGENTS.md +0 -33
  39. package/.agents/skills-archived/anthropic-plan/scripts/AGENTS.md +0 -10
  40. package/.agents/skills-archived/anthropic-plan/scripts/anthropic_plan_scripts_constants/AGENTS.md +0 -15
  41. package/.agents/skills-archived/anthropic-plan/templates/AGENTS.md +0 -12
  42. package/.agents/skills-archived/anthropic-plan/workflow/AGENTS.md +0 -13
  43. package/.agents/skills-archived/auditing-claude-config/AGENTS.md +0 -20
  44. package/.agents/skills-archived/bugteam/AGENTS.md +0 -29
  45. package/.agents/skills-archived/bugteam/reference/AGENTS.md +0 -19
  46. package/.agents/skills-archived/bugteam/reference/obstacles/AGENTS.md +0 -23
  47. package/.agents/skills-archived/bugteam/scripts/AGENTS.md +0 -29
  48. package/.agents/skills-archived/bugteam/scripts/bugteam_scripts_constants/AGENTS.md +0 -17
  49. package/.agents/skills-archived/codex-review/AGENTS.md +0 -45
  50. package/.agents/skills-archived/codex-review/reference/AGENTS.md +0 -14
  51. package/.agents/skills-archived/codex-review/scripts/codex_review_scripts_constants/AGENTS.md +0 -17
  52. package/.agents/skills-archived/codex-review/test_skill_scaffold.py +13 -3
  53. package/.agents/skills-archived/copilot-review/AGENTS.md +0 -17
  54. package/.agents/skills-archived/pr-converge/AGENTS.md +0 -31
  55. package/.agents/skills-archived/pr-converge/pr_converge_skill_constants/AGENTS.md +0 -25
  56. package/.agents/skills-archived/pr-converge/reference/AGENTS.md +0 -27
  57. package/.agents/skills-archived/pr-converge/reference/obstacles/AGENTS.md +0 -22
  58. package/.agents/skills-archived/pr-converge/scripts/AGENTS.md +0 -45
  59. package/.agents/skills-archived/pr-converge/scripts/pr_converge_scripts_constants/AGENTS.md +0 -17
  60. package/.agents/skills-archived/pr-converge/workflows/AGENTS.md +0 -15
  61. package/.agents/skills-archived/recall/AGENTS.md +0 -29
  62. package/.agents/skills-archived/remember/AGENTS.md +0 -30
  63. package/AGENTS.md +0 -112
  64. package/_shared/AGENTS.md +0 -16
  65. package/_shared/advisor/AGENTS.md +0 -21
  66. package/_shared/advisor/advisor-protocol.md +4 -1
  67. package/_shared/advisor/reference/consult-format.md +4 -2
  68. package/_shared/pr-loop/AGENTS.md +0 -27
  69. package/_shared/pr-loop/scripts/AGENTS.md +0 -49
  70. package/_shared/pr-loop/scripts/code_rules_gate_parts/AGENTS.md +0 -41
  71. package/_shared/pr-loop/scripts/codex_review_scripts_constants/AGENTS.md +0 -17
  72. package/_shared/pr-loop/scripts/pr_converge_scripts_constants/AGENTS.md +0 -17
  73. package/_shared/pr-loop/scripts/pr_converge_skill_constants/AGENTS.md +0 -25
  74. package/_shared/pr-loop/scripts/pr_loop_shared_constants/AGENTS.md +0 -25
  75. package/_shared/pr-loop/scripts/tests/AGENTS.md +0 -43
  76. package/_shared/process-tree/AGENTS.md +0 -40
  77. package/audit-rubrics/AGENTS.md +0 -42
  78. package/audit-rubrics/category_rubrics/AGENTS.md +0 -36
  79. package/audit-rubrics/prompts/AGENTS.md +0 -36
  80. package/bin/AGENTS.md +0 -118
  81. package/bin/install.test.mjs +1 -1
  82. package/commands/AGENTS.md +0 -14
  83. package/docs/AGENTS.md +0 -31
  84. package/docs/references/AGENTS.md +0 -16
  85. package/hooks/AGENTS.md +0 -27
  86. package/hooks/advisory/AGENTS.md +0 -15
  87. package/hooks/blocking/AGENTS.md +0 -112
  88. package/hooks/blocking/claude_md_orphan_file_blocker_parts/AGENTS.md +0 -27
  89. package/hooks/blocking/config/AGENTS.md +0 -9
  90. package/hooks/blocking/inventory_intent_records/AGENTS.md +0 -25
  91. package/hooks/blocking/package_inventory_stale_blocker_parts/AGENTS.md +0 -25
  92. package/hooks/blocking/pii_prevention_blocker_parts/AGENTS.md +0 -23
  93. package/hooks/blocking/tdd_enforcer_parts/AGENTS.md +0 -29
  94. package/hooks/git-hooks/AGENTS.md +0 -31
  95. package/hooks/git-hooks/git_hooks_constants/AGENTS.md +0 -20
  96. package/hooks/hooks_constants/AGENTS.md +0 -99
  97. package/hooks/lifecycle/AGENTS.md +0 -17
  98. package/hooks/observability/AGENTS.md +0 -19
  99. package/hooks/session/AGENTS.md +0 -37
  100. package/hooks/validation/AGENTS.md +0 -19
  101. package/hooks/validators/AGENTS.md +0 -51
  102. package/hooks/workflow/AGENTS.md +0 -15
  103. package/output-styles/AGENTS.md +0 -14
  104. package/package.json +1 -1
  105. package/rules/AGENTS.md +0 -55
  106. package/scripts/AGENTS.md +0 -55
  107. package/scripts/dev_env_scripts_constants/AGENTS.md +0 -20
  108. package/scripts/sync_to_cursor/AGENTS.md +0 -22
  109. package/scripts/tests/AGENTS.md +0 -34
  110. package/system-prompts/AGENTS.md +0 -24
@@ -2,10 +2,11 @@
2
2
  name: orchestrator
3
3
  description: >-
4
4
  Orchestrator mode: plan and delegate while workflow-backed agents
5
- execute; a shared session-advisor answers hard decisions with endorse,
6
- correction, plan, or stop. Triggers: '/orchestrator', 'orchestrator
7
- strategy', 'run with an orchestrator', 'executor-advisor mode',
8
- 'orchestrator enforcement', 'agent routing', 'orchestrate'.
5
+ execute; this session is the advisor those executors consult. Hard
6
+ questions this session cannot settle go to the human. Triggers:
7
+ '/orchestrator', 'orchestrator strategy', 'run with an orchestrator',
8
+ 'executor-advisor mode', 'orchestrator enforcement', 'agent routing',
9
+ 'orchestrate'.
9
10
  disable-model-invocation: true
10
11
  ---
11
12
 
@@ -26,7 +27,8 @@ Under this skill the session is the orchestrator. It spawns and resumes
26
27
  executor subagents — `clean-coder` and the like — and those executors do
27
28
  every bit of the execution: the code edits, the build runs, the test
28
29
  runs. The orchestrating session drives the plan, keeps the run artifacts
29
- and the ledger current, and routes hard decisions to the shared advisor.
30
+ and the ledger current, and answers executor consults. Hard questions
31
+ this session cannot settle go to the human.
30
32
  The moment it edits a file or runs a test itself, the pairing breaks —
31
33
  its own tool use stays orchestration, run-artifact writes, and light
32
34
  verification reads.
@@ -115,47 +117,33 @@ pending, or when the tool is `CronCreate`.
115
117
 
116
118
  1. **Invocation guard.** One `/orchestrator` per session. When a refresh
117
119
  one-shot is already queued (`should-reschedule` exits 1 with
118
- `rearm_already_pending`), do not stack a second: reuse the live
119
- advisor bind, skip step 4 and the re-arm half of step 5, and carry on
120
- from step 5's dispatch status is already active and a re-arm is
121
- already latched, so a second registration would stack a duplicate
122
- host schedule. (Re-asserting `set --status active` preserves
123
- `rearm_pending` when already active, but still do not re-arm.)
124
- 2. **Bind the shared advisor before any executor.** Follow
125
- [`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md)
126
- end to end: name the session identity, compute the floor from the
127
- orchestrator consumer set — this session plus every tier in the
128
- routing table (its Model floor section) — walk the ladder for that
129
- host (Claude: Fable first, then Sol when Fable is out of usage;
130
- Codex: Sol in-session; ThirdParty: headless Fable then Sol),
131
- and fail closed when nothing binds. This session owns the advisor's
132
- whole lifecycle (its Lifecycle ownership section); executors only ever
133
- message the warm agent or report here, and an executor that finds the
134
- advisor unreachable reports that upward — it never spawns a
135
- replacement itself. A **Fable**-tier attempt carries the exact token
136
- `FABLE-SPAWN-AUTHORIZED` in its spawn prompt, as the protocol's
137
- warm-up rule states; `hooks/blocking/fable_spawn_gate.py` denies a
138
- fable spawn whose prompt lacks it.
139
- 3. **Write the run artifacts** (next section) before the first spawn.
140
- 4. **Activate status_gate** when the first open ledger task exists:
120
+ `rearm_already_pending`), do not stack a second: skip the re-arm
121
+ half of step 4, and carry on from step 4's dispatch status is
122
+ already active and a re-arm is already latched, so a second
123
+ registration would stack a duplicate host schedule. (Re-asserting
124
+ `set --status active` preserves `rearm_pending` when already
125
+ active, but still do not re-arm.)
126
+ 2. **Write the run artifacts** (next section) before the first spawn.
127
+ 3. **Activate status_gate** when the first open ledger task exists:
141
128
  `python scripts/status_gate.py set --status active`.
142
- 5. **Dispatch the first task with its ticket** (Spawn ticket section),
129
+ 4. **Dispatch the first task with its ticket** (Spawn ticket section),
143
130
  **then register the discipline reminder** via the single-pending
144
131
  re-arm protocol (cancel matching → `should-reschedule` → one
145
132
  non-recurring delayed wake → `claim-rearm`; default delay about
146
133
  2700s). Spawn before you arm, so the run is already moving, and go
147
- straight on to step 6 in the same turn — the armed wake is a later
134
+ straight on to step 5 in the same turn — the armed wake is a later
148
135
  reminder, not the next thing to wait for.
149
- 6. **Orchestrate.** Hold the plan and the user conversation. Spawn each
136
+ 5. **Orchestrate.** Hold the plan and the user conversation. Spawn each
150
137
  remaining task with a ticket (Spawn ticket section), keep driving while
151
138
  executors work, and keep the ledger reconciled (Task ledger
152
139
  discipline).
153
- 7. **Consult the advisor at hard decisions.** The trigger list, consult
154
- format, and reply handling live in the protocol's "Consulting the
155
- warm agent" section; both this session and every executor are
156
- consumers. Replies open with one of ENDORSE, CORRECTION, PLAN, or
157
- STOP — `agents/session-advisor.md` defines each signal.
158
- 8. **Terminate when done.** When every ledger task is completed or
140
+ 6. **Answer executor consults.** Executors consult this session. The
141
+ trigger list, consult format, and reply handling live in
142
+ [`reference/consult-the-orchestrator.md`](reference/consult-the-orchestrator.md).
143
+ Replies open with one of ENDORSE, CORRECTION, PLAN, or STOP. When
144
+ this session cannot settle a question, ask the human, then reply to
145
+ the executor.
146
+ 7. **Terminate when done.** When every ledger task is completed or
159
147
  cancelled and no executor is running: run
160
148
  `set --status done`, cancel matching host schedules, report
161
149
  completion, and stop. Do not re-arm.
@@ -165,8 +153,8 @@ pending, or when the tool is `CronCreate`.
165
153
  Write these before the first spawn, default home `docs/plans/<run-slug>/`
166
154
  in the repo the run works on (working files, not committed):
167
155
 
168
- - **Run charter** — the goal, the repo root, the advisor name and host
169
- profile. One file every ticket points at.
156
+ - **Run charter** — the goal, the repo root, this session's name as
157
+ advisor, and the host profile. One file every ticket points at.
170
158
  - **One assignment file per task** — scope, file list, constraints, the
171
159
  acceptance check, baseline command output. The thick context goes
172
160
  here. `/prompt-generator` authors the assignment once at plan time,
@@ -196,7 +184,7 @@ Touch only: <files or globs>
196
184
  Done when: <one mechanical check — a command, a test, a diff scope>
197
185
  Return: status, artifact paths, blockers — nothing else.
198
186
 
199
- <Advisor block assembled per _shared/advisor/reference/advisor-block.md — advisor name filled in>
187
+ <Consult block assembled per reference/executor-consult-block.md — orchestrator name filled in>
200
188
  ```
201
189
 
202
190
  - **Size the task by its done-check.** The right task is the largest
@@ -219,11 +207,11 @@ Return: status, artifact paths, blockers — nothing else.
219
207
  slice of work and the done-check — it does not restate the assignment.
220
208
  - **Do not restate what the agent definition carries.** The routing
221
209
  table picks the definition, and `clean-coder` already holds the code
222
- discipline. The ticket adds the task, the pointers, and the Advisor
210
+ discipline. The ticket adds the task, the pointers, and the consult
223
211
  block only.
224
- - **The Advisor block is pasted, assembled text.** Assemble it at bind
225
- time from the parts in
226
- [`_shared/advisor/reference/advisor-block.md`](../../_shared/advisor/reference/advisor-block.md)
212
+ - **The consult block is pasted, assembled text.** Assemble it at ticket
213
+ write time from the parts in
214
+ [`reference/executor-consult-block.md`](reference/executor-consult-block.md)
227
215
  and paste the assembled text itself into the ticket.
228
216
 
229
217
  ## Workflow Agent Routing
@@ -263,9 +251,9 @@ Routing rules:
263
251
  only; a host where no resolver is available fails closed the same
264
252
  way — the coding spawn stops and the orchestrator reports it.
265
253
  - Host detection follows
266
- [`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md)
267
- (Host profiles section, `resolve_session_identity` then
268
- `detect_host_profile`) — the sole detection system, with no second one.
254
+ [`reference/host-detect.md`](reference/host-detect.md)
255
+ (`resolve_session_identity` then `detect_host_profile`) — the sole
256
+ detection system, with no second one.
269
257
  - Resume a warm workflow agent before creating a new workflow run when
270
258
  the warm agent holds the relevant context.
271
259
  - Review and verification workflows apply the [review guide](../reviews/SKILL.md#review-workflow).
@@ -290,7 +278,7 @@ Routing rules:
290
278
  context, or a genuine task switch needs a clean context.
291
279
  - **Reuse is a cost rule, not a correctness dependency.** The run
292
280
  artifacts keep every executor replaceable (Run state section).
293
- - **Name the agent to resume.** When a PLAN from the shared advisor fits
281
+ - **Name the agent to resume.** When a PLAN from this session fits
294
282
  a warm agent, name which agent to resume and where.
295
283
 
296
284
  ## Task ledger discipline
@@ -325,8 +313,8 @@ no open work remains, run `set --status done` before any re-arm attempt.
325
313
  run-artifact writes, and light verification reads.
326
314
  - Every delegated task carries a ledger entry, an assignment artifact,
327
315
  and a workflow-backed spawn with a ticket, routed by the table.
328
- - One shared advisor per orchestrated session, owned by this session per
329
- the protocol; executors never spawn, respawn, or shut it down.
316
+ - This session is the advisor for every executor it spawns. The human
317
+ is this session's advisor.
330
318
 
331
319
  ## Gotchas
332
320
 
@@ -351,17 +339,20 @@ no open work remains, run `set --status done` before any re-arm attempt.
351
339
  | File | Purpose |
352
340
  |---|---|
353
341
  | `SKILL.md` | Orchestrator strategy; pointers to run-control scripts. |
342
+ | `reference/consult-the-orchestrator.md` | When executors consult this session; four-signal replies. |
343
+ | `reference/executor-consult-block.md` | Paste parts for every executor spawn ticket. |
344
+ | `reference/host-detect.md` | Host profile for worker-model routing. |
354
345
  | `scripts/status_gate.py` | Status file, latch, and re-arm gate (exit codes). |
355
346
  | `scripts/status_gate_constants/config/constants.py` | Named constants for status_gate. |
356
347
  | `scripts/test_status_gate.py` | Gate tests. |
348
+ | `test_orchestrator_skill_contract.py` | Skill-text contract: local consult files only. |
357
349
 
358
350
  ## Folder Map
359
351
 
360
352
  - `SKILL.md` — orchestration process and routing.
361
353
  - `scripts/` — deterministic status_gate.
362
- - Advisor policy:
363
- [`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md).
354
+ - `reference/` — consult contract and ticket paste parts.
364
355
 
365
356
  ## File-backed run ledger
366
357
 
367
- When host task tools are absent, reconcile delegated work through `scripts/grok_run_ledger.py` under the run-state directory (stable task ids, one live owner, unique advisor sessions, dependency blocking, snapshot-drift reopening).
358
+ When host task tools are absent, reconcile delegated work through `scripts/grok_run_ledger.py` under the run-state directory (stable task ids, one live owner, unique consult threads, dependency blocking, snapshot-drift reopening).
@@ -0,0 +1 @@
1
+ @../AGENTS.md
@@ -0,0 +1,70 @@
1
+ # Consult the orchestrator
2
+
3
+ The orchestrating session is the advisor. The human operating that session is the next hop when the orchestrator cannot decide.
4
+
5
+ ## When an executor consults
6
+
7
+ An executor sends a consult to the orchestrating session:
8
+
9
+ - after orientation and before the first write
10
+ - before locking a plan or interpretation
11
+ - before a hard-to-reverse action
12
+ - when the same failure repeats or progress has stalled
13
+ - when the chosen approach is being reconsidered
14
+ - once writes and test output exist and the executor believes the
15
+ assignment is done
16
+
17
+ ## First-consult packet
18
+
19
+ The first consult is complete. It carries:
20
+
21
+ - Assignment and desired outcome
22
+ - Constraints and exclusions
23
+ - Actions taken in order
24
+ - Real output and current state
25
+ - Live decision or blocker
26
+ - Validation evidence
27
+ - Unresolved risks
28
+ - Load-bearing paths or excerpts
29
+ - Who is asking and which assignment
30
+
31
+ Later consults carry only changed evidence.
32
+
33
+ Re-raise something already answered only when new evidence is attached.
34
+ After a CORRECTION or PLAN, the next consult on that topic opens with
35
+ what happened when the executor followed it.
36
+
37
+ Embed: `(Advisor: please keep your guidance under 80 words — I need a
38
+ focused starting point, not a comprehensive plan.)`
39
+
40
+ ## How the executor sends it
41
+
42
+ On a Claude host, send the consult with `SendMessage` to the
43
+ orchestrating session by the name the ticket gives.
44
+
45
+ On a Codex host, send the consult in-session to that same session name.
46
+
47
+ On a third-party host, send the consult as a report to the session that
48
+ assigned the ticket.
49
+
50
+ ## How the orchestrator replies
51
+
52
+ The first line is one of:
53
+
54
+ - **ENDORSE** — the plan or the finished work holds. A clean yes.
55
+ - **CORRECTION** — a wrong step or a risk to close. Name the problem and
56
+ the fix.
57
+ - **PLAN** — the approach must change. Give ordered steps the executor
58
+ can run.
59
+ - **STOP** — no path satisfies the assignment. Say why, with proof.
60
+
61
+ The executor treats CORRECTION and PLAN as actions to take. On STOP, or
62
+ when the orchestrator is unreachable, the executor stops and reports to
63
+ the session that assigned the ticket.
64
+
65
+ ## How the orchestrator uses the human
66
+
67
+ The orchestrator answers from the run charter, the assignment, and the
68
+ consult packet. When the question is ambiguous, changes scope, or needs
69
+ a choice the charter does not settle, the orchestrator asks the human,
70
+ then returns one of the four signals to the executor.
@@ -0,0 +1,62 @@
1
+ # Executor consult block
2
+
3
+ Paste parts for every executor spawn ticket this skill issues.
4
+ Assemble at ticket write time. Paste the assembled text at the **top**
5
+ of the spawn prompt.
6
+
7
+ Assembly order: transport preamble for the host, then the shared core,
8
+ then — for an executor at Sonnet or below — the weak-executor add-on.
9
+
10
+ Fill `<orchestrator-name>` with the name the executor can address.
11
+
12
+ ## Transport preamble — Claude host
13
+
14
+ > The orchestrating session named `<orchestrator-name>` is your advisor.
15
+ > Send each consult to it with SendMessage, by that name.
16
+
17
+ ## Transport preamble — Codex host
18
+
19
+ > The orchestrating session named `<orchestrator-name>` is your advisor.
20
+ > Send each consult to it in-session by that name.
21
+
22
+ ## Transport preamble — third-party host
23
+
24
+ > The orchestrating session that assigned this ticket is your advisor.
25
+ > Send each consult as a report to that session.
26
+
27
+ ## Shared core — every host
28
+
29
+ > Consult before locking a nontrivial approach, once you believe your
30
+ > assignment is done, before any hard-to-reverse action, when the same
31
+ > failure repeats or progress has stalled, and when the chosen approach
32
+ > is being reconsidered.
33
+ > The first consult carries: assignment, desired outcome, constraints
34
+ > and exclusions, actions taken in order, real output and current
35
+ > state, live decision or blocker, validation evidence, unresolved
36
+ > risks, load-bearing paths or excerpts, and who is asking. Later
37
+ > consults carry only changed evidence.
38
+ > Re-raise something already answered only when you have new evidence
39
+ > to attach. After a CORRECTION or PLAN, your next consult on that
40
+ > topic opens with what happened when you followed it.
41
+ > Replies open with one of ENDORSE, CORRECTION, PLAN, or STOP — treat
42
+ > CORRECTION and PLAN as actions to take.
43
+ > On STOP, or when the orchestrator is unreachable, stop and report
44
+ > that back to whoever assigned you.
45
+
46
+ ## Weak-executor add-on — Sonnet or below
47
+
48
+ > Send your first consult right after orientation and before your first
49
+ > write.
50
+ > Send a completion consult once your writes and test output exist —
51
+ > that consult asks the orchestrator to hunt for missing requirements,
52
+ > untested behavior, wrong assumptions, unhandled edge cases, evidence
53
+ > gaps, and early completion claims.
54
+ > Consult before reaching for any task-list tool — the orchestrator's
55
+ > plan becomes the task list.
56
+ > Aim for two consults on a normal task: early orientation and
57
+ > completion review. Reserve a third for recovery or reconciliation.
58
+ > Embed this line in each consult: `(Advisor: please keep your guidance
59
+ > under 80 words — I need a focused starting point, not a comprehensive
60
+ > plan.)`
61
+ > On a transient failure, retry once, then carry on with the evidence
62
+ > you have and record that you did.
@@ -0,0 +1,15 @@
1
+ # Host detect
2
+
3
+ Name the host so worker-model routing can pick `sonnet` or the
4
+ resolver-printed sonnet-equivalent id.
5
+
6
+ 1. Read the session's named identity.
7
+ 2. A `codex` token selects Codex. A `claude` token selects Claude. Any
8
+ other identity selects ThirdParty.
9
+ 3. When both tokens appear, Codex wins.
10
+
11
+ Mechanical override for scripts:
12
+
13
+ 1. `ADVISOR_HOST_PROFILE=ThirdParty` or `=Claude` or `=Codex`.
14
+ 2. `THIRD_PARTY=1` (or `true` / `yes` / `on`) selects ThirdParty.
15
+ 3. Default: Claude.
@@ -0,0 +1,62 @@
1
+ """Contract checks for the orchestrator-as-advisor skill text."""
2
+
3
+ from pathlib import Path
4
+
5
+
6
+ _SKILL_DIR = Path(__file__).resolve().parent
7
+ _REFRESH_PATH = _SKILL_DIR.parent / "orchestrator-refresh" / "SKILL.md"
8
+ _ORCHESTRATOR_PATHS = (
9
+ _SKILL_DIR / "SKILL.md",
10
+ _SKILL_DIR / "AGENTS.md",
11
+ _SKILL_DIR / "reference" / "consult-the-orchestrator.md",
12
+ _SKILL_DIR / "reference" / "executor-consult-block.md",
13
+ _SKILL_DIR / "reference" / "host-detect.md",
14
+ _SKILL_DIR / "reference" / "AGENTS.md",
15
+ _REFRESH_PATH,
16
+ )
17
+ _FOREIGN_MARKERS = (
18
+ "advisor-protocol",
19
+ "session-advisor",
20
+ "advisor-block.md",
21
+ "consult-format.md",
22
+ "advisor-tool.md",
23
+ "_shared/advisor",
24
+ )
25
+
26
+
27
+ def test_orchestrator_docs_omit_foreign_advisor_paths() -> None:
28
+ for path in _ORCHESTRATOR_PATHS:
29
+ text = path.read_text(encoding="utf-8")
30
+ for marker in _FOREIGN_MARKERS:
31
+ assert marker not in text, f"{path.name} names {marker}"
32
+
33
+
34
+ def test_orchestrator_skill_points_at_local_consult_files() -> None:
35
+ text = (_SKILL_DIR / "SKILL.md").read_text(encoding="utf-8")
36
+ assert "Bind the shared advisor" not in text
37
+ assert "reference/consult-the-orchestrator.md" in text
38
+ assert "reference/executor-consult-block.md" in text
39
+ assert "This session is the advisor" in text
40
+
41
+
42
+ def test_refresh_routes_consults_to_this_session() -> None:
43
+ text = _REFRESH_PATH.read_text(encoding="utf-8")
44
+ assert "This session is the advisor." in text
45
+ assert "Hard decisions go to the shared advisor." not in text
46
+ assert "consult-the-orchestrator.md" in text
47
+
48
+
49
+ def test_consult_contract_names_human_as_next_hop() -> None:
50
+ text = (_SKILL_DIR / "reference" / "consult-the-orchestrator.md").read_text(
51
+ encoding="utf-8"
52
+ )
53
+ assert "orchestrating session is the advisor" in text
54
+ assert "human operating that session" in text
55
+
56
+
57
+ def test_executor_consult_block_names_orchestrating_session() -> None:
58
+ text = (_SKILL_DIR / "reference" / "executor-consult-block.md").read_text(
59
+ encoding="utf-8"
60
+ )
61
+ assert "<orchestrator-name>" in text
62
+ assert "your advisor" in text
@@ -2,18 +2,17 @@
2
2
  name: orchestrator-refresh
3
3
  description: >-
4
4
  Re-assert orchestrator discipline on a one-shot delayed wake: ledger
5
- reconcile, advisor routing, warm executor reuse, single-pending re-arm
6
- via status_gate. Terminates when the gate says stop. Triggers:
7
- '/orchestrator-refresh', orchestrator-refresh, refresh the orchestrator
8
- loop, re-arm orchestrator.
5
+ reconcile, executor consult routing to this session, warm executor
6
+ reuse, single-pending re-arm via status_gate. Terminates when the
7
+ gate says stop. Triggers: '/orchestrator-refresh', orchestrator-refresh,
8
+ refresh the orchestrator loop, re-arm orchestrator.
9
9
  ---
10
10
 
11
11
  # Orchestrator Refresh
12
12
 
13
- Name the session identity first (see Host profiles in
14
- [`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md)).
15
- Re-assert the discipline for that host only — do not invent an Agent-tool
16
- Claude `session-advisor` spawn on a Codex or third-party host.
13
+ Name the session identity first (see
14
+ [`../orchestrator/reference/host-detect.md`](../orchestrator/reference/host-detect.md)).
15
+ Re-assert the discipline for that host only.
17
16
 
18
17
  ## 0. status_gate first (deterministic)
19
18
 
@@ -62,9 +61,7 @@ cancelled; either way the session keeps orchestrating in the same turn.
62
61
  Two stops end the whole firing, and both leave running executors alone:
63
62
  `begin-firing` exit 1 (step 0a) and the done branch (step 0b). Each means the
64
63
  run is finished, not active, or has no readable status file, so the refresh
65
- reports and adds nothing further. A fail-closed advisor bind (step 3) stops
66
- advisor consultation alone; the firing still reconciles the ledger, re-arms
67
- once, and reports the unreachable advisor.
64
+ reports and adds nothing further.
68
65
 
69
66
  ## Discipline steps
70
67
 
@@ -85,28 +82,13 @@ once, and reports the unreachable advisor.
85
82
  - **Focused tickets.** One mechanical done-check per ticket; resume a
86
83
  warm agent with a thin next-slice ticket rather than a fresh cold
87
84
  spawn, and keep thick context in the assignment file.
88
- 3. **Hard decisions go to the shared advisor.**
89
- - **Claude host:** executors consult the warm `session-advisor` via
90
- `SendMessage` (ENDORSE / CORRECTION / PLAN / STOP). This session
91
- routes the same way; keep tool use to orchestration and light
92
- verification reads. A drift re-spawn at the **Fable** tier carries
93
- the exact token `FABLE-SPAWN-AUTHORIZED` in its fresh prompt, as
94
- the protocol's warm-up rule states;
95
- `hooks/blocking/fable_spawn_gate.py` denies a fable spawn whose
96
- prompt lacks it.
97
- - **Codex host:** advisor is a native in-session Sol subagent owned
98
- by this session. Do **not** spawn Claude `session-advisor` via
99
- Agent. Executors consult that Sol subagent in-session. If Sol does
100
- not bind, fail closed.
101
- - **Third-party host:** advisor is a Claude CLI bind owned
102
- by this session (`claude_chain_runner.py`, Fable then Sol when Fable
103
- is out of usage, both at `ADVISOR_EFFORT`). Do **not** spawn `session-advisor` via Agent. Executors
104
- report blockers here; consult the CLI advisor and relay signals.
105
- If the CLI bind is unreachable, fail closed — do not answer the
106
- four signals as this third-party session.
85
+ 3. **This session is the advisor.** Executors consult here. Follow
86
+ [`../orchestrator/reference/consult-the-orchestrator.md`](../orchestrator/reference/consult-the-orchestrator.md).
87
+ Reply with ENDORSE / CORRECTION / PLAN / STOP. When this session
88
+ cannot settle a question, ask the human, then reply. Keep tool use
89
+ to orchestration and light verification reads.
107
90
  4. **Resume before you spawn.** `SendMessage` an existing *executor* by
108
- name or `agentId` before a cold spawn. (Third-party: executor reuse
109
- only — advisor stays on the CLI chain.)
91
+ name or `agentId` before a cold spawn.
110
92
  5. **Fresh spawn only for a genuine task switch.** Never tell an agent
111
93
  to compact for a clean context.
112
94
  6. **Single-pending re-arm only.** Same protocol as the orchestrator
@@ -147,5 +129,5 @@ once, and reports the unreachable advisor.
147
129
 
148
130
  - `SKILL.md` — this skill (thin); gate implementation lives under
149
131
  `skills/orchestrator/scripts/`.
150
- - Advisor policy:
151
- [`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md).
132
+ - Consult contract:
133
+ [`../orchestrator/reference/consult-the-orchestrator.md`](../orchestrator/reference/consult-the-orchestrator.md).
@@ -1,32 +1 @@
1
- # rebase
2
1
 
3
- Rebase a branch onto its base ref with verification gates that catch logically broken results before pushing.
4
-
5
- **Trigger:** `/rebase`, "rebase this branch", "PR has merge conflicts", "rebase onto main", force-push to update remote branch history.
6
-
7
- ## Purpose
8
-
9
- The default failure mode for a rebase is shipping code that compiled but does not run. This skill prevents that by running real import checks, test collection, and symbol scans after every rebase — not just syntax validation.
10
-
11
- ## Key files
12
-
13
- | File | Purpose |
14
- |---|---|
15
- | `SKILL.md` | The complete skill — four phases (pre-rebase analysis, during rebase, verification gates, push). No companion files. |
16
-
17
- ## Four phases
18
-
19
- | Phase | Key actions |
20
- |---|---|
21
- | 1 — Pre-rebase analysis | Resolve base via `gh pr view`, classify scenario (stacked/squash/long-lived), fetch fresh, scan commit messages for deleted/renamed symbols |
22
- | 2 — During rebase | Verify `--skip` with a diff, audit auto-merged files with `git diff --name-only --diff-filter=M ORIG_HEAD` |
23
- | 3 — Verification gates | `python -m compileall`, `pytest --collect-only -q`, targeted test run, reference scan for removals |
24
- | 4 — Push | Explicit authorization required; `--force-with-lease=<branch>:<sha>` only; verify mergeability after push |
25
-
26
- ## Conventions
27
-
28
- - Force-push requires explicit operator authorization every time — auto mode does not bypass this.
29
- - `--force-with-lease=<branch>:<sha>` only; bare `--force` is refused.
30
- - Never force-push `main`, `master`, `release/*`, `production`, or any multi-author branch.
31
- - Symbol scans prefer Serena (`find_referencing_symbols`) then the Grep tool, then shell grep as a last resort.
32
- - `ORIG_HEAD` is the correct ref for auto-merged file audits mid-rebase; `HEAD@{1}` shifts per step.
@@ -1,32 +1 @@
1
- # session-log
2
1
 
3
- Logs a session report as a self-contained HTML page in the Obsidian vault, publishes it with the `Artifact` tool, extracts unrecorded decisions, tidies the project session folder, and outputs a `/rename` command.
4
-
5
- **Trigger:** `/session-log`, "journal this session", "log this work", "session report", "save session", "capture session", "document what we did".
6
-
7
- ## Purpose
8
-
9
- Produces a self-contained HTML session report shaped to the session's character (feature build, incident, research, etc.) rather than a fixed template. The skill owns the vault path, session numbering, frontmatter contract, HTML composition and publishing, decision extraction, and folder hygiene.
10
-
11
- ## Key files
12
-
13
- | File | Purpose |
14
- |---|---|
15
- | `SKILL.md` | Hub — six steps, gotchas, backend detection, run-and-report checklist. |
16
- | `templates/frontmatter.md` | The session-page frontmatter contract and the Step 3 notes block. |
17
-
18
- ## Six steps
19
-
20
- 1. **Backend detection** — headless vault (`ob --version` + `OBSIDIAN_VAULT_PATH`) then local vault (`~/.claude/vault/`). Session number from `[N]. *.html` and `[N]. *.md` files in the project folder.
21
- 2. **Session metadata** — project name, session number, session ID from `CLAUDE_CODE_SESSION_ID`, date, title.
22
- 3. **Compose and publish via the Artifact tool** — loads the `artifact-design` skill first, designs the shape for the session's character (e.g., a PR-writeup shape for feature builds, a timeline shape for incidents), writes the HTML, then publishes it with the `Artifact` tool using the fixed favicon `📓`.
23
- 4. **Vault context tracking** — two Edit calls set `vault_context_retrieved` and append a vault-context line, then redeploy via `Artifact` on the same `file_path` so the URL stays the same.
24
- 5. **Decision extraction** — scans conversation for unrecorded decisions; prompts user via `AskUserQuestion` before invoking `/remember`.
25
- 6. **Session tidy** — audits `.html` files in the project folder for naming and frontmatter; auto-fixes minor issues and redeploys via `Artifact`.
26
-
27
- ## Conventions
28
-
29
- - Session reports use HTML — the Artifact tool publishes HTML or Markdown, and HTML gives the report designer more visual structure.
30
- - `write_existing_file_blocker` rejects Write on existing paths — use Edit for all vault-context updates.
31
- - The `Artifact` tool redeploys to the same URL on repeat calls with the same `file_path` within the current run — edits made in steps 3 and 5 to the session created this run never mint a new URL.
32
- - Final step copies `/rename [Project] - [Primary Outcome]` to the clipboard via `pwsh Set-Clipboard`.
@@ -1,36 +1 @@
1
- # session-tidy
2
1
 
3
- Audits, cleans, and consolidates session logs in the Obsidian vault — fixes format drift, resolves orphaned next-steps, updates stale statuses, and generates project rollup summaries.
4
-
5
- **Trigger:** `/session-tidy`, "tidy sessions", "clean up session logs", "session audit".
6
-
7
- ## Purpose
8
-
9
- Maintenance utility for the `sessions/[Project]/` vault directories. Enforces the session-log format contract, moves uncategorized files into project subfolders, and generates `Summary.md` rollup files for projects with 3+ sessions.
10
-
11
- ## Key files
12
-
13
- | File | Purpose |
14
- |---|---|
15
- | `SKILL.md` | The complete skill — four phases (preflight, audit, propose changes, execute + verify). No companion files. |
16
-
17
- ## Format contract enforced
18
-
19
- - **Path:** `sessions/[Project]/[N]. [Title].md`
20
- - **Frontmatter:** `type`, `project`, `session`, `date`, `status`, `blocked`, `tags` — all needed.
21
- - **Status rules:** `completed` + `blocked: true` is contradictory; `in-progress` or `blocked` older than 7 days is stale.
22
- - **Content:** outcome-oriented `###` headers with one emoji; no play-by-play narration.
23
-
24
- ## Four phases
25
-
26
- 1. **Preflight** — resolve backend (headless vault, Obsidian MCP, or local vault).
27
- 2. **Audit** — check each file for naming, frontmatter completeness, status coherence, orphaned next-steps, and categorization.
28
- 3. **Propose changes** — report findings; wait for user approval before changing anything.
29
- 4. **Execute + verify** — rename files, fix frontmatter, update statuses, clean orphaned next-steps, generate `Summary.md` rollups.
30
-
31
- ## Conventions
32
-
33
- - `disable-model-invocation: true` is set.
34
- - Changes need explicit user approval from Phase 2's report — the skill never auto-applies without approval.
35
- - Companion to `/session-log` (creates sessions) and `/recall` (reads vault).
36
- - `/session-tidy` targets Markdown session format; HTML sessions from `/session-log` may be mis-audited or get incorrect rename proposals.
@@ -1,49 +1 @@
1
- # skill-builder
2
1
 
3
- Orchestrates the skill-building lifecycle: classify type, scaffold folders, write via the `skill-writer-agent` agent, enforce modularity (sub-skills / composition), write description as a trigger catalog, require deterministic steps as code, self-audit, and refine from real usage.
4
-
5
- **Trigger:** build a skill, new skill workflow, improve this skill, optimize skill description, skill development lifecycle, skill modularity, description trigger catalog, deterministic skill scripts.
6
-
7
- ## Purpose
8
-
9
- Enforces craft standards for new and existing skills. For quick one-off SKILL.md edits, spawn the `skill-writer-agent` agent directly. This skill classifies, scaffolds, gathers context (composition plan, description triggers, deterministic inventory), delegates writing, and self-audits.
10
-
11
- ## Key files
12
-
13
- | File | Purpose |
14
- |---|---|
15
- | `SKILL.md` | Hub — routing, principles, file index |
16
- | `references/skill-types.md` | 9-type taxonomy with folder structures per type |
17
- | `references/progressive-disclosure.md` | Hub pattern, folder conventions, hard rules |
18
- | `references/skill-modularity.md` | Cross-skill modularity, sub-skills, composition plan |
19
- | `references/description-field.md` | Description as trigger catalog (not story prose) |
20
- | `references/deterministic-elements.md` | Deterministic steps as code/task seeds; no markdown checkbox boards |
21
- | `references/self-audit-checklist.md` | Post-build audit task seeds (TaskCreate / TodoWrite) |
22
- | `references/delegation-map.md` | Subagent handoff patterns and transcript guidance |
23
- | `references/thariq-x-post-skills.json` | Source reference — lessons from building Claude Code skills |
24
- | `workflows/new-skill.md` | Full lifecycle for new skills (6 steps) |
25
- | `workflows/improve-skill.md` | Observation-first flow for existing skills (6 steps) |
26
- | `workflows/polish-skill.md` | Description trigger-catalog audit and final validation (5 steps) |
27
- | `templates/gap-analysis.md` | Gaps, composition plan, description triggers, deterministic inventory |
28
-
29
- ## Subdirectories
30
-
31
- | Directory | Purpose |
32
- |---|---|
33
- | `references/` | Best-practice specs and the audit checklist |
34
- | `workflows/` | Step-by-step workflows for each lifecycle phase |
35
- | `templates/` | Reusable templates for skill artifacts |
36
-
37
- ## Routing
38
-
39
- - **New skill** → `workflows/new-skill.md`
40
- - **Improve existing** → `workflows/improve-skill.md`
41
- - **Final polish only** → `workflows/polish-skill.md`
42
- - **Ambiguous** → ask the user which one applies
43
-
44
- ## Conventions
45
-
46
- - Every build ends with the self-audit at `references/self-audit-checklist.md`; fix failures before delivery.
47
- - Modularity items, description trigger-catalog items, and deterministic-element classification are mandatory on every delivery.
48
- - `skill-builder` orchestrates; the `skill-writer-agent` agent authors. Handoff packet must include type, gap analysis, composition plan, description trigger catalog, deterministic inventory, degree-of-freedom assessment, and constraints.
49
- - Claude A / Claude B: Claude A (this session) designs; Claude B (subagents) tests the built skill on real tasks.