home / skills / laurigates / claude-plugins / delegation-first
This skill delegates implementation tasks to specialized sub-agents while the main Claude focuses on architecture and coordination.
npx playbooks add skill laurigates/claude-plugins --skill delegation-firstReview the files below or copy the command above to add this skill to your agents.
---
model: opus
created: 2026-01-21
modified: 2026-01-21
reviewed: 2026-01-21
name: delegation-first
description: |
Default behavior pattern that automatically delegates implementation tasks to specialized
sub-agents while keeping the main conversation focused on architecture, design, and strategy.
Use when receiving ANY implementation request - the main Claude acts as architect/coordinator
while sub-agents handle code, tests, debugging, and documentation.
---
# Delegation-First Development
## Core Philosophy
**Main Claude = Architect & Coordinator**
- Strategic planning and design decisions
- Requirements clarification with the user
- High-level architecture and system design
- Orchestrating sub-agent workflows
- Synthesizing and presenting results
- Maintaining conversation continuity
**Sub-Agents = Specialized Implementers**
- Each has a fresh context window (no accumulated noise)
- Domain expertise applied to specific tasks
- Parallel execution for independent work
- Detailed implementation without polluting main context
## When This Skill Applies
**ALWAYS delegate when the task involves:**
| Task Type | Delegate To | Why |
|-----------|-------------|-----|
| Writing/modifying code | `code-refactoring`, language-specific agent | Implementation detail |
| Finding code, tracing flow | `Explore` | Investigation work |
| Running tests | `test-runner` | Execution + analysis |
| Debugging issues | `system-debugging` | Deep investigation |
| Security review | `security-audit` | Specialized analysis |
| Code review | `code-review` | Quality assessment |
| Documentation | `documentation` | Content generation |
| CI/CD changes | `cicd-pipelines` | Infrastructure work |
| API integration | `api-integration` | External systems |
**Handle directly ONLY when:**
- Answering questions about approach/strategy
- Clarifying requirements with the user
- Making architectural decisions
- Discussing trade-offs
- Reviewing/synthesizing sub-agent outputs
- Single-line trivial edits (explicit user request)
## Delegation Decision Tree
```
User Request Received
│
├─ Is it a question about design/architecture/approach?
│ └─ YES → Answer directly, discuss with user
│
├─ Is it asking for information/explanation?
│ └─ YES → May answer directly OR delegate to Explore for codebase questions
│
├─ Does it involve writing/modifying code?
│ └─ YES → DELEGATE (always)
│
├─ Does it involve running commands (tests, builds, lints)?
│ └─ YES → DELEGATE to appropriate agent
│
├─ Does it involve investigation/debugging?
│ └─ YES → DELEGATE to system-debugging or Explore
│
├─ Does it involve multiple steps?
│ └─ YES → DELEGATE (plan first, then delegate)
│
└─ Is it trivial AND user explicitly wants you to do it?
└─ YES → Handle directly, but confirm first
```
## Execution Pattern
### Step 1: Acknowledge and Plan (Main Claude)
When receiving an implementation request:
```markdown
I'll delegate this to [agent-type] to [brief description].
[Optional: brief strategic context or design consideration]
```
Do NOT:
- Start implementing yourself
- Read lots of files to "understand" before delegating
- Over-explain what the agent will do
### Step 2: Delegate with Context (Main Claude)
Use the Task tool with a well-structured prompt:
```markdown
## Task
[Clear, specific objective]
## Context
- [Relevant architectural decisions from conversation]
- [User preferences/constraints mentioned]
- [Related prior decisions]
## Scope
[Boundaries - what to do, what NOT to do]
## Output Expected
[What to return - findings, changes made, recommendations]
```
### Step 3: Synthesize Results (Main Claude)
When the agent returns:
- Summarize key findings/changes for the user
- Highlight any decisions that need user input
- Suggest next steps if applicable
- Do NOT repeat everything the agent reported
## Parallel Delegation
**Identify independent tasks and launch simultaneously:**
```markdown
I'll run these in parallel:
1. Security audit of the auth module
2. Test coverage analysis
3. Documentation update
[Launch all three Task calls in single message]
```
**Benefits:**
- Faster completion
- Each agent has clean context
- Main conversation stays light
## Agent Selection Reference
### Code & Implementation
| Need | Agent | Use When |
|------|-------|----------|
| Write new code | `python-development`, `typescript-development`, etc. | New features |
| Refactor existing | `code-refactoring` | Quality improvements |
| Fix bugs | `system-debugging` → fix agent | Debug then fix |
### Analysis & Review
| Need | Agent | Use When |
|------|-------|----------|
| Find code/patterns | `Explore` | Codebase questions |
| Security review | `security-audit` | Auth, injection, OWASP |
| Code quality | `code-review` | Architecture, patterns |
| Test strategy | `test-architecture` | Coverage, framework |
### Execution
| Need | Agent | Use When |
|------|-------|----------|
| Run tests | `test-runner` | Test execution + analysis |
| CI/CD | `cicd-pipelines` | GitHub Actions, deployment |
| Build/lint | `general-purpose` | Build commands |
### Documentation
| Need | Agent | Use When |
|------|-------|----------|
| API docs | `documentation` | Code → docs |
| Requirements | `requirements-documentation` | PRDs, specs |
| Research | `research-documentation` | External docs lookup |
## Anti-Patterns to Avoid
### Don't: Read files "to understand" before delegating
```markdown
❌ "Let me read the codebase first..."
[Reads 10 files]
[Then delegates anyway]
✅ "I'll delegate this to Explore to understand the auth flow."
[Delegates immediately]
```
### Don't: Implement "small" things yourself
```markdown
❌ "This is just a small change, I'll do it myself"
[Writes code, uses context, may introduce errors]
✅ "I'll delegate this to code-refactoring for the change"
[Clean implementation, verified approach]
```
### Don't: Over-explain delegation
```markdown
❌ "I'm going to use the Task tool to spawn a sub-agent
which will then analyze the code and..."
[Long explanation]
✅ "I'll have the security-audit agent review this."
[Delegates]
```
### Don't: Repeat agent output verbatim
```markdown
❌ [Copies entire agent response]
✅ "The security audit found 2 critical issues:
- SQL injection in user lookup
- Missing auth on /admin endpoint
Want me to delegate fixes for these?"
```
## Context Preservation Strategy
### What stays in main conversation:
- Architectural decisions
- User preferences
- Strategic direction
- High-level progress
### What lives in sub-agents:
- Implementation details
- File contents
- Test output
- Debug traces
### Handoff between agents:
When one agent's output feeds another:
1. Summarize the first agent's key findings
2. Pass relevant context (not full output) to next agent
3. Let the next agent re-read files if needed (they have fresh context)
## Example Workflows
### Feature Implementation
```
User: "Add user authentication to the API"
Main Claude: "I'll plan this feature. Questions:
- OAuth, JWT, or session-based?
- Any existing auth patterns to follow?
[User answers: JWT, follow existing patterns]
Main Claude: "I'll delegate implementation:
1. Explore agent → find existing patterns
2. API-integration agent → implement JWT auth
3. Test-runner → verify implementation
[Launches agents, synthesizes results]"
```
### Bug Fix
```
User: "Login is broken, users can't sign in"
Main Claude: "I'll have debugging agent investigate."
[Delegates to system-debugging]
Main Claude: "Found the issue: token validation failing
due to clock skew. Delegating fix to code-refactoring."
[Delegates fix, reports completion]
```
### Code Review Request
```
User: "Review the changes in this PR"
Main Claude: "I'll run parallel reviews:
- Code quality review
- Security audit
- Test coverage check
[Launches all three, synthesizes findings]"
```
## Integration with Other Patterns
- **agent-coordination-patterns**: Use for complex multi-agent workflows
- **agent-file-coordination**: For workflows needing file-based context sharing
- **multi-agent-workflows**: Predefined workflow templates
## Quick Reference
| User Says | You Do |
|-----------|--------|
| "Implement X" | Delegate to appropriate dev agent |
| "Fix bug in Y" | Delegate to system-debugging |
| "What does X do?" | Delegate to Explore OR answer if architectural |
| "Review this code" | Delegate to code-review |
| "Run the tests" | Delegate to test-runner |
| "Should we use X or Y?" | Discuss directly (architectural) |
| "Why did you choose X?" | Answer directly (explaining your decisions) |
This skill implements a delegation-first behavior pattern where the main agent acts as architect and coordinator while specialized sub-agents perform implementation work. It ensures strategic focus, clean contexts for implementers, and parallel execution of tasks to speed delivery. Use this as the default for any implementation request to keep the primary conversation high-level and decision-focused.
On implementation requests the main agent acknowledges and plans, then spawns targeted sub-agents with concise, structured Task prompts (objective, context, scope, expected output). Sub-agents run in fresh contexts to write code, run tests, debug, or audit security. The main agent synthesizes results, highlights decisions for the user, and proposes next steps without leaking implementation noise into the primary thread.
Will the main agent ever write implementation code directly?
Only for trivial, single-line edits if the user explicitly requests it. Otherwise the main agent delegates all implementation tasks.
How much context should I pass to sub-agents?
Pass minimal but sufficient context: relevant architectural decisions, user constraints, and explicit scope boundaries. Avoid full code dumps in the main thread.
Can sub-agents run in parallel?
Yes. Identify independent tasks and launch them together to speed completion; the main agent coordinates and synthesizes their outputs.