AgentSkillsCN

dispatching-parallel-agents

当面临两项或以上彼此独立、无需共享状态或顺序依赖的任务时使用。

SKILL.md
--- frontmatter
name: dispatching-parallel-agents
description: Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

Dispatching Parallel Agents

Adapted from obra/superpowers for Cursor IDE.

Overview

When you have multiple unrelated failures or independent tasks, investigating them sequentially wastes time. Each investigation is independent and can happen in parallel.

Core principle: Dispatch one subagent per independent problem domain via Cursor's Task tool. Let them work concurrently.

When to Use

  • 2+ independent problems (different test files, different subsystems)
  • Each problem can be understood without context from others
  • No shared state between investigations

Don't use when:

  • Failures are related (fix one might fix others)
  • Agents would interfere (editing same files)

The Pattern

1. Identify Independent Domains

Group failures by what's broken. Each domain should be independent.

2. Create Focused Subagent Tasks

Each subagent gets:

  • Specific scope: One test file or subsystem
  • Clear goal: Make these tests pass
  • Constraints: Don't change other code
  • Expected output: Summary of findings and fixes

3. Dispatch in Parallel via Cursor's Task Tool

Use multiple Task tool calls in a single message to dispatch concurrently:

code
Task 1: { subagent_type: "generalPurpose", description: "Fix file-A tests", prompt: "..." }
Task 2: { subagent_type: "generalPurpose", description: "Fix file-B tests", prompt: "..." }
Task 3: { subagent_type: "generalPurpose", description: "Fix file-C tests", prompt: "..." }

Important: Maximum 4 concurrent subagents in Cursor.

4. Review and Integrate

  • Read each summary
  • Verify fixes don't conflict
  • Run full test suite
  • Integrate all changes

Common Mistakes

  • Too broad: "Fix all the tests" → agent gets lost
  • No context: Paste error messages and test names
  • No constraints: Agent might refactor everything
  • Vague output: Specify "Return summary of root cause and changes"