agentleFS
domucchidomucchi/pi-setup/skills/subagents/SKILL.md

subagents

Skill0 starsChanged 4 months agoMITView on GitHub

Model routing and delegation doctrine for subagents. Load when spawning subagents to pick agent types, models, and thinking levels.

12 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use when the work wants Claude's judgment/taste, or a second opinion from a different model family.

    line 21
  2. Very specific:

    Default worker/explore (pi backend): stays in-process, inherits the session model — right for most bounded tasks.

    line 31
  3. Very specific:

    Default: omit model — pi children inherit the parent session's model and thinking level.

    line 62
  4. Distinctive:

    Use subagent_send for retries with feedback ("your fix broke test Y — rerun and fix") instead of spawning fresh and losing context.

    line 79
  5. Distinctive:

    After two failed rounds on the same child, take the work back.

    line 81

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Subagent routing doctrine

Mechanics (spawn/send/wait semantics, self-contained prompts, caps) are in the tool descriptions. This file is the user's routing policy — edit freely; it is read at load time, no code changes needed.

Agent types

  • explore — read-only scouting: locating code, mapping subsystems, answering "where/how does X work". Cheap to parallelize; prefer it whenever the task does not require edits.
  • worker — full-tool execution: bounded implementation tasks with a runnable check ("fix X and run the tests", "apply this rename").
  • claude — a real Claude Code instance (Anthropic models on the Claude subscription, full Claude Code toolset, permissions bypassed). Use when the work wants Claude's judgment/taste, or a second opinion from a different model family. Supports mid-run steering via subagent_send.
  • codex — a real Codex instance (GPT models on the Codex subscription, shell/apply_patch/web-search, sandbox bypassed). Cheap abundant capacity for bulk or mechanical work. No mid-run steering — wait for settle, then send follow-ups.

Backend routing

  • Default worker/explore (pi backend): stays in-process, inherits the session model — right for most bounded tasks.
  • Reach for claude when taste/judgment matters (user-facing text, API design, tricky reviews) or when Claude-only models are wanted — they are unavailable inside pi itself.
  • Reach for codex for parallel bulk work where capacity beats nuance (sweeps, mechanical refactors, independent investigations).
  • External children cannot see pi tools or this session; their prompts must be fully self-contained (same rule as always, more so).
  • model on claude/codex spawns is passed through natively (see the roster below) — never pi provider/model ids.

Model roster (verified against the installed CLIs)

claude backend — pass an alias: sonnet, opus, or fable. Omit for the Claude Code default. Never use haiku. thinking maps to Claude Code effort (low/medium/high; off/minimal clamp to low; xhigh/max exist but require explicit user approval first — house rule).

codex backend — pass a model id; thinking maps to codex reasoning effort (minimal/low/medium/high accepted; xhigh/max exist but require explicit user approval first — house rule):

model iddefault effortnotes
gpt-5.6-solhighfrontier; hard problems
gpt-5.6-terrahighworkhorse
gpt-5.6-lunahighcheapest bulk capacity

Model and thinking selection

Default: omit model — pi children inherit the parent session's model and thinking level; claude/codex children use their CLI defaults.

<!-- | Work shape | Agent type · model | Thinking | | --------------------------- | ---------------------- | -------- | | broad read-only scouting | explore | low | | implementation with checks | worker | medium+ | | bulk mechanical sweeps | codex · gpt-5.6-luna | low | | independent hard analysis | codex · gpt-5.6-sol | high | | taste-sensitive review | claude · sonnet/opus | medium | -->

Delegation rules

  • One subagent = one bounded mission with a clear report format.
  • Parallel fan-out: spawn several explores, keep working, wait once.
  • Use subagent_send for retries with feedback ("your fix broke test Y — rerun and fix") instead of spawning fresh and losing context.
  • After two failed rounds on the same child, take the work back.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.