delegation-first

📁 laurigates/claude-plugins 📅 Jan 29, 2026
4
总安装量
4
周安装量
#49161
全站排名
安装命令
npx skills add https://github.com/laurigates/claude-plugins --skill delegation-first

Agent 安装分布

opencode 3
github-copilot 3
mcpjam 2
junie 2
windsurf 2

Skill 文档

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:

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:

## 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:

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

❌ "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

❌ "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

❌ "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

❌ [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)