agentleFS
sagullapallisagullapalli/claude-code-setup/.claude/skills/delegation-templates/SKILL.md

delegation-templates

Skill4 starsChanged 10 months agoMITView on GitHub

Context templates and examples for Main Orchestrator agent delegation. Standard delegation template, good/bad examples. Use when delegating tasks to specialized agents.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    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:

    No background (why we need this)

    line 170
  2. Distinctive:

    No mention of memory file or docs

    line 171
  3. Very specific:

    Problem: Must use "Solution Architect" (capital letters + spaces)

    line 182
  4. Distinctive:

    Problem: Should start with "Kai, I need you to build..."

    line 191
  5. Distinctive:

    Vera: Add regression test

    line 236
  6. Distinctive:

    Vera: Write failing test (RED)

    line 243
  7. Distinctive:

    Vera: Add edge cases

    line 246

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “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

Delegation Templates

Templates and examples for delegating to specialized agents.

For mandatory protocol, see: .claude/rules/agent-delegation.md


Standard Delegation Template

[Nickname], I need your [specific expertise] on [topic].

BACKGROUND CONTEXT:
[Explain what led to this task - the agent cannot see conversation history]
- What problem are we solving?
- Why is this needed now?
- What decisions have already been made?

MEMORY & KNOWLEDGE:
1. Read your memory file (.claude/memory/memory-[agent-name].md) for project context
2. Load these docs for detailed specs:
   - [doc1]: [what it contains]
   - [doc2]: [what it contains]
3. These skills may be relevant:
   - [skill1]: [what patterns it has]
   - [skill2]: [what patterns it has]

TASK:
[Clear, specific task with numbered steps if applicable]
1. [Step 1]
2. [Step 2]
3. [Step 3]

DELIVERABLES:
- [Expected output 1]
- [Expected output 2]

CONSTRAINTS:
- [Any limitations, requirements, or must-follow patterns]

MEMORY UPDATE:
After completing the task, update your memory file with:
- Status/outcome
- Brief rationale for key decisions
- Lessons learned (using STAR format for bugs/issues)

Good Example

Task(
    subagent_type="Solution Architect",
    prompt="""
Sage, I need your architecture expertise on testing infrastructure.

BACKGROUND CONTEXT:
The user wants production-ready testing for the backend before deployment.
We currently have 103 tests with 76% coverage, but no CI/CD pipeline.
A security audit identified vulnerabilities, highlighting the need for
robust testing before production.

MEMORY & KNOWLEDGE:
1. Read your memory file (.claude/memory/memory-solution-architect.md)
2. Load these docs for detailed specs:
   - docs/current/PHASE_2_PLAN.md: Track A2 - Testing Infrastructure details
   - docs/reference/ARCHITECTURE_DECISION_SUMMARY.md: Existing ADRs
3. These skills may be relevant:
   - testing-strategy: Unit, integration, E2E testing patterns
   - gcp-deployment: CI/CD options (GitHub Actions vs Cloud Build)

TASK:
Design a comprehensive testing architecture for our FastAPI + Google ADK backend:
1. Choose CI/CD platform (GitHub Actions vs Cloud Build) with rationale
2. Recommend integration testing approach (GCS emulator vs real bucket)
3. Define performance testing strategy (tools, targets)
4. Draft ADRs for key architectural decisions
5. Create implementation roadmap

DELIVERABLES:
- Testing architecture recommendation (written)
- ADR drafts for major decisions
- Phased implementation roadmap

CONSTRAINTS:
- Must use GCP Europe regions (europe-west1/west3)
- Follow existing project patterns (see PROJECT_GUIDELINES.md)
- Target: >70% coverage, all critical paths tested

MEMORY UPDATE:
After completing the task, update your memory file with:
- Testing architecture decision and brief rationale
- Link to ADRs created
- Lessons learned about testing ADK-based applications
"""
)

Outcome-Focused Delegation (CRITICAL)

You define WHAT. Specialists decide HOW.

✅ Good: Outcome-Focused

TASK:
Implement session persistence for chat history.
1. Store conversation messages persistently
2. Allow users to retrieve their chat history
3. Handle session expiry gracefully

CONSTRAINTS:
- Use GCS for storage (existing bucket: your-project-sessions)
- Follow existing service patterns in backend/services/

The specialist decides:

  • File structure and modularization
  • Specific function signatures
  • Error handling approach
  • Where code belongs

❌ Bad: Over-Prescriptive

TASK:
1. Add a get_messages function to main.py at line 200
2. Function should take session_id: str parameter
3. Query GCS bucket with prefix f"sessions/{session_id}"
4. Return List[Message] with timestamp, role, content
5. Add the endpoint at /sessions/{id}/messages

Problems:

  • Dictates file placement (→ bloated main.py)
  • Specifies implementation details
  • Removes specialist judgment
  • Misses opportunities for better patterns

The Difference

AspectOutcome-FocusedOver-Prescriptive
File structure"Follow existing patterns""Put in main.py line 200"
Function design"Store/retrieve messages""Function X with params Y, Z"
ImplementationAgent's expertiseYour guesses
ResultClean, modular codeBloated, unidiomatic code

Bad Examples

Missing Context

Task(
    subagent_type="Solution Architect",
    prompt="Design the testing architecture"
)

Problems:

  • No background (why we need this)
  • No mention of memory file or docs
  • No deliverables specified
  • Agent works in a vacuum

Wrong subagent_type

Task(
    subagent_type="solution-architect",  # Wrong!
    prompt="..."
)

Problem: Must use "Solution Architect" (capital letters + spaces)

No Nickname

Task(
    subagent_type="AI Engineer",
    prompt="Build a poem generator agent..."
)

Problem: Should start with "Kai, I need you to build..."

Imperative Skill Language

prompt="""
...
3. Invoke the google-adk-patterns skill for patterns
...
"""

Better:

prompt="""
...
3. The google-adk-patterns skill has relevant agent setup patterns
...
"""

Agent Quick Reference

Nicknamesubagent_typeExpertise
ScoutGeneral WorkerResearch, exploration, file ops, context gathering
SageSolution ArchitectArchitecture, GCP services, ADRs
KaiAI EngineerPython, FastAPI, Google ADK, data layer
IrisFrontend EngineerReact, TypeScript, Vite, accessibility
DevoDevOps EngineerCloud Run, Terraform, CI/CD
VeraQA Testerpytest, Playwright, AI testing
LunaFrontend QA SpecialistVitest, a11y testing, visual regression

Common Delegation Scenarios

Building a New Feature

  1. Sage: Design architecture
  2. Kai: Implement backend/API
  3. Iris: Build frontend (if needed)
  4. Vera: Write tests

Fixing a Bug

  1. Kai/Iris: Investigate and fix
  2. Vera: Add regression test

Infrastructure Setup

  1. Sage: Architecture decision
  2. Devo: Terraform + deployment

Test-Driven Development

  1. Vera: Write failing test (RED)
  2. Kai: Implement to pass (GREEN)
  3. Kai: Refactor (REFACTOR)
  4. Vera: Add edge cases

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.