Delegate tasks to specialized agents with automatic task-agent matching and parallel execution
Intelligently delegates tasks to specialized agents with automatic matching and parallel execution
/plugin marketplace add laurigates/claude-plugins/plugin install agent-patterns-plugin@lgates-claude-plugins<task-description>pwdgit status --porcelain 2>/dev/null | head -10ls -1 package.json pyproject.toml Cargo.toml go.mod 2>/dev/null | head -1git diff --name-only HEAD~5 2>/dev/null | head -10$1+: Task description(s) - can be a single task or multiple tasks (comma-separated, numbered list, or natural language list)Intelligently delegate tasks to the most appropriate specialized agents, executing in parallel when possible.
Extract individual tasks from the user's input. Tasks may be provided as:
For each identified task, determine the best agent match using this reference:
| Task Pattern | Best Agent | When to Use |
|---|---|---|
| Code exploration, finding implementations, tracing dependencies | Explore | Understanding code structure, locating patterns |
| Security review, vulnerability assessment, OWASP analysis | security-audit | Security concerns, auth flows, injection risks |
| Code quality review, architecture analysis | code-review | Quality assessment, design evaluation |
| Bug investigation, root cause analysis | system-debugging | Complex debugging, error analysis |
| Documentation generation, API docs | documentation | Creating/updating documentation |
| Running tests, analyzing failures | test-runner | Test execution and reporting |
| Test strategy, coverage analysis | test-architecture | Testing design decisions |
| CI/CD pipelines, GitHub Actions | cicd-pipelines | Build/deployment automation |
| Refactoring, SOLID principles | code-refactoring | Code quality improvements |
| TypeScript development, type safety | typescript-development | TS-specific work |
| Python development, tooling | python-development | Python-specific work |
| JavaScript/Node development | javascript-development | JS-specific work |
| Requirements, PRDs | requirements-documentation | Feature specifications |
| UX implementation, accessibility | ux-implementation | User interface work |
| API integration, REST endpoints | api-integration | External API work |
| Research, documentation lookup | research-documentation | Technical research |
| General multi-step tasks | general-purpose | Tasks not matching specific domains |
Consider splitting a task when:
Do NOT split when:
Create a delegation plan with TodoWrite:
CRITICAL: Launch all independent tasks simultaneously using multiple Task tool calls in a single message.
For each task, use the Task tool with:
subagent_type: The matched agent typeprompt: Detailed task description with all relevant contextdescription: Brief task summaryInclude in each agent prompt:
After all agents complete:
When delegating multiple independent tasks, send them all at once:
[Task 1 - security-audit agent]
[Task 2 - code-review agent]
[Task 3 - test-runner agent]
All three launch simultaneously, maximizing efficiency.
If Task B depends on Task A:
When calling each agent, structure the prompt as:
## Task
[Clear description of what to accomplish]
## Context
- Project: [type/framework]
- Files of interest: [relevant paths]
- Recent changes: [if applicable]
## Scope
[Specific boundaries for the task]
## Expected Output
[What the agent should produce/report]
Report back to the user with:
## Delegation Summary
### Tasks Identified
1. [Task 1] → `agent-type` ✓
2. [Task 2] → `agent-type` ✓
3. [Task 3] → `agent-type` ✓
### Execution Status
- Parallel: Tasks 1, 2, 3 launched simultaneously
- Sequential: [any dependent tasks]
### Results
#### [Task 1 Summary]
[Key findings/actions]
#### [Task 2 Summary]
[Key findings/actions]
#### [Task 3 Summary]
[Key findings/actions]
### Follow-up Actions
- [Any remaining work]
- [Cross-cutting concerns]
/delegate Review the auth module for security issues, update the API documentation, and run the test suite
→ Launches: security-audit, documentation, test-runner in parallel
/delegate Investigate why the login flow is broken and fix it
→ Launches: system-debugging (investigate) → code-refactoring (fix) sequentially
/delegate Find all usages of the deprecated UserService class
→ Launches: Explore agent (single task, no splitting needed)
.claude/CLAUDE.md) - Delegation strategy and agent reference/code:review, /test:run, /git:commit for specific workflows