agentleFS
PracticalSwanPracticalSwan/agent-skills/subagent-delegation/SKILL.md

subagent-delegation

Skill22 starsChanged 24 days agoMITView on GitHub

Delegate routine work to subagents — boilerplate generation, data transformation, file analysis, documentation drafting. Use when splitting tasks into independent subtasks for parallel subagent execution.

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

9 rules. 0 are common, 8 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use symptom -> action triggers: when one matches, apply this skill and verify with the protocol below.

    line 15
  2. Distinctive:

    Do not claim an MCP operation was used when the active host does not expose it.

    line 54
  3. Distinctive:

    Treat local files, tests, rendered outputs, logs, or screenshots as the fallback evidence path.

    line 55
  4. Distinctive:

    Before claiming "skill applied successfully":

    line 67
  5. Distinctive:

    Before you mark delegated work complete, the coordinating agent must ask:

    line 82
  6. Very specific:

    Step 2: Delegate: - Use runSubagent for routine or repetitive work

    line 94
  7. Distinctive:

    Step 3: Review: - Check output for correctness, completeness, integration compatibility

    line 95
  8. Distinctive:

    Step 5: Validate: - Test integrated code, debug issues, ensure quality

    line 97
  9. Distinctive:

    Before integrating subagent results, verify:

    line 101

“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 Delegation Patterns

  • Leverage native parallel subagent dispatch and 200k+ context windows where available.

Activation Conditions

Use symptom -> action triggers: when one matches, apply this skill and verify with the protocol below.

Activate this skill when:

  • Creating repetitive code structures or boilerplate
  • Performing data transformation tasks
  • Analyzing codebase for patterns or information
  • Generating documentation from existing code
  • Creating simple utility functions
  • Breaking down complex features into manageable subtasks

Core Delegation Patterns

See Delegation Patterns for detailed examples of:

  • Boilerplate generation (API routes, CRUD operations, component structures)
  • Data transformations between formats
  • File analysis and pattern extraction
  • Documentation generation from code
  • Utility function creation
<!-- MCP:START --><!-- PORTABILITY:START -->

Cross-Client Portability

This skill is written to stay usable across GitHub Copilot, Claude Code, and Codex.

  • GitHub Copilot: keep the folder in a Copilot-visible skill path or wrap the workflow in project instructions when folder discovery is unavailable.
  • Claude Code: keep the folder in a local skills directory or a compatible plugin source.
  • Codex: install or sync the folder into $CODEX_HOME/skills/subagent-delegation and restart Codex after major changes.
<!-- PORTABILITY:END -->

MCP Availability And Fallback

Preferred MCP Server: None required

  • Fallback prompt: "Use the Subagent Delegation Patterns skill without MCP. Rely on its local instructions, bundled resources, standard shell or editor tools, and direct verification. Show the evidence used before concluding."
  • Do not claim an MCP operation was used when the active host does not expose it.
  • Treat local files, tests, rendered outputs, logs, or screenshots as the fallback evidence path.
<!-- MCP:END -->

Anti-Patterns

  • Delegating or evaluating without a scoped success condition: The output becomes hard to review and easy to overbuild.
  • Skipping the evidence step: A workflow that cannot be re-checked quickly is not ready for handoff.
  • Bundling unrelated subtasks together: It creates noisy prompts, weaker ownership, and avoidable integration risk.

Verification Protocol

Before claiming "skill applied successfully":

  1. Pass/fail: The Subagent Delegation workflow names the agent boundary, delegated scope, and expected return artifact.
  2. Pass/fail: Context passed to helpers is minimal, task-local, and free of hidden expected answers.
  3. Pass/fail: Results are integrated only after evidence, diffs, or citations are checked by the controller.
  4. Pressure-test scenario: Run the workflow on two similar tasks that must not share assumptions or leaked context.
  5. Success metric: Zero context leakage; every delegated output is independently reviewable.

Examples & Scripts

  • Delegation Pattern Examples — Code examples of common delegation patterns
  • Delegation Template — JavaScript template for structuring delegation calls

Self-Verification Phase-Gate Questions

Before you mark delegated work complete, the coordinating agent must ask:

  • Did the subagent receive a scoped task, owned files or responsibilities, and a clear definition of done?
  • Did I review the returned output for correctness, integration fit, and missing edge cases instead of forwarding it blindly?
  • Did I preserve the evidence trail showing what was delegated, what changed, and what still needs local ownership?
  • Are any follow-up fixes, risks, or unresolved assumptions now explicit to the next reviewer?

Integration Workflow

For delegating tasks to subagents, follow this 5-step process:

  • Step 1: Plan - Analyze problem, design solution, identify routine subtasks
  • Step 2: Delegate - Use runSubagent for routine or repetitive work
  • Step 3: Review - Check output for correctness, completeness, integration compatibility
  • Step 4: Integrate - Incorporate output into codebase, handle conflicts
  • Step 5: Validate - Test integrated code, debug issues, ensure quality

Quality Control

Before integrating subagent results, verify:

  • Code follows project conventions (style, naming, structure)
  • Matches specified interfaces and contracts
  • Includes necessary error handling
  • Has appropriate comments/documentation
  • No security vulnerabilities or obvious performance issues
  • Compatible with existing codebase (imports, dependencies)

Combining with Sequential Thinking

For complex tasks, use Sequential Thinking first to plan architecture, then delegate routine parts:

// Use Sequential Thinking to plan
mcp_sequentialthi_sequentialthinking({
  thought: "Breaking down feature...identifying repetitive CRUD for delegation",
  thoughtNumber: 1,
  totalThoughts: 5,
  nextThoughtNeeded: true
})

// Then delegate boilerplate
runSubagent({
  description: "Generate CRUD API",
  prompt: "Create CRUD functions matching data model..."
})

// Main agent implements core logic

Related Skills

  • agent-task-mapping: Use it when the workflow also needs task-to-agent routing decisions.
  • custom-agent-usage: Use it when the workflow also needs loading and invoking custom agent definitions safely.
  • subagent-driven-development: Use it when the workflow also needs plan-driven implementation with reviewer loops.
  • agentic-eval: Use it when the workflow also needs rubric-driven evaluation loops.

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.