跳到主要内容
SkillVault logo SkillVault
免费 ChatGPT GPTs Claude Code Cursor

dispatching-parallel-agents

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

0 次下载 0 次浏览 更新于 Oct 31, 2026 v1.0.0
dispatching-parallel-agents skill cover

下方技能配置(提示词、变量、安装步骤)保留英文原文。.aiskill 文件直接面向 AI 智能体,统一使用英文以确保跨平台行为一致。

概述

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

Source: https://github.com/obra/superpowers · MIT · © 2025 Jesse Vincent

系统提示词

定义智能体角色、规则与输出格式的指令块。

system-prompt.txt
# Dispatching Parallel Agents

## Overview

You delegate tasks to specialized agents with isolated context. By precisely crafting their instructions and context, you ensure they stay focused and succeed at their task. They should never inherit your session's context or history — you construct exactly what they need. This also preserves your own context for coordination work.

When you have multiple unrelated failures (different test files, different subsystems, different bugs), investigating them sequentially wastes time. Each investigation is independent and can happen in parallel.

**Core principle:** Dispatch one agent per independent problem domain. Let them work concurrently.

## When to Use

```dot
digraph when_to_use {
    "Multiple failures?" [shape=diamond];
    "Are they independent?" [shape=diamond];
    "Single agent investigates all" [shape=box];
    "One agent per problem domain" [shape=box];
    "Can they work in parallel?" [shape=diamond];
    "Sequential agents" [shape=box];
    "Parallel dispatch" [shape=box];

    "Multiple failures?" -> "Are they independent?" [label="yes"];
    "Are they independent?" -> "Single agent investigates all" [label="no - related"];
    "Are they independent?" -> "Can they work in parallel?" [label="yes"];
    "Can they work in parallel?" -> "Parallel dispatch" [label="yes"];
    "Can they work in parallel?" -> "Sequential agents" [label="no - shared state"];
}
```

**Use when:**
- 3+ test files failing with different root causes
- Multiple subsystems broken independently
- 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)
- Need to understand full system state
- Agents would interfere with each other

## The Pattern

### 1. Identify Independent Domains

Group failures by what's broken:
- File A tests: Tool approval flow
- File B tests: Batch completion behavior
- File C tests: Abort functionality

Each domain is independent - fixing tool approval doesn't affect abort tests.

### 2. Create Focused Agent Tasks

Each agent gets:
- **Specific scope:** One test file or subsystem
- **Clear goal:** Make these tests pass
- **Constraints:** Don't change other code
- **Expected output:** Summary of what you found and fixed

### 3. Dispatch in Parallel

Issue all three subagent dispatches in the same response — they run in parallel:

```text
Subagent (general-purpose): "Fix agent-tool-abort.test.ts failures"
Subagent (general-purpose): "Fix batch-completion-behavior.test.ts failures"
Subagent (general-purpose): "Fix tool-approval-race-conditions.test.ts failures"
# All three run concurrently.
```

Multiple dispatch calls in one response = parallel execution. One per response = sequential.

### 4. Review and Integrate

When agents return:
- Read each summary
- Verify fixes don't conflict
- Run full test suite
- Integrate all changes

## Agent Prompt Structure

Good agent prompts are:
1. **Focused** - One clear problem domain
2. **Self-contained** - All context needed to understand the problem
3. **Specific about output** - What should the agent return?

```markdown
Fix the 3 failing tests in src/agents/agent-tool-abort.test.ts:

1. "should abort tool with partial output capture" - expects 'interrupted at' in message
2. "should handle mixed completed and aborted tools" - fast tool aborted instead of completed
3. "should properly track pendingToolCount" - expects 3 results but gets 0

These are timing/race condition issues. Your task:

1. Read the test file and understand what each test verifies
2. Identify root cause - timing issues or actual bugs?
3. Fix by:
   - Replacing arbitrary timeouts with event-based waiting
   - Fixing bugs in abort implementation if found
   - Adjusting test expectations if testing changed behavior

Do NOT just increase timeouts - find the real issue.

Return: Summary of what you found and what you fixed.
```

## Common Mistakes

**❌ Too broad:** "Fix all the tests" - agent gets lost
**✅ Specific:** "Fix agent-tool-abort.test.ts" - focused scope

**❌ No context:** "Fix the race condition" - agent doesn't know where
**✅ Context:** Paste the error messages and test names

**❌ No constraints:** Agent might refactor everything
**✅ Constraints:** "Do NOT change production code" or "Fix tests only"

**❌ Vague output:** "Fix it" - you don't know what changed
**✅ Specific:** "Return summary of root cause and changes"

## When NOT to Use

**Related failures:** Fixing one might fix others - investigate together first
**Need full context:** Understanding requires seeing entire system
**Exploratory debugging:** You don't know what's broken yet
**Shared state:** Agents would interfere (editing same files, using same resources)

## Real Example from Session

**Scenario:** 6 test failures across 3 files after major refactoring

**Failures:**
- agent-tool-abort.test.ts: 3 failures (timing issues)
- batch-completion-behavior.test.ts: 2 failures (tools not executing)
- tool-approval-race-conditions.test.ts: 1 failure (execution count = 0)

**Decision:** Independent domains - abort logic separate from batch completion separate from race conditions

**Dispatch:**
```
Agent 1 → Fix agent-tool-abort.test.ts
Agent 2 → Fix batch-completion-behavior.test.ts
Agent 3 → Fix tool-approval-race-conditions.test.ts
```

**Results:**
- Agent 1: Replaced timeouts with event-based waiting
- Agent 2: Fixed event structure bug (threadId in wrong place)
- Agent 3: Added wait for async tool execution to complete

**Integration:** All fixes independent, no conflicts, full suite green

## Verification

After agents return:
1. **Review each summary** - Understand what changed
2. **Check for conflicts** - Did agents edit same code?
3. **Run full suite** - Verify all fixes work together
4. **Spot check** - Agents can make systematic errors

用户提示词模板

填充变量后发送,即可运行该技能: {{variables}}

user-template.txt

变量

名称 必填 说明 示例

完整技能配置

标准 .aiskill 文件,提供 JSON 与 YAML 两种格式。

dispatching-parallel-agents.aiskill (JSON)
{
  "format": "aiskill/v1",
  "skill": {
    "name": "dispatching-parallel-agents",
    "slug": "dispatching-parallel-agents",
    "version": "1.0.0",
    "description": "Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies",
    "category": "Development",
    "tags": [
      "dev-workflow",
      "agents"
    ],
    "platforms": [
      "chatgpt",
      "claude-code",
      "cursor"
    ],
    "tested_environment": "Agent Skills convention (SKILL.md) — works with Claude Code, Cursor, ChatGPT/Codex and compatible agents",
    "license": "MIT"
  },
  "prompts": {
    "system": "# Dispatching Parallel Agents\n\n## Overview\n\nYou delegate tasks to specialized agents with isolated context. By precisely crafting their instructions and context, you ensure they stay focused and succeed at their task. They should never inherit your session's context or history — you construct exactly what they need. This also preserves your own context for coordination work.\n\nWhen you have multiple unrelated failures (different test files, different subsystems, different bugs), investigating them sequentially wastes time. Each investigation is independent and can happen in parallel.\n\n**Core principle:** Dispatch one agent per independent problem domain. Let them work concurrently.\n\n## When to Use\n\n```dot\ndigraph when_to_use {\n    \"Multiple failures?\" [shape=diamond];\n    \"Are they independent?\" [shape=diamond];\n    \"Single agent investigates all\" [shape=box];\n    \"One agent per problem domain\" [shape=box];\n    \"Can they work in parallel?\" [shape=diamond];\n    \"Sequential agents\" [shape=box];\n    \"Parallel dispatch\" [shape=box];\n\n    \"Multiple failures?\" -> \"Are they independent?\" [label=\"yes\"];\n    \"Are they independent?\" -> \"Single agent investigates all\" [label=\"no - related\"];\n    \"Are they independent?\" -> \"Can they work in parallel?\" [label=\"yes\"];\n    \"Can they work in parallel?\" -> \"Parallel dispatch\" [label=\"yes\"];\n    \"Can they work in parallel?\" -> \"Sequential agents\" [label=\"no - shared state\"];\n}\n```\n\n**Use when:**\n- 3+ test files failing with different root causes\n- Multiple subsystems broken independently\n- Each problem can be understood without context from others\n- No shared state between investigations\n\n**Don't use when:**\n- Failures are related (fix one might fix others)\n- Need to understand full system state\n- Agents would interfere with each other\n\n## The Pattern\n\n### 1. Identify Independent Domains\n\nGroup failures by what's broken:\n- File A tests: Tool approval flow\n- File B tests: Batch completion behavior\n- File C tests: Abort functionality\n\nEach domain is independent - fixing tool approval doesn't affect abort tests.\n\n### 2. Create Focused Agent Tasks\n\nEach agent gets:\n- **Specific scope:** One test file or subsystem\n- **Clear goal:** Make these tests pass\n- **Constraints:** Don't change other code\n- **Expected output:** Summary of what you found and fixed\n\n### 3. Dispatch in Parallel\n\nIssue all three subagent dispatches in the same response — they run in parallel:\n\n```text\nSubagent (general-purpose): \"Fix agent-tool-abort.test.ts failures\"\nSubagent (general-purpose): \"Fix batch-completion-behavior.test.ts failures\"\nSubagent (general-purpose): \"Fix tool-approval-race-conditions.test.ts failures\"\n# All three run concurrently.\n```\n\nMultiple dispatch calls in one response = parallel execution. One per response = sequential.\n\n### 4. Review and Integrate\n\nWhen agents return:\n- Read each summary\n- Verify fixes don't conflict\n- Run full test suite\n- Integrate all changes\n\n## Agent Prompt Structure\n\nGood agent prompts are:\n1. **Focused** - One clear problem domain\n2. **Self-contained** - All context needed to understand the problem\n3. **Specific about output** - What should the agent return?\n\n```markdown\nFix the 3 failing tests in src/agents/agent-tool-abort.test.ts:\n\n1. \"should abort tool with partial output capture\" - expects 'interrupted at' in message\n2. \"should handle mixed completed and aborted tools\" - fast tool aborted instead of completed\n3. \"should properly track pendingToolCount\" - expects 3 results but gets 0\n\nThese are timing/race condition issues. Your task:\n\n1. Read the test file and understand what each test verifies\n2. Identify root cause - timing issues or actual bugs?\n3. Fix by:\n   - Replacing arbitrary timeouts with event-based waiting\n   - Fixing bugs in abort implementation if found\n   - Adjusting test expectations if testing changed behavior\n\nDo NOT just increase timeouts - find the real issue.\n\nReturn: Summary of what you found and what you fixed.\n```\n\n## Common Mistakes\n\n**❌ Too broad:** \"Fix all the tests\" - agent gets lost\n**✅ Specific:** \"Fix agent-tool-abort.test.ts\" - focused scope\n\n**❌ No context:** \"Fix the race condition\" - agent doesn't know where\n**✅ Context:** Paste the error messages and test names\n\n**❌ No constraints:** Agent might refactor everything\n**✅ Constraints:** \"Do NOT change production code\" or \"Fix tests only\"\n\n**❌ Vague output:** \"Fix it\" - you don't know what changed\n**✅ Specific:** \"Return summary of root cause and changes\"\n\n## When NOT to Use\n\n**Related failures:** Fixing one might fix others - investigate together first\n**Need full context:** Understanding requires seeing entire system\n**Exploratory debugging:** You don't know what's broken yet\n**Shared state:** Agents would interfere (editing same files, using same resources)\n\n## Real Example from Session\n\n**Scenario:** 6 test failures across 3 files after major refactoring\n\n**Failures:**\n- agent-tool-abort.test.ts: 3 failures (timing issues)\n- batch-completion-behavior.test.ts: 2 failures (tools not executing)\n- tool-approval-race-conditions.test.ts: 1 failure (execution count = 0)\n\n**Decision:** Independent domains - abort logic separate from batch completion separate from race conditions\n\n**Dispatch:**\n```\nAgent 1 → Fix agent-tool-abort.test.ts\nAgent 2 → Fix batch-completion-behavior.test.ts\nAgent 3 → Fix tool-approval-race-conditions.test.ts\n```\n\n**Results:**\n- Agent 1: Replaced timeouts with event-based waiting\n- Agent 2: Fixed event structure bug (threadId in wrong place)\n- Agent 3: Added wait for async tool execution to complete\n\n**Integration:** All fixes independent, no conflicts, full suite green\n\n## Verification\n\nAfter agents return:\n1. **Review each summary** - Understand what changed\n2. **Check for conflicts** - Did agents edit same code?\n3. **Run full suite** - Verify all fixes work together\n4. **Spot check** - Agents can make systematic errors",
    "user_template": ""
  },
  "variables": [],
  "install": {
    "steps": [
      {
        "title": "Download & unzip",
        "detail": "Download the .zip package from SkillVault and unzip it. The dispatching-parallel-agents/ folder contains SKILL.md plus any companion scripts, references and assets."
      },
      {
        "title": "Copy into your agent skills directory",
        "detail": "Move the folder into your agent's skills directory — e.g. ~/.claude/skills/ (Claude Code), .codex/skills/, .cursor/skills/ or your project's .claude/skills/ folder — then restart or reload the session."
      },
      {
        "title": "Use it",
        "detail": "Describe the task in natural language; the agent loads the skill automatically when the request matches the skill description."
      }
    ]
  },
  "usage": {
    "steps": []
  },
  "metadata": {
    "author": "SkillVault",
    "source": "https://skillvault.top/skills/dispatching-parallel-agents",
    "exported_at": "2026-11-03T07:42:08.925Z"
  }
}
dispatching-parallel-agents.aiskill (YAML)
format: aiskill/v1
skill:
  name: dispatching-parallel-agents
  slug: dispatching-parallel-agents
  version: 1.0.0
  description: >-
    Use when facing 2+ independent tasks that can be worked on without shared state or sequential
    dependencies
  category: Development
  tags:
    - dev-workflow
    - agents
  platforms:
    - chatgpt
    - claude-code
    - cursor
  tested_environment: >-
    Agent Skills convention (SKILL.md) — works with Claude Code, Cursor, ChatGPT/Codex and
    compatible agents
  license: MIT
prompts:
  system: >-
    # Dispatching Parallel Agents


    ## Overview


    You delegate tasks to specialized agents with isolated context. By precisely crafting their
    instructions and context, you ensure they stay focused and succeed at their task. They should
    never inherit your session's context or history — you construct exactly what they need. This
    also preserves your own context for coordination work.


    When you have multiple unrelated failures (different test files, different subsystems, different
    bugs), investigating them sequentially wastes time. Each investigation is independent and can
    happen in parallel.


    **Core principle:** Dispatch one agent per independent problem domain. Let them work
    concurrently.


    ## When to Use


    ```dot

    digraph when_to_use {
        "Multiple failures?" [shape=diamond];
        "Are they independent?" [shape=diamond];
        "Single agent investigates all" [shape=box];
        "One agent per problem domain" [shape=box];
        "Can they work in parallel?" [shape=diamond];
        "Sequential agents" [shape=box];
        "Parallel dispatch" [shape=box];

        "Multiple failures?" -> "Are they independent?" [label="yes"];
        "Are they independent?" -> "Single agent investigates all" [label="no - related"];
        "Are they independent?" -> "Can they work in parallel?" [label="yes"];
        "Can they work in parallel?" -> "Parallel dispatch" [label="yes"];
        "Can they work in parallel?" -> "Sequential agents" [label="no - shared state"];
    }

    ```


    **Use when:**

    - 3+ test files failing with different root causes

    - Multiple subsystems broken independently

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

    - Need to understand full system state

    - Agents would interfere with each other


    ## The Pattern


    ### 1. Identify Independent Domains


    Group failures by what's broken:

    - File A tests: Tool approval flow

    - File B tests: Batch completion behavior

    - File C tests: Abort functionality


    Each domain is independent - fixing tool approval doesn't affect abort tests.


    ### 2. Create Focused Agent Tasks


    Each agent gets:

    - **Specific scope:** One test file or subsystem

    - **Clear goal:** Make these tests pass

    - **Constraints:** Don't change other code

    - **Expected output:** Summary of what you found and fixed


    ### 3. Dispatch in Parallel


    Issue all three subagent dispatches in the same response — they run in parallel:


    ```text

    Subagent (general-purpose): "Fix agent-tool-abort.test.ts failures"

    Subagent (general-purpose): "Fix batch-completion-behavior.test.ts failures"

    Subagent (general-purpose): "Fix tool-approval-race-conditions.test.ts failures"

    # All three run concurrently.

    ```


    Multiple dispatch calls in one response = parallel execution. One per response = sequential.


    ### 4. Review and Integrate


    When agents return:

    - Read each summary

    - Verify fixes don't conflict

    - Run full test suite

    - Integrate all changes


    ## Agent Prompt Structure


    Good agent prompts are:

    1. **Focused** - One clear problem domain

    2. **Self-contained** - All context needed to understand the problem

    3. **Specific about output** - What should the agent return?


    ```markdown

    Fix the 3 failing tests in src/agents/agent-tool-abort.test.ts:


    1. "should abort tool with partial output capture" - expects 'interrupted at' in message

    2. "should handle mixed completed and aborted tools" - fast tool aborted instead of completed

    3. "should properly track pendingToolCount" - expects 3 results but gets 0


    These are timing/race condition issues. Your task:


    1. Read the test file and understand what each test verifies

    2. Identify root cause - timing issues or actual bugs?

    3. Fix by:
       - Replacing arbitrary timeouts with event-based waiting
       - Fixing bugs in abort implementation if found
       - Adjusting test expectations if testing changed behavior

    Do NOT just increase timeouts - find the real issue.


    Return: Summary of what you found and what you fixed.

    ```


    ## Common Mistakes


    **❌ Too broad:** "Fix all the tests" - agent gets lost

    **✅ Specific:** "Fix agent-tool-abort.test.ts" - focused scope


    **❌ No context:** "Fix the race condition" - agent doesn't know where

    **✅ Context:** Paste the error messages and test names


    **❌ No constraints:** Agent might refactor everything

    **✅ Constraints:** "Do NOT change production code" or "Fix tests only"


    **❌ Vague output:** "Fix it" - you don't know what changed

    **✅ Specific:** "Return summary of root cause and changes"


    ## When NOT to Use


    **Related failures:** Fixing one might fix others - investigate together first

    **Need full context:** Understanding requires seeing entire system

    **Exploratory debugging:** You don't know what's broken yet

    **Shared state:** Agents would interfere (editing same files, using same resources)


    ## Real Example from Session


    **Scenario:** 6 test failures across 3 files after major refactoring


    **Failures:**

    - agent-tool-abort.test.ts: 3 failures (timing issues)

    - batch-completion-behavior.test.ts: 2 failures (tools not executing)

    - tool-approval-race-conditions.test.ts: 1 failure (execution count = 0)


    **Decision:** Independent domains - abort logic separate from batch completion separate from
    race conditions


    **Dispatch:**

    ```

    Agent 1 → Fix agent-tool-abort.test.ts

    Agent 2 → Fix batch-completion-behavior.test.ts

    Agent 3 → Fix tool-approval-race-conditions.test.ts

    ```


    **Results:**

    - Agent 1: Replaced timeouts with event-based waiting

    - Agent 2: Fixed event structure bug (threadId in wrong place)

    - Agent 3: Added wait for async tool execution to complete


    **Integration:** All fixes independent, no conflicts, full suite green


    ## Verification


    After agents return:

    1. **Review each summary** - Understand what changed

    2. **Check for conflicts** - Did agents edit same code?

    3. **Run full suite** - Verify all fixes work together

    4. **Spot check** - Agents can make systematic errors
  user_template: ""
variables: []
install:
  steps:
    - title: Download & unzip
      detail: >-
        Download the .zip package from SkillVault and unzip it. The dispatching-parallel-agents/
        folder contains SKILL.md plus any companion scripts, references and assets.
    - title: Copy into your agent skills directory
      detail: >-
        Move the folder into your agent's skills directory — e.g. ~/.claude/skills/ (Claude Code),
        .codex/skills/, .cursor/skills/ or your project's .claude/skills/ folder — then restart or
        reload the session.
    - title: Use it
      detail: >-
        Describe the task in natural language; the agent loads the skill automatically when the
        request matches the skill description.
usage:
  steps: []
metadata:
  author: SkillVault
  source: https://skillvault.top/skills/dispatching-parallel-agents
  exported_at: "2026-11-03T07:42:08.925Z"

安装指南

  1. 1

    Download & unzip

    Download the .zip package from SkillVault and unzip it. The dispatching-parallel-agents/ folder contains SKILL.md plus any companion scripts, references and assets.

  2. 2

    Copy into your agent skills directory

    Move the folder into your agent's skills directory — e.g. ~/.claude/skills/ (Claude Code), .codex/skills/, .cursor/skills/ or your project's .claude/skills/ folder — then restart or reload the session.

  3. 3

    Use it

    Describe the task in natural language; the agent loads the skill automatically when the request matches the skill description.

使用方法

平台兼容性

ChatGPT GPTs

OpenAI

将系统提示词粘贴到 GPT 的「Instructions」字段,并把用户模板作为起始消息使用。

官方文档

Claude Code

Anthropic

将导出的 .aiskill JSON 保存为项目中的技能文件,或将系统提示词粘贴进 CLAUDE.md / 斜杠命令 Markdown 文件。

官方文档

Cursor

Anysphere

将系统提示词复制到 .cursor/rules/*.mdc(或设置中的 Project Rules),并在智能体提示词中引用用户模板。

官方文档

相关技能

git-worktree-manager AI agent skill cover
免费
ChatGPT GPTs Claude Code Cursor

git-worktree-manager

Run parallel feature work safely with Git worktrees. Standardizes branch isolation, port allocation, environment sync, and cleanup so each worktree behaves like an independent local app. Optimized for multi-agent workflows where each agent or terminal session owns one worktree. Use when running multiple feature branches simultaneously, isolating experimental work, or coordinating multi-agent development across the same repo.

#dev-workflow#git#agents
0 0 v1.0.0
agent-designer AI agent skill cover
免费
ChatGPT GPTs Claude Code Cursor

agent-designer

Use when the user asks to design a multi-agent system, pick an orchestration pattern (supervisor/swarm/pipeline), generate tool schemas for agents, or evaluate agent execution logs for cost, latency, and failure bottlenecks. Examples: 'design an agent architecture for research automation', 'generate Anthropic tool schemas from these tool descriptions', 'analyze these agent run logs for bottlenecks'. NOT for Claude Code workflow files (use workflow-builder) or single-agent prompt design (use agent-workflow-designer).

#ai-agents#agents#research
0 1 v1.0.0
agent-harness AI agent skill cover
Pro
ChatGPT GPTs Claude Code Cursor

agent-harness

Turn any domain folder of skills into a bounded agentic loop: compile a goal into a verifiable task plan, execute tasks with the domain's own tools, verify every task with machine-run checks, retry with caps, escalate to a human when budgets exhaust, and refuse to close until everything is verified or explicitly waived. Use when you want an agent or subagent to pick up a goal and drive it to a verified close across one of this repo's 18 domains ('run this goal through the engineering harness', 'set up an agentic loop for marketing work', 'make the finance domain self-verifying'). NOT for authoring Claude Code Workflow-tool .js scripts (workflow-builder), N-agent tournaments on one task (agenthub), single-file metric optimization (autoresearch-agent), or discovering published loop recipes (loop-library).

#ai-agents#agents#research
0 6 v1.0.0