Skip to content
Back to skills

Orchestrating Subagents

ASecurity

Load BEFORE dispatching a subagent (Agent/Task tool) or running several agents at once: writing a brief, choosing agent type or model, fanning a plan out in parallel (worktrees, ports, shared database), a fix round after a review, replacing a silent agent, or following superpowers' subagent-driven-development or dispatching-parallel-agents, which these rules override.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
ai-agentspythonrustgosqlnodedockerdebugginggitdatabasesecurity

Works with

  • cli
  • mcp

Security analysis

A100/100

Scanned December 5, 2026

npx -y skills add Borcioo/rigger-claude-code --skill orchestrating-subagents --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Orchestrating Subagents?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Orchestrating Subagents
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/borcioo-orchestrating-subagents/badge)](https://www.skillsdirectory.com/skills/borcioo-orchestrating-subagents)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: orchestrating-subagents
description: >-
  Load BEFORE dispatching a subagent (Agent/Task tool) or running several agents at once: writing
  a brief, choosing agent type or model, fanning a plan out in parallel (worktrees, ports, shared
  database), a fix round after a review, replacing a silent agent, or following superpowers'
  subagent-driven-development or dispatching-parallel-agents, which these rules override.
---

# Orchestrating subagents

Overrides superpowers' subagent-driven-development and dispatching-parallel-agents where they
differ: implementation agents may run in parallel in separate worktrees; a fresh implementation
agent after the first fix round; one review per plan, plus a per-task review on the risk floor; a
change on the risk floor also gets a second fresh reviewer after the first review's fix round; a silent
agent is checked after 20 minutes.

Words used below. **Risk** is the mark a brief gives its change, `full` (on the tests rule's risk floor) or
`low`; a full change gets a red run per new guard
(the guard's code mutated once, the failing test shown) and a fresh reviewer. A **gate** is the project's full check command. A **merge point** is a
merge of finished work into the integration branch (the branch parts merge into before the default
branch). A **phase** is a group of plan tasks that merge together; its **backlog** holds the Minor
findings fixed once at the phase's end.

## Parallel work

- "A separate agent" means a subagent. Start a separate session only when the user asks for one,
  the work ends in its own branch, PR or repo, or `/rigger-core:coordinate` runs a plan (the sessions
  its step 2 lists).
- In the Orca app, a handoff (work given to another agent with nothing expected back) follows Orca's
  own CLI guide. An approved plan whose parts run as separate sessions (phases, parallel parts, one
  PR per part) goes through `/rigger-core:coordinate`, which runs them as Orca workers, unless the
  user says to do it here; subagents in worktrees (next bullet) stay as they are. Never chain such
  parts with Orca's task DAG (`--deps`): it frees the next part once the previous worker reports
  success, before review or merge.
- Run independent areas in parallel, each with its own worktree (a path outside the repo), port and
  scratch subfolder (`<scratch>/<task>`), all named in the brief. Stay sequential where files overlap. The
  same holds for separate sessions: one that writes works in its own worktree, not the shared
  checkout (except under the shared-tree bullet below). First `git worktree list` shows which
  branches others hold and `git -C <path> status --short` on each the files they touch; stay out of
  those. On macOS/Linux a worktree may symlink `node_modules` only when it is absent (`[ -e node_modules ] || ln -s …`; `ln -s` into an existing dir nests the link and the runner loads two copies); never link `vendor` (Composer then loads the main checkout's code), and on Windows copy or install instead.
- A worktree session that fails to start is reproduced by hand before any retry (`git worktree add -b claude/probe <path>`, removed after). The desktop app names branches `claude/<slug>`, which git refuses while a local branch `claude` exists (`git branch --list claude`).
- A plan names for each task what it needs (a sha, a file, a decision) and which files it writes;
  tasks with disjoint files start as soon as their inputs exist, up to the load limit. An "A → B"
  order needs a reason. Split a worker that spans several plugins or folders into one per folder.
- A spec names the class, task or hook it integrates with only after tracing this case's runtime
  path to it (CMS, branch, entry point): that point decides whether existing guards wrap the new
  code or are bypassed. A plan never names two files in one folder that differ only in case or
  extension (`userFilters.ts`, `UserFilters.tsx`): a case-insensitive file system
  resolves an extensionless import to one of them.
- Settle an architecture fork (two designs with different build work) with the user before
  building on either; offer the simpler one first.
- While a question waits for the user, start the read-only work that follows; ask independent
  questions together in one card.
- Keep to the machine's load rule (on Windows with rigger-platform installed:
  `rigger-platform:windows-dev-env` "Machine load") and the e2e lock rules in
  `rigger-core:e2e-playwright-speed` §9. Light agents (reviews, Python or pwsh unit tests, docs)
  have no count limit; a build or test agent starts only while `mem-check` exits 0 on Windows, Linux or macOS (`python "<rigger-core plugin folder>/tools/mem-check/mem_check.py"`
  prints the minimum); elsewhere check free memory with the OS's tool.
  Heavy jobs (WSL, Docker, wp-env, e2e) run at most 2 at once.
  Without a lock, count the heavy jobs you dispatched that are still running, and wait while the
  limit is reached; the sessions of one coordinator share these 2 slots, and the coordinator counts
  them, lock or not. The plan names the suites that assert on timing: their final tally runs alone,
  or the brief states the N-of-10 pass threshold. A brief for sessions that run in parallel names its unit-test gate with a worker cap (e.g. `npx vitest run --maxWorkers=2`). A full run that is red only under load is rerun once alone with the cap: a pass there is reported as load-sensitive with both outputs, never as a plain pass.
- The site the user clicks through runs a pinned checkout of reviewed commits, never a tree agents
  edit.
- **Before dispatching agents that test against one database or site, read what the shared test
  setup and cleanup delete** (a purge by project prefix wipes other agents' data). Serialise DB
  tests with a lock, or give each agent data of its own (`rigger-core:e2e-playwright-speed` §2), and keep
  scripts that write real data out of agents' hands while others compare screens. Before
  fanning out over one database server, run the same database test from two worktrees at once:
  a framework that names test databases by test path (sqlx) or uses one fixed test database
  needs a per-worktree namespace or a lock around every test run, not only around the gate.
- **Where a tree has to be shared anyway** (a mounted environment, a checkout nobody could split),
  every edit leaves the code runnable: add the callee before the call, or make the whole change in
  one edit. When an HTTP or browser check goes red there, read the server log for a fatal in a file
  outside your own list before debugging your own code, and rerun after the other agent's commit.

## Briefs

The main session is the orchestrator: it assigns each task to a fitting agent and model, checks
results against evidence, answers questions and helps when a task is too hard; it never only
relays.

Contact runs both ways. An agent or side session that is unsure, or has failed the same step
twice, stops and asks whoever started it, stating what it tried, what it saw and what it needs. A
subagent without SendMessage does this as a blocked report and is resumed with the answer. A side
session never asks the user unless the orchestrator says so. A side session a coordinator started
sends its result or question to it with SendMessage (to the session that started it) before it
ends the turn; a turn end alone is not a report. A side session dispatches the subagents
whose results its turn reports in the foreground; parallel ones go as several Agent calls in one message.

The orchestrator answers, splits the task or moves it to a stronger model with the last report. A
failure on the stronger model goes to the user with the diagnosis.

- **Main-session context is the scarce budget.** While planning or orchestrating, send reading whose
  conclusion you need, not its text (a whole file over ~200 lines, a `--help` or directory dump, an
  unfamiliar repo), to an `Explore` subagent (a conclusion) or the `mapper` slot's agent (locations only). A brief
  that starts a session or a multi-task agent repeats this, names each skill with the step it
  covers and never says to read skills up front.
- Agent type: the `worker` slot for implementation, the `reviewer` slot for review or
  verification (table `## Slots`; an agent's description says when another type fits). Both load skills themselves and can
  use a browser: the brief names the skills the task needs, the browser, if any, and the Risk mark. Set `model` on every dispatch
  except a slot whose Model is `pinned`; an agent dispatched without one inherits yours.
- A reviewer slot of kind `command` is run with the command under `## Slots`, not dispatched: its last
  line is the result, and `slot-run: refused` is handled like a `STATUS: BLOCKED` report, never as no
  findings. Check an agent reviewer's closing JSON with
  `tools/slot-check/slot_check.py reviewer <reply file> --base <base> --head <head>` from the
  rigger-core plugin root; a refusal is a failed review.
- Any skill or MCP server the task needs, a project's own included: name it in the brief.
- Every reviewer brief names a scratch folder outside the reviewed tree for mutant copies and temp
  configs; without one the reviewer runs no mutants.
- Follow `templates/implementer-brief.md` at the rigger-core plugin root (two folders above this
  skill's folder). Every brief
  carries the project's pitfalls list (project CLAUDE.md; create the section if missing), every
  lesson captured this session, and the exact gate commands. A brief has no Context or Background
  section: every line is an instruction, an input or an output (the template's Plan context field
  carries constraints and stays).
- Strongest model for security-sensitive work, design, every final review and the review of a
  part on the risk floor; `sonnet` for mechanical edits, the review of a part off the floor and
  re-reviews inside a fix round. A review brief asks for correctness only: no style or naming. Never `haiku` for review or
  verification: it reports false findings.
- Every brief's first line is the bare `Job: <plan>.<task>.<stage>`, side-session briefs too:
  `<plan>` is the plan file name without `.md` (outside a plan, a label such as an issue number),
  `<task>` is `t<N>`, and `<stage>` is one of `build`, `review`, `fix`, `rereview` or `second`.
  `tools/token-audit/token_audit.py job --job <id> --session <session id>`, run from the rigger-core
  plugin root, matches the id exactly and reads subagent transcripts only, so a stage's cost is one
  `job` call per id and a plan's cost is the sum of those calls; the final report ends with them.
- Run each gate command once yourself before it goes into a brief; pilot one unit the whole way
  (full gates, every test, registry and pinned list it edits) before fanning out or calling units
  file-disjoint. Every count, line number, baseline or code value a plan or brief
  names comes from a command run now and pasted (`git ls-files` for file counts, the gate's own
  scanner for lines), or from reading every route that sets the value, never from a summary. A count passed between
  agents names its unit and the tree or commit it was counted on; recount an agent's total before
  relaying it, and on the risk floor have a read-only reviewer re-measure a sample of a builder's
  own visual measurements.
- After the first fix round, dispatch a fresh implementation agent (brief + last report) instead of
  resuming.
- A report whose first line is `STATUS: PARTIAL` or `STATUS: BLOCKED` is accepted only with the exact call, its raw output and one
  alternative route with its raw output. Re-run the failing call once, in the agent's worktree with
  the brief's environment. Still red: the blocker stands; fix it at the source or ask the user
  (inside an approved plan, block that part and list it in the final summary).
  Green after one command or setting: a shortcut or a brief gap; append it to the
  lessons inbox where the `lessons` slot is filled (`lessons-inbox.md` in the config dir) and put it in the next briefs.
- Check any agent silent for 20+ minutes; when one reports waiting on background work, check at
  once that the process runs and its output is fresh, and again within 20 minutes. A session that
  waits runs one background check that exits on the condition (a Monitor prints only that line)
  and ends a turn only with a result or a decision, never "still waiting". The condition is the started
  PID's exit or an end marker the script writes last, on failure too, never a guessed count of
  output lines (a wait for 29 lines met 28 and held a task open for 40 minutes); every wait loop
  has a time bound and prints why it stopped.
- Work inherited from an agent that stopped mid-task is unverified: run it before reading it as
  done. Compare each agent's reported changes (Commits, `git diff --stat`) with
  `git status --porcelain` before trusting its report.
- A status over a side session's unattended period reads every message of that period and searches
  them for breaches, irreversible steps and scope changes before reporting; bad news leads.
- A clone whose licence forbids sending its source to the model is deleted once its metadata is read,
  or kept outside any folder a later agent searches; every later brief repeats the exclusion.

## Fix rounds and progress

- Fix rounds take Critical and Important findings, and each entry of the reviewer's `SHORTCUTS:` line counts as Important;
  Minor findings go to the phase backlog, fixed once per phase. A finding that needs a design
  decision (new mechanism, global side effect, data deletion) gets a short plan, reviewed before any
  implementer starts. A part gets at most one fix round and one scoped re-review: a re-review with no Critical or
  Important finding in the part's range ends its review, and a finding in the part's range after that re-review stops
  the part for a re-plan; `coord_state.py` refuses its next `move <part> started` without `--replan <plan path>` (a
  move from `blocked` counts when the part entered `blocked` from `built` or `reviewed`). A fix-round or re-review brief carries the findings and nothing else (no "make it cheaper if safe"), naming each finding moved to another task with the task that takes it; a performance change in a safety check
  is its own task.
- A re-review brief names the part's merge base, its head before the fix and the fix diff. A finding
  introduced between the part's merge base and its head enters the fix round and blocks the merge,
  whatever the fix diff was. Only a defect present at the part's merge base is `Pre-existing`. A
  `Pre-existing` finding with evidence never enters the author's fix round; the orchestrator files a
  Minor one to the phase backlog and proposes a separate session for a Critical or Important one
  (one per bug), at once for a Critical in floor code.
- A Critical finding goes to two fresh read-only agents of the `reviewer` slot only when the author
  disputes it with a quoted `file:line`; they check it in the code, it is fixed when both confirm,
  and on a split the orchestrator decides from their evidence. An undisputed Critical goes straight
  to the fix round.
- A re-review gets the fix diff, the findings it answers and the author's red-run output, and re-runs only the red runs (mutations) on changed lines, against every test file that covers them, never every red run of the change; it reviews whole only the files the first review did not see.
- The second round's agent of the `reviewer` slot gets the first review's findings with their
  outcomes and the fix diff, and is asked only for what the first did not find; a Critical or
  Important finding of it in the part's range stops the part for a re-plan, as after the
  re-review, never a third fresh round. On a floor part it is the part's one scoped re-review.
- A finding is marked `disputed` only with a quoted `file:line` that proves it wrong, and one about
  concurrency, bounds, behaviour or compatibility, authorisation, money or data goes to a fresh
  reviewer first.
- With the `reviewer` slot empty, the review is blocked: report it as `BLOCKED` with the install
  line from the session notice, or the `slot reviewer` line `/rigger-core:doctor` prints when there
  is none; never skip the review or give it to an agent outside the slot.
  Inside an approved plan it is a stop: block that part, merge nothing of it and report it with
  that line.
- The orchestrator records each finding's outcome in the state file under `## Findings`, one line
  each: `<finding> · <severity> · <outcome>`, the outcome being fixed, disputed, intentional or
  pre-existing-deferred.
- The orchestrator runs the full gate once per batch of parts at a merge point (at most 4 parts, a
  part on the risk floor alone; `/rigger-core:coordinate` step 5), in the background, not after
  every agent.
- Update the visible task list when each subagent returns and say how many tasks remain: the user
  follows progress there.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.