From 0895615a59e52f9636deb4f1187a9234e241b50c Mon Sep 17 00:00:00 2001 From: Casey Capshaw Date: Thu, 9 Jul 2026 09:54:31 -0600 Subject: [PATCH] Add meta/agent-roles/ named CMUX worker roles + AGENTS.md guidance Gives CMUX workers a named identity instead of a blank agent: one system-prompt fragment per KB-native role (research, compile, lint, initiative-worker) mapped onto this kit's own raw->compile->index->lint verbs and initiative-delegation model, not a generic app-build split. Plain files under meta/agent-roles/, not auto-discovered agent-type config -- keeps them from leaking into ordinary sessions and avoids resting on an untested assumption about the MCP-bloat problem already documented for native subagents. AGENTS.md also notes that launch steps can be wrapped behind a custom slash command/macro if the agent CLI supports one, without shipping one as a literal file. Both CMUX runbooks' launch steps updated to append the matching role file (absolute path, since a worker's cwd may not be the vault). --- ...egate an initiative to a CMUX workspace.md | 10 +++-- ...pawn subagent panes in a CMUX workspace.md | 11 ++++-- meta/AGENTS.md | 18 +++++++++ meta/agent-roles/compile.md | 37 +++++++++++++++++++ meta/agent-roles/initiative-worker.md | 33 +++++++++++++++++ meta/agent-roles/lint.md | 32 ++++++++++++++++ meta/agent-roles/research.md | 27 ++++++++++++++ 7 files changed, 162 insertions(+), 6 deletions(-) create mode 100644 meta/agent-roles/compile.md create mode 100644 meta/agent-roles/initiative-worker.md create mode 100644 meta/agent-roles/lint.md create mode 100644 meta/agent-roles/research.md diff --git a/Jobs/Delegate an initiative to a CMUX workspace.md b/Jobs/Delegate an initiative to a CMUX workspace.md index a7a8e1a..4c706a9 100644 --- a/Jobs/Delegate an initiative to a CMUX workspace.md +++ b/Jobs/Delegate an initiative to a CMUX workspace.md @@ -58,9 +58,12 @@ delegated workspace's `backlog.md`. ``` 5. **Launch the delegated Claude Code** into the lead surface (pick the model by task weight — a cheaper model for well-scoped execution, a more capable one - for heavy reasoning): + for heavy reasoning). If your agent CLI supports a system-prompt flag, + append `meta/agent-roles/initiative-worker.md` (absolute path — the + workspace's cwd is the target repo, not your vault) to give it that role + — "the note is the record, not the pane" — instead of a blank agent: ```bash - cmux send --surface "$LEAD" "claude --model --strict-mcp-config --mcp-config '{\"mcpServers\":{}}'" + cmux send --surface "$LEAD" "claude --model --strict-mcp-config --mcp-config '{\"mcpServers\":{}}' --append-system-prompt /meta/agent-roles/initiative-worker.md" cmux send-key --surface "$LEAD" enter sleep 4 ``` @@ -122,7 +125,8 @@ delegated workspace's `backlog.md`. - [ ] The `DONE:` sentinel was confirmed via `read-screen` (not assumed from a notification). ## Related -- `meta/AGENTS.md` § Optional extensions — the model + why (the two-interface split, the round-trip rule). +- `meta/AGENTS.md` § Optional extensions — the model + why (the two-interface split, the round-trip rule, `meta/agent-roles/`). - [[Spawn subagent panes in a CMUX workspace]] — sibling runbook for pane-level fan-out. - [[Run an initiative]] — creates/maintains the `Initiatives/` note this delegates against. +- `meta/agent-roles/` — the role-prompt files this runbook launches. - [[AGENTS]] diff --git a/Jobs/Spawn subagent panes in a CMUX workspace.md b/Jobs/Spawn subagent panes in a CMUX workspace.md index b77e897..fc6518b 100644 --- a/Jobs/Spawn subagent panes in a CMUX workspace.md +++ b/Jobs/Spawn subagent panes in a CMUX workspace.md @@ -46,10 +46,14 @@ the heavy editing itself once workers exist.** --surface "$W1" "🔬 research-A"` (repeat per worker); optional `cmux trigger-flash --surface "$W1"` to point at one. 4. **Launch an agent in each pane** (a cheaper/faster model for well-scoped legs). - `send` the CLI line, then `send-key enter`, and give it a moment to boot: + `send` the CLI line, then `send-key enter`, and give it a moment to boot. If + your agent CLI supports a system-prompt flag, append one of the role files + in `meta/agent-roles/` (`research`, `compile`, `lint`, `initiative-worker` — + or your own) so the worker gets a named identity instead of a blank agent. + Use an **absolute path** — the pane's cwd may not be your vault: ```bash for S in "$W1" "$W2" "$W3"; do - cmux send --surface "$S" "claude --model --strict-mcp-config --mcp-config '{\"mcpServers\":{}}'" + cmux send --surface "$S" "claude --model --strict-mcp-config --mcp-config '{\"mcpServers\":{}}' --append-system-prompt /meta/agent-roles/research.md" cmux send-key --surface "$S" enter done sleep 4 @@ -114,6 +118,7 @@ the heavy editing itself once workers exist.** - [ ] Finished panes torn down with `close-surface`. ## Related -- `meta/AGENTS.md` § Optional extensions — the model + why (the four-verb loop, coordination patterns, model policy). +- `meta/AGENTS.md` § Optional extensions — the model + why (the four-verb loop, coordination patterns, model policy, `meta/agent-roles/`). - [[Delegate an initiative to a CMUX workspace]] — sibling runbook for workspace-level (whole-task) delegation. +- `meta/agent-roles/` — the role-prompt files this runbook launches. - [[AGENTS]] diff --git a/meta/AGENTS.md b/meta/AGENTS.md index 1f2eca9..31c09a1 100644 --- a/meta/AGENTS.md +++ b/meta/AGENTS.md @@ -137,3 +137,21 @@ file reads, and that same bloat can make an in-process subagent/Task tool unusable — which is exactly why explicit, lean pane workers are the reliable path. Entirely optional — skip it if you're not running a multi-agent terminal tool. + +Optionally, give workers a **named identity** instead of a blank agent: drop +one system-prompt fragment per role in `meta/agent-roles/` (a starter set — +`research`, `compile`, `lint`, `initiative-worker` — maps onto this KB's own +raw→compile→index→lint verbs and its initiative-delegation model, not a +generic app-build split) and pass one via your agent CLI's system-prompt flag +when launching a worker (e.g. +`--append-system-prompt /meta/agent-roles/.md`, with an +**absolute path** — a worker's cwd may not be your vault). These are plain +files, not anything your agent CLI auto-discovers as +a built-in subagent type — that keeps them from leaking into ordinary, +non-orchestration sessions, and sidesteps betting on whether a restricted +tool list would dodge the MCP-bloat problem above for a native subagent path +too. If your agent CLI supports custom slash commands or macros, wrapping +these launch steps behind one (e.g. `/spawn ` that reads the +matching `meta/agent-roles/.md` and walks the runbook) turns a several- +step launch into a one-line invocation — worth doing once the pattern is used +often enough to be worth automating. diff --git a/meta/agent-roles/compile.md b/meta/agent-roles/compile.md new file mode 100644 index 0000000..f56dadc --- /dev/null +++ b/meta/agent-roles/compile.md @@ -0,0 +1,37 @@ +--- +role: compile +model: — a cheaper/faster model where appropriate +mcp: none (e.g. --strict-mcp-config --mcp-config '{"mcpServers":{}}' if your agent CLI supports it) +sentinel: "DONE: compile-