delegation-templates
sagullapalli/claude-code-setup/.claude/skills/delegation-templates/SKILL.md
Context templates and examples for Main Orchestrator agent delegation. Standard delegation template, good/bad examples. Use when delegating tasks to specialized agents.
Skill4 starsChanged 8 months ago
What's in it
- Delegation Templates
- Standard Delegation Template
- Good Example
- Outcome-Focused Delegation (CRITICAL)
- ✅ Good: Outcome-Focused
- ❌ Bad: Over-Prescriptive
- The Difference
- Bad Examples
- Missing Context
- Wrong subagenttype
- No Nickname
- Imperative Skill Language
- Agent Quick Reference
- Common Delegation Scenarios
- Building a New Feature
- Fixing a Bug
- Infrastructure Setup
- Test-Driven Development
---
name: delegation-templates
description: Context templates and examples for Main Orchestrator agent delegation. Standard delegation template, good/bad examples. Use when delegating tasks to specialized agents.
---
# Delegation Templates
Templates and examples for delegating to specialized agents.
**For mandatory protocol, see**: `.claude/rules/agent-delegation.md`
---
## Standard Delegation Template
```markdown
[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
```python
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
```markdown
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
```markdown
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
| Aspect | Outcome-Focused | Over-Prescriptive |
|--------|-----------------|-------------------|
| File structure | "Follow existing patterns" | "Put in main.py line 200" |
| Function design | "Store/retrieve messages" | "Function X with params Y, Z" |
| Implementation | Agent's expertise | Your guesses |
| Result | Clean, modular code | Bloated, unidiomatic code |
---
## Bad Examples
### Missing Context
```python
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
```python
Task(
subagent_type="solution-architect", # Wrong!
prompt="..."
)
```
**Problem**: Must use `"Solution Architect"` (capital letters + spaces)
### No Nickname
```python
Task(
subagent_type="AI Engineer",
prompt="Build a poem generator agent..."
)
```
**Problem**: Should start with "Kai, I need you to build..."
### Imperative Skill Language
```python
prompt="""
...
3. Invoke the google-adk-patterns skill for patterns
...
"""
```
**Better**:
```python
prompt="""
...
3. The google-adk-patterns skill has relevant agent setup patterns
...
"""
```
---
## Agent Quick Reference
| Nickname | subagent_type | Expertise |
|----------|---------------|-----------|
| Scout | `General Worker` | Research, exploration, file ops, context gathering |
| Sage | `Solution Architect` | Architecture, GCP services, ADRs |
| Kai | `AI Engineer` | Python, FastAPI, Google ADK, data layer |
| Iris | `Frontend Engineer` | React, TypeScript, Vite, accessibility |
| Devo | `DevOps Engineer` | Cloud Run, Terraform, CI/CD |
| Vera | `QA Tester` | pytest, Playwright, AI testing |
| Luna | `Frontend QA Specialist` | Vitest, 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
More agent context in sagullapalli/claude-code-setup
12 other files this repository gives its agents.
CLAUDE.md
Skill
- Claude Agent SDK Patterns.claude/skills/claude-agent-sdk-patterns/SKILL.md
- deployment.claude/skills/deployment/SKILL.md
- frontend-patterns.claude/skills/frontend-patterns/SKILL.md
- Google ADK Patterns.claude/skills/google-adk-patterns/SKILL.md
- LLM Evaluation Patterns.claude/skills/llm-evaluation/SKILL.md
- LLM Observability Patterns.claude/skills/llm-observability/SKILL.md
- memory-workflow.claude/skills/memory-workflow/SKILL.md
- orchestrator-workflows.claude/skills/orchestrator-workflows/SKILL.md
- react-native-best-practices.claude/skills/react-native-best-practices/SKILL.md
- skill-creator.claude/skills/skill-creator/SKILL.md
- testing-strategy.claude/skills/testing-strategy/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
Reports can't be read right now.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

