com um clique
dispatching-parallel-agents
// Dispatch parallel subagents for independent tasks without shared state. Use when facing 2+ independent failures, debugging unrelated subsystems, or researching separate topics concurrently.
// Dispatch parallel subagents for independent tasks without shared state. Use when facing 2+ independent failures, debugging unrelated subsystems, or researching separate topics concurrently.
Use tmux correctly from an agent — explicit pane targeting, safe-state verification, send verification, state distinction, and recovery. Use when Claude Code, Codex, GitHub Copilot CLI, or any TUI/REPL must keep state across commands.
Create isolated git worktrees for feature work with safety verification. Use when starting feature branches that need isolation, running parallel agents in separate workspaces, or before executing implementation plans.
Closed-loop planning discipline for non-trivial changes. Use when creating implementation plans, reviewing plan completeness, or preparing PRs that require structured planning evidence.
Test-driven development discipline for any feature or bugfix. Use when implementing features, fixing bugs, or changing behavior — requires writing failing tests before implementation code.
Fetch up-to-date library documentation. Use when user asks about libraries, frameworks, or needs current API references/code examples.
Browse websites, interact with web pages, and run Playwright tests. Use for navigating URLs, clicking elements, filling forms, taking screenshots, running browser automation, or executing Playwright test suites.
| name | dispatching-parallel-agents |
| description | Dispatch parallel subagents for independent tasks without shared state. Use when facing 2+ independent failures, debugging unrelated subsystems, or researching separate topics concurrently. |
Dispatch parallel subagents when you have multiple independent tasks that don't share state. This skill provides the decision framework and prompt structure for effective parallelization.
Parallel dispatch is appropriate when:
Stay sequential when:
Break the work into units that have no dependencies on each other. Each unit should be completable without knowledge of the others' results.
Questions to validate independence:
Write a focused, self-contained prompt for each agent. Every prompt must include:
Use the Task tool to dispatch agents in a single message. All independent task calls go in the same response for true parallelism.
Task 1: "Fix SMTP timeout in services/email/..."
Task 2: "Fix auth token refresh in services/auth/..."
Task 3: "Update deploy script error handling in scripts/..."
Choose the right agent type for each task:
Platform built-ins (available in Claude Code regardless of repo config):
Bash — Command execution, git operationsgeneral-purpose — Multi-step tasks requiring multiple toolsExplore — Codebase investigation and searchHill90 repo agents (defined in .github/agents/):
researcher — Deep code pattern analysis (read-only)tdd-green — Implementing code to pass testscode-reviewer — Reviewing changes for qualityplanner — Read-only planning and explorationAfter all agents return:
A well-structured agent prompt follows this template:
You are working on [project context].
## Task
[Precise objective — what to accomplish]
## Scope
- Files to modify: [specific paths]
- Files to read for context: [specific paths]
## Constraints
- Do NOT modify [specific files/areas]
- Do NOT [specific anti-patterns]
## Expected Output
Return:
- [What was changed and why]
- [Any issues encountered]
- [Test results if applicable]
Task 1 (general-purpose):
"Fix the failing tests in tests/scripts/deploy.bats.
Read scripts/deploy.sh for context. The tests expect
deploy.sh to validate the service name argument before
proceeding. Only modify scripts/deploy.sh — do not
change the test file. Run the tests after fixing and
report results."
Task 2 (general-purpose):
"Fix the failing tests in tests/scripts/secrets.bats.
Read scripts/secrets.sh for context. The tests expect
secrets.sh to check for sops binary before attempting
decryption. Only modify scripts/secrets.sh — do not
change the test file. Run the tests after fixing and
report results."
Task 1 (Explore):
"Search the codebase for all Traefik configuration.
Find how TLS certificates are managed, what middleware
is configured, and document the routing rules. Return
a summary of the Traefik setup."
Task 2 (Explore):
"Search the codebase for all Keycloak configuration.
Find realm settings, client configurations, and theme
customizations. Return a summary of the auth setup."
| Mistake | Why It Fails | Fix |
|---|---|---|
| Prompt too broad ("fix all the tests") | Agent flounders without focus | Scope to specific files and behaviors |
| Missing context ("fix the bug") | Agent lacks information to start | Include file paths and background |
| No constraints ("make it work") | Agent may modify shared files | Specify what NOT to change |
| Vague output expectation | Can't verify success | Define what the summary must include |
| Parallelizing dependent tasks | Later agents need earlier results | Identify dependencies first, chain those |
| Too many agents at once | Diminishing returns, review burden | 2-4 agents is the sweet spot |
After all agents complete, always:
.claude/references/patterns/agent-patterns.md for subagent design patterns (read-only specialist, domain expert, background research).