claude-dev-env 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +1 -1
- package/agents/clean-coder.md +31 -1
- package/audit-rubrics/prompts/category-e-dead-code.md +2 -2
- package/bin/install.test.mjs +2 -2
- package/docs/CLAUDE.md +6 -3
- package/docs/CODE_RULES.md +5 -1
- package/docs/agent-spawn-protocol.md +39 -0
- package/docs/nas-ssh-invocation.md +23 -0
- package/docs/worker-completion-gate.md +33 -0
- package/hooks/blocking/CLAUDE.md +1 -0
- package/hooks/blocking/code_rules_dead_module_constant.py +11 -5
- package/hooks/blocking/code_rules_shared.py +126 -47
- package/hooks/blocking/config/CLAUDE.md +2 -0
- package/hooks/blocking/config/verified_commit_constants.py +8 -1
- package/hooks/blocking/config/verified_commit_context_constants.py +21 -0
- package/hooks/blocking/config/verified_commit_gate_output_constants.py +14 -0
- package/hooks/blocking/conftest.py +36 -30
- package/hooks/blocking/convergence_gate_blocker.py +76 -8
- package/hooks/blocking/plain_language_blocker.py +8 -0
- package/hooks/blocking/state_description_blocker.py +4 -1
- package/hooks/blocking/test_code_rules_enforcer_dead_module_constant.py +58 -0
- package/hooks/blocking/test_code_rules_enforcer_dead_module_constant_alias.py +133 -0
- package/hooks/blocking/test_code_rules_shared.py +120 -20
- package/hooks/blocking/test_convergence_gate_blocker.py +146 -0
- package/hooks/blocking/test_plain_language_blocker.py +15 -0
- package/hooks/blocking/test_state_description_blocker.py +15 -0
- package/hooks/blocking/test_verification_verdict_store.py +12 -0
- package/hooks/blocking/test_verified_commit_config_bootstrap.py +18 -0
- package/hooks/blocking/test_verified_commit_docs_delta.py +176 -0
- package/hooks/blocking/test_verified_commit_gate_additional_context.py +134 -0
- package/hooks/blocking/tests/test_pii_prevention_blocker.py +0 -1
- package/hooks/blocking/tests/test_verified_commit_gate.py +41 -0
- package/hooks/blocking/verified_commit_config_bootstrap.py +22 -10
- package/hooks/blocking/verified_commit_gate.py +113 -568
- package/hooks/blocking/verified_commit_gate_parts/CLAUDE.md +28 -0
- package/hooks/blocking/verified_commit_gate_parts/__init__.py +1 -0
- package/hooks/blocking/verified_commit_gate_parts/command_tokenization.py +174 -0
- package/hooks/blocking/verified_commit_gate_parts/deny_payload.py +53 -0
- package/hooks/blocking/verified_commit_gate_parts/deny_reason.py +80 -0
- package/hooks/blocking/verified_commit_gate_parts/directory_resolution.py +170 -0
- package/hooks/blocking/verified_commit_gate_parts/gated_invocations.py +205 -0
- package/hooks/blocking/verified_commit_gate_parts/tests/conftest.py +10 -0
- package/hooks/blocking/verified_commit_gate_parts/tests/test_command_tokenization.py +94 -0
- package/hooks/blocking/verified_commit_gate_parts/tests/test_deny_payload.py +17 -0
- package/hooks/blocking/verified_commit_gate_parts/tests/test_deny_reason.py +38 -0
- package/hooks/blocking/verified_commit_gate_parts/tests/test_directory_resolution.py +71 -0
- package/hooks/blocking/verified_commit_gate_parts/tests/test_gated_invocations.py +61 -0
- package/hooks/hooks_constants/CLAUDE.md +4 -1
- package/hooks/hooks_constants/code_rules_path_utils_constants.py +1 -0
- package/hooks/hooks_constants/convergence_gate_blocker_constants.py +36 -0
- package/hooks/hooks_constants/dead_module_constant_constants.py +8 -0
- package/hooks/hooks_constants/harness_scratchpad_constants.py +10 -9
- package/hooks/hooks_constants/mypy_integration_constants.py +16 -0
- package/hooks/hooks_constants/pii_prevention_constants.py +1 -0
- package/hooks/validators/mypy_integration.py +145 -24
- package/hooks/validators/python_antipattern_checks.py +16 -0
- package/hooks/validators/run_all_validators.py +9 -3
- package/hooks/validators/test_mypy_integration.py +154 -0
- package/hooks/validators/test_python_antipattern_checks.py +112 -1
- package/hooks/validators/test_run_all_validators_pretooluse.py +16 -0
- package/package.json +1 -1
- package/rules/CLAUDE.md +3 -3
- package/rules/agent-spawn-protocol.md +5 -43
- package/rules/code-standards.md +1 -36
- package/rules/env-var-table-code-drift.md +2 -21
- package/rules/hook-prose-matches-detector.md +5 -16
- package/rules/nas-ssh-invocation.md +3 -15
- package/rules/no-historical-clutter.md +7 -49
- package/rules/no-inline-destructive-literals.md +3 -5
- package/rules/package-inventory-stale-entry.md +7 -32
- package/rules/re-stage-before-commit.md +6 -23
- package/rules/shell-invocation-policy.md +1 -1
- package/rules/vault-context.md +3 -3
- package/rules/verified-commit-gate-skip.md +28 -0
- package/rules/workers-done-before-complete.md +2 -30
- package/scripts/claude_chain_runner.py +39 -3
- package/scripts/dev_env_scripts_constants/claude_chain_constants.py +3 -0
- package/scripts/test_claude_chain_runner.py +112 -0
- package/scripts/test_grok_headless_runner.py +0 -1
- package/skills/auditing-claude-config/CLAUDE.md +2 -1
- package/skills/auditing-claude-config/SKILL.md +114 -176
- package/skills/auditing-claude-config/reference/probe-hook.md +74 -0
- package/skills/autoconverge/CLAUDE.md +1 -0
- package/skills/autoconverge/SKILL.md +310 -346
- package/skills/autoconverge/reference/CLAUDE.md +1 -0
- package/skills/autoconverge/reference/copilot-findings.md +51 -0
- package/skills/closeout/SKILL.md +7 -9
- package/skills/copilot-finding-triage/SKILL.md +5 -7
- package/skills/copilot-review/CLAUDE.md +3 -2
- package/skills/copilot-review/SKILL.md +119 -155
- package/skills/copilot-review/templates/subagent-prompt.md +49 -0
- package/skills/everything-search/SKILL.md +7 -1
- package/skills/fresh-branch/CLAUDE.md +6 -9
- package/skills/fresh-branch/SKILL.md +84 -33
- package/skills/fresh-branch/scripts/create_fresh_branch.py +445 -0
- package/skills/fresh-branch/scripts/fresh_branch_scripts_constants/__init__.py +1 -0
- package/skills/fresh-branch/scripts/fresh_branch_scripts_constants/fresh_branch_cli_constants.py +74 -0
- package/skills/fresh-branch/scripts/test_create_fresh_branch.py +670 -0
- package/skills/orchestrator/SKILL.md +161 -147
- package/skills/pr-converge/SKILL.md +277 -422
- package/skills/pr-converge/reference/CLAUDE.md +1 -0
- package/skills/pr-converge/reference/progress-checklist.md +168 -0
- package/skills/pr-converge/test_step5_host_branch.py +8 -6
- package/skills/pr-loop-cloud-transport/SKILL.md +1 -1
- package/skills/privacy-hygiene/SKILL.md +68 -115
- package/skills/privacy-hygiene/reference/sweep-procedure.md +62 -0
- package/skills/session-log/CLAUDE.md +2 -1
- package/skills/session-log/SKILL.md +4 -26
- package/skills/session-log/templates/frontmatter.md +40 -0
- package/skills/skill-builder/CLAUDE.md +8 -7
- package/skills/skill-builder/SKILL.md +26 -11
- package/skills/skill-builder/references/CLAUDE.md +3 -1
- package/skills/skill-builder/references/delegation-map.md +21 -12
- package/skills/skill-builder/references/description-field.md +9 -11
- package/skills/skill-builder/references/deterministic-elements.md +218 -0
- package/skills/skill-builder/references/self-audit-checklist.md +62 -45
- package/skills/skill-builder/references/skill-modularity.md +8 -9
- package/skills/skill-builder/templates/CLAUDE.md +2 -2
- package/skills/skill-builder/templates/gap-analysis.md +15 -0
- package/skills/skill-builder/workflows/CLAUDE.md +5 -5
- package/skills/skill-builder/workflows/improve-skill.md +18 -9
- package/skills/skill-builder/workflows/new-skill.md +23 -15
- package/skills/skill-builder/workflows/polish-skill.md +28 -21
- package/system-prompts/CLAUDE.md +3 -3
- package/docs/agents-md-alignment-plan.md +0 -123
- package/docs/emotion-informed-prompt-design.md +0 -362
- package/rules/es-exe-file-search.md +0 -17
|
@@ -21,106 +21,118 @@ delegating to Sonnet-5 workers came out cheaper and faster
|
|
|
21
21
|
than a solo frontier agent held to the same verification rigor, with
|
|
22
22
|
84-98% of the team's input tokens billed at the worker rate.
|
|
23
23
|
|
|
24
|
-
Under this skill the session
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
the
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- **
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
reach that agent later. A named agent is reachable by name.
|
|
52
|
-
- **Only the orchestrating session owns the shared advisor's lifecycle.** An
|
|
53
|
-
executor that finds the advisor unreachable (Claude warm agent, or Claude
|
|
54
|
-
CLI bind on a third-party host) reports that upward; it never spawns a replacement itself.
|
|
24
|
+
Under this skill the session is the orchestrator. It spawns and resumes
|
|
25
|
+
executor subagents — `clean-coder` and the like — and those executors do
|
|
26
|
+
every bit of the execution: the code edits, the build runs, the test
|
|
27
|
+
runs. The orchestrating session drives the plan, keeps the run artifacts
|
|
28
|
+
and the ledger current, and routes hard decisions to the shared advisor.
|
|
29
|
+
The moment it edits a file or runs a test itself, the pairing breaks —
|
|
30
|
+
its own tool use stays orchestration, run-artifact writes, and light
|
|
31
|
+
verification reads.
|
|
32
|
+
|
|
33
|
+
## Design rule — thin prompts, thick artifacts, thin skill
|
|
34
|
+
|
|
35
|
+
Three faces of one rule (reading pinned by the audit spec on
|
|
36
|
+
jl-cmd/claude-dev-env#174: thin means high-signal, not short; thick
|
|
37
|
+
context lives outside the window, reachable by pointers):
|
|
38
|
+
|
|
39
|
+
- **Thin prompts.** A spawn prompt is a dispatch ticket: one task,
|
|
40
|
+
pointers to the artifacts that hold the context, one done-check, a thin
|
|
41
|
+
return contract. The prompt can be thin because the context is thick
|
|
42
|
+
elsewhere.
|
|
43
|
+
- **Thick artifacts.** Durable run state lives in files — the run
|
|
44
|
+
charter, one assignment file per task, result records — written once,
|
|
45
|
+
read by every agent that needs them, and still there when any one
|
|
46
|
+
agent's context is gone.
|
|
47
|
+
- **Thin skill.** This file holds only what changes decisions at
|
|
48
|
+
orchestration time. Standing policy lives where it loads once:
|
|
49
|
+
[`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md)
|
|
50
|
+
for everything advisor, the agent definitions for executor discipline.
|
|
55
51
|
|
|
56
52
|
## Process
|
|
57
53
|
|
|
58
|
-
1. **
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
where each refresh re-schedules the next one.
|
|
66
|
-
|
|
67
|
-
3. **Bind a shared advisor before any executor.** Detect the host profile
|
|
68
|
-
first (see Host profiles in
|
|
69
|
-
[`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md)).
|
|
70
|
-
On a **Claude host**, follow the Warm-up procedure in that doc (Agent spawn
|
|
71
|
-
of `session-advisor`). Compute the model floor as the max of the
|
|
72
|
-
orchestrating session's own tier and the highest model in the Workflow Agent
|
|
73
|
-
Routing table below (for example, max(Sonnet, Opus) = Opus when those are
|
|
74
|
-
the tiers in play). That floor is a lower bound only — the Claude spawn walk
|
|
75
|
-
tries top-down from Fable down to that floor per
|
|
76
|
-
[`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md);
|
|
77
|
-
it is not a "spawn only at the floor" rule. Paste the **Claude host**
|
|
78
|
-
Advisor block from that doc, with the resolved agent name filled in, into
|
|
79
|
-
every executor's spawn prompt. On a **third-party host**, skip the Agent spawn —
|
|
80
|
-
bind a max-tier Claude advisor through the protocol's CLI Claude-chain path
|
|
81
|
-
(Fable high, then Opus max; `claude_chain_runner.py` for account usage
|
|
82
|
-
failover). Paste the **Third-party host** Advisor block from that doc into every
|
|
83
|
-
executor's spawn prompt — never the Claude SendMessage block. Every row in
|
|
84
|
-
the routing table is a consumer of the shared advisor, not just this
|
|
85
|
-
session. The orchestrating session owns the shared advisor's lifecycle end
|
|
86
|
-
to end (Agent spawn or CLI bind, drift handling per the shared doc,
|
|
87
|
-
shutdown at task end); executors only ever SendMessage the warm agent
|
|
88
|
-
(Claude) or report to this session so it can consult the CLI advisor
|
|
89
|
-
(a third-party host). When the CLI chain cannot bind, fail closed and report
|
|
90
|
-
to the user — do not answer the four signals as this third-party session.
|
|
91
|
-
|
|
92
|
-
4. **Orchestrate the task.** Hold the plan and the user conversation. Execute
|
|
93
|
-
workflow-backed spawns or resumes using the routing table below, and keep
|
|
94
|
-
driving while they work. Every executor spawn includes the host-matched
|
|
95
|
-
Advisor block from step 3. Your own tool use stays orchestration and light
|
|
96
|
-
verification reads. Keep your task list updated religiously.
|
|
97
|
-
|
|
98
|
-
5. **Consult the shared advisor at hard decisions.** Every consumer — each
|
|
99
|
-
executor and this session — consults when one of these holds (same list as
|
|
100
|
-
the protocol and Advisor block):
|
|
101
|
-
- A nontrivial plan is about to be locked in and acted on.
|
|
102
|
-
- The consumer believes its assigned work is finished.
|
|
103
|
-
- A commit, push, or other hard-to-reverse action is about to run.
|
|
104
|
-
- The same failure has come back more than once, or progress has stalled.
|
|
105
|
-
- The chosen approach is being reconsidered.
|
|
106
|
-
|
|
107
|
-
**Claude host:** consult the shared `session-advisor` via `SendMessage`.
|
|
108
|
-
**Third-party host:** executors report to this orchestrating session; this session
|
|
109
|
-
consults the bound Claude CLI advisor (`claude_chain_runner.py` +
|
|
110
|
-
`--resume`) and relays the four-signal reply (no Agent-tool
|
|
111
|
-
`session-advisor`, no SendMessage to one). Every consult gets back one of
|
|
112
|
-
four signals (ENDORSE, CORRECTION, PLAN, or STOP). When the CLI advisor is
|
|
113
|
-
unreachable, fail closed and surface that to the user — do not invent a
|
|
114
|
-
signal as this session. See `agents/session-advisor.md` for what each
|
|
115
|
-
signal means and
|
|
54
|
+
1. **Invocation guard.** One `/orchestrator` per session. When the
|
|
55
|
+
refresh loop is already running, do not schedule a second one; reuse
|
|
56
|
+
the live advisor bind and go to step 4.
|
|
57
|
+
2. **Register the discipline reminder.** Schedule it with
|
|
58
|
+
`ScheduleWakeup` at `delaySeconds: 1800`, prompt
|
|
59
|
+
`/orchestrator-refresh`, where each refresh re-schedules the next one.
|
|
60
|
+
3. **Bind the shared advisor before any executor.** Follow
|
|
116
61
|
[`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md)
|
|
117
|
-
|
|
62
|
+
end to end: detect the host profile, compute the floor from the
|
|
63
|
+
orchestrator consumer set — this session plus every tier in the
|
|
64
|
+
routing table (its Model floor section) — walk the ladder top-down,
|
|
65
|
+
and fail closed when nothing binds. This session owns the advisor's
|
|
66
|
+
whole lifecycle (its Lifecycle ownership section); executors only ever
|
|
67
|
+
message the warm agent or report here, and an executor that finds the
|
|
68
|
+
advisor unreachable reports that upward — it never spawns a
|
|
69
|
+
replacement itself.
|
|
70
|
+
4. **Write the run artifacts** (next section) before the first spawn.
|
|
71
|
+
5. **Orchestrate.** Hold the plan and the user conversation. Spawn each
|
|
72
|
+
task with a ticket (Spawn ticket section), keep driving while
|
|
73
|
+
executors work, and keep the ledger reconciled (Task ledger
|
|
74
|
+
discipline).
|
|
75
|
+
6. **Consult the advisor at hard decisions.** The trigger list, consult
|
|
76
|
+
format, and reply handling live in the protocol's "Consulting the
|
|
77
|
+
warm agent" section; both this session and every executor are
|
|
78
|
+
consumers. Replies open with one of ENDORSE, CORRECTION, PLAN, or
|
|
79
|
+
STOP — `agents/session-advisor.md` defines each signal.
|
|
80
|
+
|
|
81
|
+
## Run state lives in artifacts
|
|
82
|
+
|
|
83
|
+
Write these before the first spawn, default home `docs/plans/<run-slug>/`
|
|
84
|
+
in the repo the run works on (working files, not committed):
|
|
85
|
+
|
|
86
|
+
- **Run charter** — the goal, the repo root, the advisor name and host
|
|
87
|
+
profile. One file every ticket points at.
|
|
88
|
+
- **One assignment file per task** — scope, file list, constraints, the
|
|
89
|
+
acceptance check, baseline command output. The thick context goes
|
|
90
|
+
here. `/prompt-generator` authors the assignment once at plan time,
|
|
91
|
+
and every ticket for that task reuses it — that reuse is what
|
|
92
|
+
satisfies the agent-spawn-protocol context check at each spawn.
|
|
93
|
+
- **Results merge into run state.** An executor's product is its
|
|
94
|
+
artifact — the branch diff, the test output, the report its agent type
|
|
95
|
+
may write — and its reply is thin: status, artifact paths, blockers.
|
|
96
|
+
The orchestrating session records each result into the run's result
|
|
97
|
+
files as it reconciles the ledger.
|
|
98
|
+
|
|
99
|
+
Correctness never rides on any agent's private context: when an executor
|
|
100
|
+
dies or hangs, point a fresh spawn at the same assignment file plus its
|
|
101
|
+
partial results and the run continues.
|
|
102
|
+
|
|
103
|
+
## Spawn ticket — the whole prompt
|
|
104
|
+
|
|
105
|
+
Every executor spawn prompt is this shape:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
Task: <one sentence, one deliverable>
|
|
109
|
+
Read first: <assignment file path>; <run charter path>
|
|
110
|
+
Touch only: <files or globs>
|
|
111
|
+
Done when: <one mechanical check — a command, a test, a diff scope>
|
|
112
|
+
Return: status, artifact paths, blockers — nothing else.
|
|
113
|
+
|
|
114
|
+
<host-matched Advisor block from advisor-protocol.md, advisor name filled in>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
- **Size the task by its done-check.** The right task is the largest
|
|
118
|
+
unit that fits one sentence plus pointers, has one mechanical
|
|
119
|
+
done-check, and needs no mid-run clarification. A task that does not
|
|
120
|
+
fit gets split in the plan — never padded into a longer prompt.
|
|
121
|
+
Explore fan-outs run tiny; a `clean-coder` assignment can carry a
|
|
122
|
+
whole scoped feature.
|
|
123
|
+
- **Do not restate what the agent definition carries.** The routing
|
|
124
|
+
table picks the definition, and `clean-coder` already holds the code
|
|
125
|
+
discipline. The ticket adds the task, the pointers, and the Advisor
|
|
126
|
+
block only.
|
|
127
|
+
- **The Advisor block is the one pasted paragraph.** It is host-matched
|
|
128
|
+
at bind time and written to be self-contained (the protocol's Advisor
|
|
129
|
+
block section) — paste it; do not point at it.
|
|
118
130
|
|
|
119
131
|
## Workflow Agent Routing
|
|
120
132
|
|
|
121
|
-
Every delegated task runs through a workflow-backed agent invocation. Do
|
|
122
|
-
spawn a flat subagent directly when a workflow invocation or
|
|
123
|
-
available.
|
|
133
|
+
Every delegated task runs through a workflow-backed agent invocation. Do
|
|
134
|
+
not spawn a flat subagent directly when a workflow invocation or
|
|
135
|
+
workflow resume is available.
|
|
124
136
|
|
|
125
137
|
| Work | Agent type | Model |
|
|
126
138
|
|---|---|---|
|
|
@@ -132,76 +144,78 @@ available.
|
|
|
132
144
|
|
|
133
145
|
Routing rules:
|
|
134
146
|
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
-
|
|
141
|
-
|
|
142
|
-
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
- Each row spawns workflow-backed with a ticket; the routing row and the
|
|
148
|
+
ticket together carry the agent type, model, task, and return
|
|
149
|
+
contract. A task category that maps to `clean-coder` on `opus` is not
|
|
150
|
+
served by a `general-purpose` Sonnet spawn — the table is the
|
|
151
|
+
contract, not a cost suggestion.
|
|
152
|
+
- Resume a warm workflow agent before creating a new workflow run when
|
|
153
|
+
the warm agent holds the relevant context.
|
|
154
|
+
- `clean-coder` owns code edits. `code-verifier` owns verification. The
|
|
155
|
+
same workflow agent never grades work it wrote.
|
|
156
|
+
- PR-description workflows include the actual changed-file list in the
|
|
157
|
+
prompt and verify the final body against that file list before posting
|
|
158
|
+
or returning it.
|
|
159
|
+
- Exploration workflows return file paths, line numbers, and direct
|
|
160
|
+
evidence; they do not write code or mutate repo state.
|
|
147
161
|
- Fan-out worker fleets use the **grok-spawn** skill when that skill is
|
|
148
|
-
installed and grok is usable (`grok_worker_preflight.py` soft gate).
|
|
149
|
-
Claude Code Agent tool remains the Claude-host alternative for
|
|
150
|
-
workers.
|
|
151
|
-
|
|
152
|
-
## Agent reuse
|
|
153
|
-
|
|
154
|
-
- **Resume before you spawn
|
|
155
|
-
cached tokens; a fresh spawn
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
- **Spawn a fresh agent only when** no existing agent holds relevant
|
|
160
|
-
or a genuine task switch needs a clean context.
|
|
161
|
-
- **
|
|
162
|
-
|
|
162
|
+
installed and grok is usable (`grok_worker_preflight.py` soft gate).
|
|
163
|
+
The Claude Code Agent tool remains the Claude-host alternative for
|
|
164
|
+
in-process workers.
|
|
165
|
+
|
|
166
|
+
## Agent reuse
|
|
167
|
+
|
|
168
|
+
- **Resume before you spawn.** A warm agent (active within the past 59
|
|
169
|
+
minutes) carries its context and cached tokens; a fresh spawn pays to
|
|
170
|
+
rebuild both. Resume by name, or by `agentId` for an unnamed
|
|
171
|
+
background spawn — keep the `agentId` (format `a...-...`) from the
|
|
172
|
+
spawn result so `SendMessage` can reach that agent later.
|
|
173
|
+
- **Spawn a fresh agent only when** no existing agent holds relevant
|
|
174
|
+
context, or a genuine task switch needs a clean context.
|
|
175
|
+
- **Reuse is a cost rule, not a correctness dependency.** The run
|
|
176
|
+
artifacts keep every executor replaceable (Run state section).
|
|
177
|
+
- **Name the agent to resume.** When a PLAN from the shared advisor fits
|
|
178
|
+
a warm agent, name which agent to resume and where.
|
|
163
179
|
|
|
164
180
|
## Task ledger discipline
|
|
165
181
|
|
|
166
|
-
The task list is the run's ledger, and it must be reconcilable against
|
|
167
|
-
agents at any moment. Four invariants hold at all times:
|
|
182
|
+
The task list is the run's ledger, and it must be reconcilable against
|
|
183
|
+
the live agents at any moment. Four invariants hold at all times:
|
|
168
184
|
|
|
169
|
-
1. **No untracked work.** Every unit of delegated work has a task BEFORE
|
|
170
|
-
executor spawns — TaskCreate first, then Agent.
|
|
171
|
-
2. **Ownership is live.** At spawn, set the task `in_progress` with
|
|
172
|
-
the executor's agent name. One task, one owner.
|
|
173
|
-
3. **Completion follows evidence.** A task turns `completed` only when
|
|
174
|
-
executor's result is back AND merged into run state —
|
|
175
|
-
never on
|
|
176
|
-
|
|
177
|
-
|
|
185
|
+
1. **No untracked work.** Every unit of delegated work has a task BEFORE
|
|
186
|
+
its executor spawns — TaskCreate first, then Agent.
|
|
187
|
+
2. **Ownership is live.** At spawn, set the task `in_progress` with
|
|
188
|
+
`owner` = the executor's agent name. One task, one owner.
|
|
189
|
+
3. **Completion follows evidence.** A task turns `completed` only when
|
|
190
|
+
the executor's result is back AND merged into run state — the run's
|
|
191
|
+
result files and the task record — never on dispatch, never on a
|
|
192
|
+
self-report alone (see `workers-done-before-complete`).
|
|
193
|
+
4. **Dependencies mirror the plan.** Phase order is encoded as
|
|
194
|
+
`blockedBy` links, updated the moment the plan changes.
|
|
178
195
|
|
|
179
|
-
Reconcile on every state change (spawn, completion notification, plan
|
|
180
|
-
and on every `/orchestrator-refresh` firing.
|
|
196
|
+
Reconcile on every state change (spawn, completion notification, plan
|
|
197
|
+
change) and on every `/orchestrator-refresh` firing.
|
|
181
198
|
|
|
182
199
|
## Constraints
|
|
183
200
|
|
|
184
201
|
- One `/orchestrator` per session; the invocation guard blocks a second
|
|
185
202
|
reminder loop.
|
|
186
|
-
- The orchestrating session
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
-
|
|
190
|
-
|
|
191
|
-
- One shared advisor per orchestrated session, owned by
|
|
192
|
-
|
|
193
|
-
[`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md))
|
|
194
|
-
— on Claude, executors consult a warm `session-advisor` via SendMessage; on
|
|
195
|
-
a third-party host, executors report here and this session relays the Claude CLI advisor.
|
|
196
|
-
Executors never spawn or respawn the advisor.
|
|
197
|
-
- Reuse a warm agent over a cold spawn whenever one holds relevant context.
|
|
203
|
+
- The orchestrating session never edits code or runs a build or test
|
|
204
|
+
itself — executors do that. Its own tool use stays orchestration,
|
|
205
|
+
run-artifact writes, and light verification reads.
|
|
206
|
+
- Every delegated task carries a ledger entry, an assignment artifact,
|
|
207
|
+
and a workflow-backed spawn with a ticket, routed by the table.
|
|
208
|
+
- One shared advisor per orchestrated session, owned by this session per
|
|
209
|
+
the protocol; executors never spawn, respawn, or shut it down.
|
|
198
210
|
|
|
199
211
|
## File Index
|
|
200
212
|
|
|
201
213
|
| File | Purpose |
|
|
202
214
|
|---|---|
|
|
203
|
-
| `SKILL.md` | Orchestrator strategy,
|
|
215
|
+
| `SKILL.md` | Orchestrator strategy: design rule, process, run artifacts, spawn ticket, routing table, reuse rules, ledger invariants, constraints. |
|
|
204
216
|
|
|
205
217
|
## Folder Map
|
|
206
218
|
|
|
207
|
-
- `SKILL.md` — complete orchestrator workflow instructions.
|
|
219
|
+
- `SKILL.md` — complete orchestrator workflow instructions. Advisor
|
|
220
|
+
policy lives in
|
|
221
|
+
[`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md).
|