Task Delegation Skill
When to Delegate
Delegate when:
- Task requires specialized expertise (testing, security, documentation)
- Context is getting bloated (>70% usage)
- Task can run in parallel with other work
- Fresh perspective needed
Don't delegate when:
- Task is trivial (<5 minutes)
- Heavy context sharing required
- Sequential dependency on current work
Delegation Patterns
Sequential Delegation
{
"mode": "sequential",
"tasks": [
{ "agent": "planner", "task": "Create plan" },
{ "agent": "executor", "task": "Implement plan" },
{ "agent": "verifier", "task": "Verify implementation" }
]
}
Parallel Delegation
{
"mode": "parallel",
"max_concurrent": 3,
"tasks": [
{ "agent": "executor", "task": "Implement feature A" },
{ "agent": "executor", "task": "Implement feature B" },
{ "agent": "tester", "task": "Write tests" }
]
}
Background Delegation
{
"mode": "background",
"agent": "researcher",
"task": "Research best practices",
"notify_on_complete": true
}
Agent Selection
| Task Type |
Agent |
Model Tier |
| Planning |
goop-planner |
quality |
| Implementation |
goop-executor-{tier} |
balanced |
| Verification |
goop-verifier |
quality |
| Research |
goop-researcher |
balanced |
| Documentation |
goop-writer |
budget |
| Testing |
goop-tester |
balanced |
| Debugging |
goop-debugger |
quality |
| Security |
goop-verifier |
quality |
Context Handoff
When delegating, pass:
- Essential state: Current phase, spec, todos
- Relevant files: Only files the agent needs
- Recent decisions: Last 3-5 ADL entries
- Constraints: Boundaries, deadlines, blockers
Don't pass:
- Full conversation history
- Verbose logs
- Unrelated file contents
- Completed task details
Direct Task Delegation (CRITICAL)
Delegation in GoopSpec uses the native task tool with rich, context-aware prompts constructed by the orchestrator.
Prompt Construction Requirements
Every delegation prompt MUST include:
- Task Intent - What to build and why
- Project Context - Stack, wave, existing patterns
- Constraints - Boundaries and requirements
- Verification - Commands to prove completion
- Expected Output - Specific deliverables
Example Delegation
task({
subagent_type: "goop-executor-high",
description: "Implement user authentication",
prompt: `
## TASK
Implement JWT-based user authentication with login/logout endpoints.
## PROJECT CONTEXT
- Stack: Next.js 14 + NextAuth
- Wave 2, Task 3 from BLUEPRINT.md
- Follow existing patterns in src/auth/
- Use jose library for JWT (already in dependencies)
## CONSTRAINTS
- Must support OAuth providers (Google, GitHub)
- Token expiry: 24 hours with refresh rotation
- Use existing session management in src/session/
## VERIFICATION
- Run: bun test src/auth/
- Manual: Test login/logout flow in browser
- Check: No hardcoded secrets or credentials
## EXPECTED OUTPUT
- src/auth/service.ts - JWT generation and validation
- src/auth/middleware.ts - Route protection middleware
- src/auth/types.ts - Auth type definitions
- Atomic commit with verification evidence
`
})
When to Delegate
| Situation |
Use Delegation |
| Complex implementation |
Yes - use appropriate executor tier |
| Multi-file changes |
Yes - include full context |
| Architecture-sensitive |
Yes - use goop-executor-high |
| Simple config update |
Optional - can be done directly |
| Quick exploration |
Optional - depends on context needs |
Available subagent_types
| subagent_type |
Use For |
goop-executor-low |
Simple implementation, config updates, mechanical fixes |
goop-executor-medium |
Business logic, refactors, and standard implementation tasks |
goop-executor-high |
Complex implementation, architecture-sensitive changes, critical code paths |
goop-executor-frontend |
UI/UX implementation, styling, responsive frontend work |
goop-explorer |
Fast codebase mapping, pattern detection |
goop-researcher |
Deep domain research, technology evaluation |
goop-planner |
Architecture design, blueprint creation |
goop-verifier |
Verification against spec, security audit |
goop-debugger |
Bug investigation, scientific debugging |
goop-tester |
Test writing, coverage analysis |
goop-designer |
UI/UX design, component architecture |
goop-writer |
Documentation, technical writing |
goop-librarian |
Code/docs search, information retrieval |
general |
Fallback for any task |
Common Mistakes
| Mistake |
Problem |
Fix |
| Vague prompt |
Agent lacks context to succeed |
Include all 5 required sections |
| Wrong agent tier |
Quality/speed mismatch |
Match agent to task complexity |
| Missing verification |
Can't prove completion |
Always specify verification commands |
| No project context |
Agent guesses patterns |
Include stack, wave, existing patterns |
Using delegate tool |
Different async system |
Use task for GoopSpec agents |
Full Example
task({
subagent_type: "goop-executor-high",
description: "Implement password reset flow",
prompt: `
## TASK
Implement password reset flow with email verification.
## PROJECT CONTEXT
- Stack: Next.js 14, Prisma, Resend
- Wave 2, Task 3 from BLUEPRINT.md
- Follow existing auth patterns in src/auth/
- Email templates in src/templates/
## CONSTRAINTS
- Reset token expires in 1 hour
- One-time use tokens only
- Rate limit: 3 requests per hour per email
- Must log all reset attempts
## VERIFICATION
- Run: bun test src/auth/reset.test.ts
- Manual: Test full reset flow with real email
- Check: Token invalidation after use
## EXPECTED OUTPUT
- src/auth/reset.ts - Reset logic
- src/api/auth/reset.ts - API endpoint
- src/templates/reset-email.tsx - Email template
- Atomic commit with test evidence
`
})
Error Handling
If delegated task fails:
- Check error type (timeout, crash, assertion)
- Save partial progress as checkpoint
- Decide: retry, reassign, or escalate
- Log failure to ADL if significant
Best Practices
- Clear instructions: Specific, unambiguous task descriptions
- Scoped context: Only relevant information
- Defined success: Clear verification criteria
- Timeout limits: Set reasonable time bounds
- Progress tracking: Monitor via todos/checkpoints
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: task-delegation-33description: Patterns for delegating tasks to specialized agents Use when this capability is needed.4---56# Task Delegation Skill78## When to Delegate910Delegate when:11- Task requires specialized expertise (testing, security, documentation)12- Context is getting bloated (>70% usage)13- Task can run in parallel with other work14- Fresh perspective needed1516Don't delegate when:17- Task is trivial (<5 minutes)18- Heavy context sharing required19- Sequential dependency on current work2021## Delegation Patterns2223### Sequential Delegation2425```json26{27 "mode": "sequential",28 "tasks": [29 { "agent": "planner", "task": "Create plan" },30 { "agent": "executor", "task": "Implement plan" },31 { "agent": "verifier", "task": "Verify implementation" }32 ]33}34```3536### Parallel Delegation3738```json39{40 "mode": "parallel",41 "max_concurrent": 3,42 "tasks": [43 { "agent": "executor", "task": "Implement feature A" },44 { "agent": "executor", "task": "Implement feature B" },45 { "agent": "tester", "task": "Write tests" }46 ]47}48```4950### Background Delegation5152```json53{54 "mode": "background",55 "agent": "researcher",56 "task": "Research best practices",57 "notify_on_complete": true58}59```6061## Agent Selection6263| Task Type | Agent | Model Tier |64|-----------|-------|------------|65| Planning | goop-planner | quality |66| Implementation | goop-executor-{tier} | balanced |67| Verification | goop-verifier | quality |68| Research | goop-researcher | balanced |69| Documentation | goop-writer | budget |70| Testing | goop-tester | balanced |71| Debugging | goop-debugger | quality |72| Security | goop-verifier | quality |7374## Context Handoff7576When delegating, pass:771. **Essential state:** Current phase, spec, todos782. **Relevant files:** Only files the agent needs793. **Recent decisions:** Last 3-5 ADL entries804. **Constraints:** Boundaries, deadlines, blockers8182Don't pass:83- Full conversation history84- Verbose logs85- Unrelated file contents86- Completed task details8788## Direct Task Delegation (CRITICAL)8990Delegation in GoopSpec uses the native **`task` tool** with rich, context-aware prompts constructed by the orchestrator.9192### Prompt Construction Requirements9394Every delegation prompt MUST include:95961. **Task Intent** - What to build and why972. **Project Context** - Stack, wave, existing patterns983. **Constraints** - Boundaries and requirements994. **Verification** - Commands to prove completion1005. **Expected Output** - Specific deliverables101102### Example Delegation103104```typescript105task({106 subagent_type: "goop-executor-high",107 description: "Implement user authentication",108 prompt: `109## TASK110Implement JWT-based user authentication with login/logout endpoints.111112## PROJECT CONTEXT113- Stack: Next.js 14 + NextAuth114- Wave 2, Task 3 from BLUEPRINT.md115- Follow existing patterns in src/auth/116- Use jose library for JWT (already in dependencies)117118## CONSTRAINTS119- Must support OAuth providers (Google, GitHub)120- Token expiry: 24 hours with refresh rotation121- Use existing session management in src/session/122123## VERIFICATION124- Run: bun test src/auth/125- Manual: Test login/logout flow in browser126- Check: No hardcoded secrets or credentials127128## EXPECTED OUTPUT129- src/auth/service.ts - JWT generation and validation130- src/auth/middleware.ts - Route protection middleware131- src/auth/types.ts - Auth type definitions132- Atomic commit with verification evidence133 `134})135```136137### When to Delegate138139| Situation | Use Delegation |140|-----------|----------------|141| Complex implementation | Yes - use appropriate executor tier |142| Multi-file changes | Yes - include full context |143| Architecture-sensitive | Yes - use goop-executor-high |144| Simple config update | Optional - can be done directly |145| Quick exploration | Optional - depends on context needs |146147### Available subagent_types148149| subagent_type | Use For |150|---------------|---------|151| `goop-executor-low` | Simple implementation, config updates, mechanical fixes |152| `goop-executor-medium` | Business logic, refactors, and standard implementation tasks |153| `goop-executor-high` | Complex implementation, architecture-sensitive changes, critical code paths |154| `goop-executor-frontend` | UI/UX implementation, styling, responsive frontend work |155| `goop-explorer` | Fast codebase mapping, pattern detection |156| `goop-researcher` | Deep domain research, technology evaluation |157| `goop-planner` | Architecture design, blueprint creation |158| `goop-verifier` | Verification against spec, security audit |159| `goop-debugger` | Bug investigation, scientific debugging |160| `goop-tester` | Test writing, coverage analysis |161| `goop-designer` | UI/UX design, component architecture |162| `goop-writer` | Documentation, technical writing |163| `goop-librarian` | Code/docs search, information retrieval |164| `general` | Fallback for any task |165166### Common Mistakes167168| Mistake | Problem | Fix |169|---------|---------|-----|170| Vague prompt | Agent lacks context to succeed | Include all 5 required sections |171| Wrong agent tier | Quality/speed mismatch | Match agent to task complexity |172| Missing verification | Can't prove completion | Always specify verification commands |173| No project context | Agent guesses patterns | Include stack, wave, existing patterns |174| Using `delegate` tool | Different async system | Use `task` for GoopSpec agents |175176### Full Example177178```typescript179task({180 subagent_type: "goop-executor-high",181 description: "Implement password reset flow",182 prompt: `183## TASK184Implement password reset flow with email verification.185186## PROJECT CONTEXT187- Stack: Next.js 14, Prisma, Resend188- Wave 2, Task 3 from BLUEPRINT.md189- Follow existing auth patterns in src/auth/190- Email templates in src/templates/191192## CONSTRAINTS193- Reset token expires in 1 hour194- One-time use tokens only195- Rate limit: 3 requests per hour per email196- Must log all reset attempts197198## VERIFICATION199- Run: bun test src/auth/reset.test.ts200- Manual: Test full reset flow with real email201- Check: Token invalidation after use202203## EXPECTED OUTPUT204- src/auth/reset.ts - Reset logic205- src/api/auth/reset.ts - API endpoint206- src/templates/reset-email.tsx - Email template207- Atomic commit with test evidence208 `209})210```211212## Error Handling213214If delegated task fails:2151. Check error type (timeout, crash, assertion)2162. Save partial progress as checkpoint2173. Decide: retry, reassign, or escalate2184. Log failure to ADL if significant219220## Best Practices2212221. **Clear instructions:** Specific, unambiguous task descriptions2232. **Scoped context:** Only relevant information2243. **Defined success:** Clear verification criteria2254. **Timeout limits:** Set reasonable time bounds2265. **Progress tracking:** Monitor via todos/checkpoints227228---229> Converted and distributed by [TomeVault](https://tomevault.io/claim/hffmnnj) — claim your Tome and manage your conversions.230<!-- tomevault:4.0:skill_md:2026-04-11 -->