Skip to content
Back to skills

Subagent Design

ASecurity

Decide whether a task needs several agents and design them if it does — one-mission role cards with typed output contracts, a topology (pipeline / parallel / judge panel) chosen with a reason, context-isolation rationale, and a verification stage that is never a generator — or fold an existing multi-agent system back into one agent loop with skills and tools, one subagent at a time against an end-to-end eval. Use when the user wants to fan work out across multiple agents, design a multi-agent...

  • 2 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 19, 2026
ai-agentsrustgoapi

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add sananthanarayan/skilldrop --skill subagent-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Subagent Design?

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

Security grade badge for Subagent Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sananthanarayan-subagent-design/badge)](https://www.skillsdirectory.com/skills/sananthanarayan-subagent-design)

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: subagent-design
description: Decide whether a task needs several agents and design them if it does — one-mission role cards with typed output contracts, a topology (pipeline / parallel / judge panel) chosen with a reason, context-isolation rationale, and a verification stage that is never a generator — or fold an existing multi-agent system back into one agent loop with skills and tools, one subagent at a time against an end-to-end eval. Use when the user wants to fan work out across multiple agents, design a multi-agent workflow or orchestration, asks "should this be one agent or several", or wants to simplify, consolidate or fold subagents.
---

# subagent-design

Produces an **orchestration plan**: which subagents exist, what each one alone is for, how their outputs compose, and who checks the result — or a **fold plan** that takes an existing multi-agent system back toward one agent loop. The default answer to "should this be several agents?" is **no** — one context that fits is always simpler, and skills and tools loaded on demand now fix most of what used to force a split; fan out only when a plan survives step 1. Two skilldrop skills are ready-made instances of the patterns worth copying — `council-review` (a judge panel of independent perspectives) and `devils-advocate` (an adversarial verifier that isn't the generator) — cite them as patterns even where they aren't installed. What the fleet may spend belongs to `agent-budget`.

## How to respond

**Four rules come before the steps and outrank them:**

- **Answer what was asked, first.** Open with the answer, the decision or the artifact, in plain words. Scores, matrices, frameworks and tags come after it, and anything that doesn't change the answer is cut.
- **Use only what you were given.** Don't add facts, names, numbers, incidents, history, steps or sections the input doesn't contain. What you need and don't have is left out of the artifact and listed once at the end under "To confirm".
- **Deliver from what you have.** When the request gives you something to work on, state your assumptions in a line and produce the result. When it gives you nothing to work on, ask for it in one or two plain sentences and say what you will do once you have it.
- **Write for someone who has never heard of this skill.** No skill names, no paths or scripts from this folder, no internal terms, and nothing about how the run was set up. A next step is one plain sentence at the end that describes the work.
- **For this skill:** A word limit or a requested shape is kept exactly. A decision the user has stated (a check they want kept, a part they want to keep) is followed; a concern about it is one line, never an override. A yes-or-no question gets yes or no and the reason in two or three sentences. A design names what each agent checks, with what tools, and what the final report contains. Budget numbers come from the user or are left out.

1. **Justify the fan-out or refuse it.** First try the single-loop fix. When the pull toward splitting is a long or self-contradicting system prompt, a context crowded with instructions, or tool choice going wrong (it degrades past roughly 30–50 tool definitions), the fix is usually inside one agent: move procedures into skills loaded when needed, put hard limits and lookups into tools, and group tools by what the user is trying to do (or load them through tool search). Split only what still fails after that. Then exactly four reasons earn multiple agents — name which applies, or recommend a single agent and stop:
   - **Context separation**: the task spans more material than one context holds well even with instructions loaded on demand, and it partitions cleanly (per-module audit, per-source research), each part handing back a compact result.
   - **Independence**: judgments must not contaminate each other — reviewers, estimators, hypothesis-testers whose value is that they haven't seen each other's answers.
   - **Role conflict**: one agent can't hold both jobs honestly — the generator must not grade itself; the negotiator must not also be the auditor.
   - **Permission separation**: one part needs a capability the rest must never hold (writing to production, sending money, using a customer's credentials), and isolating it is cleaner than gating every call. Users with different access levels are not this: each tool checks what the calling user may see or do and returns a plain refusal, so one loop serves all of them.

   **Folding an existing system:** when the user already runs several agents, plan the fold before adding anything. Fold tightly coupled specialists first: the ones that call each other in sequence, share data, or are almost always used together. Fold one at a time: its prompt becomes a skill, its API calls become tools. As an intermediate step, the main agent can call a subagent as a tool (shared response schema, trimmed input) so the main agent keeps the conversation; hand the user over to a subagent only when it must talk to them directly. Keep a subagent only where the folded version scores worse on an end-to-end eval owned by one small central team: build it from what they already record (a replay of real past cases with their logged outcomes, then a small live share of traffic) and, where nothing is recorded, about ten golden tasks to start. Final answers are graded against a rubric and each task run at least twice, because a skipped tool call can show up in one run of two. The eval has a task for every chain of agents that runs together in production and for every rule the system must not break; compare which tasks flipped, not only the score. Start with the most-used subagents, and one-agent-per-team designs are the first candidates. Say where each thing the subagent held goes: procedure to a skill, actions and live data to tools, a precondition or a per-user permission into the tool that needs it, reference facts behind a lookup, and a router or planner to nothing. Say who owns what afterwards: one central team owns the system prompt and end-to-end quality and vets each new skill, tool and eval; each team owns its skills and tools. The detail for each of these is in [`reference.md`](reference.md).

   "It would be faster" alone is not on the list — parallelism is a consequence of separation, not a reason to manufacture it. Non-interactive run (no user to ask): derive the task from the input, tag assumptions `[assumption]`; no task derivable → emit `BLOCKED: need the task being decomposed`.

2. **Write one role card per agent** — the plan's core, using [`templates/orchestration-plan.md`](templates/orchestration-plan.md). Each card: **mission** (one sentence, one job — an agent with "and" in its mission is two agents or one agent over-split; a mission repeated across items is one card with a ×N multiplier, and splitting one item's work into separate per-check cards is worth the extra invocations only when the isolation or tier difference pays for it), **inputs** (exactly what it's given — and, as important, what it's *denied*: the context-isolation line states what this agent must not see, e.g. a judge never sees the other judges' verdicts), **output contract** (a typed schema — fields and types, not "a summary"; prose outputs make aggregation a second AI task you didn't budget), **tools/permissions** (least privilege: a research agent gets read, never write), and **failure behavior** (what it returns when it can't do the job — a structured `BLOCKED`/empty result, never improvisation).

3. **Pick the topology, with the reason attached:**
   Start with the simplest shape that could work, and split by context, never by problem type: each agent gets work that needs little from the rest and hands back a compact result.
   - **Pipeline** — stages feed forward; item B needn't wait for item A's later stages. The default for multi-stage work.
   - **Parallel + barrier** — only when a stage genuinely needs *all* prior results at once (dedup across findings, a zero-count early exit). A barrier "because the stages feel separate" burns wall-clock for tidiness.
   - **Judge panel** — N independent attempts or verdicts, then score/merge (`council-review`'s shape). For wide solution spaces and contested judgments; specify the vote rule (majority, unanimous-to-kill) up front.
   - **Depth cap: one level.** Subagents spawning subagents needs a written justification; two levels of delegation is where accountability and budgets go to disappear.

4. **Design the aggregation and verification stage.** Aggregation is code-shaped where possible (merge schemas, dedup by key) — an "aggregator agent" summarizing prose is a smell that the output contracts were too loose. Verification is a **separate stage with an adversarial job description** (`devils-advocate` framing): it tries to refute, and its verdict gates the result. The orchestrator trusts contracts, not content — a subagent's confident prose is not evidence; count only schema-valid outputs, and route contract violations to the failure path, never into the merge.

5. **Attach the budget line and emit.** Per-agent tier (light/standard/heavy — the repo's routing abstraction; most fan-out workers are one tier below the orchestrator's instinct) and the fleet's cap per run, referencing an `agent-budget` spec or tagging the numbers `[assumption]`. Emit in one message: fan-out justification, role cards, topology (Mermaid `flowchart`) with the reason, aggregation + verification, budget line. Hand off: the full spend model → `agent-budget`; implementing a coding task through it → `feature-implement-loop`.

## Useful references in this skill

- [`reference.md`](reference.md) — folding a multi-agent system: what the end-to-end eval must contain, the order to fold in, where each thing a subagent held goes, who owns what across teams
- [`templates/orchestration-plan.md`](templates/orchestration-plan.md) — role cards, topology diagram, aggregation/verification, budget line
- [`examples/help-center-localization.md`](examples/help-center-localization.md) — worked example: a translator grading its own work, a middle layer with no job and auto-publishing, cut to a pipeline with one justified check

## Quality bar

- **The fan-out is justified by one of the four reasons, by name, after the single-loop fix was tried** — or the plan says "one agent" and means it.
- **A fold plan goes one subagent at a time**, most-used and tightly coupled ones first, each kept only if the folded version scores worse on an end-to-end eval run more than once, with a task per production chain and per rule that must hold.
- **A fold plan says where each thing goes and who owns it:** skill, tool, a check inside a tool, a lookup, or nothing; one central owner for the system prompt and the end-to-end eval.
- **Every mission is one sentence with no "and".** Two jobs, two cards.
- **Every output contract is typed.** A reader could write the JSON schema from the card.
- **Isolation lines are explicit** — each card says what the agent is denied and why.
- **The topology has its reason attached**, and any barrier names the cross-item dependency that earns it.
- **Verification is adversarial and separate** — never the generator, never "the orchestrator double-checks".
- **The budget line exists** — per-agent tier + fleet cap, sourced or tagged.

## When to use this skill

- ✅ "Should this be one agent or several?" — including when the honest answer is one
- ✅ Designing a multi-agent review, audit, research sweep, or migration
- ✅ A fan-out exists but produces mush — retrofit contracts, isolation, and verification
- ✅ "We have a dozen agents — should some of them be one?" — a fold plan
- ✅ Choosing between pipeline, barrier, and judge-panel shapes for a workflow

## When NOT to use this skill

- ❌ Designing the loop that wraps the fan-out (caps, gates, exits) — that's a loop spec, a separate piece of work
- ❌ Setting the spend policy — `agent-budget`
- ❌ Running a multi-perspective review right now — `council-review` is the panel, ready-made
- ❌ Implementing one story — `feature-implement-loop`

## Anti-patterns to avoid

- ❌ **Fan-out as a lifestyle.** Five agents doing what one context does well is five times the cost for a coordination tax. The burden of proof is on splitting.
- ❌ **The org chart as architecture.** One subagent per team or problem type, each with its own prompt, owner and eval, until the system mirrors the reporting lines and nobody owns the whole answer.
- ❌ **Summaries as handoffs.** Agents passing each other summaries lose detail at every hop; an agent that saw each earlier step can connect them.
- ❌ **An agent per permission level.** Access is a check inside each tool, which returns a refusal the model can read; a second agent for "admin" duplicates everything else.
- ❌ **Every team adds a line to the system prompt.** Conflicting rules, no single voice, and nobody who owns the whole. One small team owns it.
- ❌ **Judging the architecture on per-team evals.** Each is tuned to its own subtask; only a shared end-to-end set shows a fold broke something.
- ❌ **Code that retrieves context and pastes it into the prompt.** Put reference material behind a lookup the model calls, or in a skill's reference files.
- ❌ **A router in front of a capable model.** Code-driven intent classifiers and fixed pipelines doing the choosing the model now does itself; one clear prompt with a few thin tools and firm output checks usually beats them.
- ❌ **Prose contracts.** "Each agent reports its findings" guarantees an unmergeable pile and a surprise summarization stage. Schemas or it didn't happen.
- ❌ **Contaminated judges.** A panel that sees each other's verdicts is one opinion with extra steps — independence is the entire value.
- ❌ **The trusting orchestrator.** Merging whatever comes back because it arrived confidently. Contract-invalid output goes to the failure route, not the report.
- ❌ **Unbounded depth.** Subagents spawning subagents until nobody can say who decided what or spent which tokens.
- ❌ **Barrier by aesthetics.** Synchronizing stages because the diagram looks cleaner — pay wall-clock only for a named cross-item dependency.
- ❌ **Verifier-free fleets.** Ten generators and no refuter ships ten agents' worth of plausible-but-wrong at fleet speed.
- ❌ **Showing the machinery.** The reply and the artifact are for the person who asked. Don't mention this skill, its files, templates, caps or internal terms, or that the run is non-interactive. Name another skill once, at the end, as a suggested next step, never inside the artifact.
- ❌ **A bare `BLOCKED` line.** Keep the `BLOCKED: need <X>` line, then write for a person: what is missing in plain words, what you will produce once you have it, and anything the request already lets you say.

Files in this skill

  • SKILL.md7.5 KB
  • evals/eval_queries.json765 B
  • evals/evals.json1.6 KB
  • manifest.json1 KB
  • templates/orchestration-plan.md1.9 KB

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.