dispatching-parallel-agents-zh

Dispatch independent problem domains to multiple agents to process in parallel, enabling parallelized task decomposition and handling.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "dispatching-parallel-agents-zh" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-cb5d1e2c6783a7b77ed4a0e62717f061098ec1b7c64ab8ad68d22759ff2c1f2c. Verify the upstream source and version against https://skillhub.cn/skills/org-02qudk26/dispatching-parallel-agents-zh before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Dispatch independent problem domains to multiple agents to process in parallel, enabling parallelized task decomposition and handling.

0 Downloads

Introduction source: third_party · org-02qudk26 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: dispatching-parallel-agents
slug: dispatching-parallel-agents
displayName: 派发并行智能体
description: 当面临 2 个及以上可独立工作、无需共享状态或顺序依赖的任务时使用。
summary: 将独立问题域派发给多个智能体并行处理。
version: 1.0.0

派发并行智能体

概述

当你面对多个互不相关的失败时(不同的测试文件、不同的子系统、不同的 bug),逐个顺序调查会浪费时间。每个调查都是独立的,可以并行进行。

核心原则: 为每个独立问题域派发一个智能体,让它们并发工作。

使用时机

digraph when_to_use {
    "多个失败?" [shape=diamond];
    "它们彼此独立吗?" [shape=diamond];
    "单个智能体调查全部" [shape=box];
    "每个问题域一个智能体" [shape=box];
    "它们能并行工作吗?" [shape=diamond];
    "顺序智能体" [shape=box];
    "并行派发" [shape=box];

    "多个失败?" -> "它们彼此独立吗?" [label="是"];
    "它们彼此独立吗?" -> "单个智能体调查全部" [label="否 - 相关"];
    "它们彼此独立吗?" -> "它们能并行工作吗?" [label="是"];
    "它们能并行工作吗?" -> "并行派发" [label="是"];
    "它们能并行工作吗?" -> "顺序智能体" [label="否 - 共享状态"];
}

使用场景:

  • 3 个及以上测试文件因不同根因失败
  • 多个子系统独立损坏
  • 每个问题无需其他问题的上下文即可理解
  • 各调查之间无共享状态

不要使用的情况:

  • 失败彼此相关(修复一个可能修复其他)
  • 需要理解完整系统状态
  • 智能体会相互干扰

模式

1. 识别独立的问题域

按“哪里坏了”对失败进行分组:

  • 文件 A 测试:工具审批流程
  • 文件 B 测试:批处理完成行为
  • 文件 C 测试:中止功能

每个域都是独立的——修复工具审批不会影响中止测试。

2. 创建聚焦的智能体任务

每个智能体获得:

  • 具体范围: 一个测试文件或子系统
  • 清晰目标: 让这些测试通过
  • 约束: 不要改动其他代码
  • 预期输出: 你发现和修复内容的摘要

3. 并行派发

// 在 Claude Code / AI 环境中
Task("修复 agent-tool-abort.test.ts 的失败")
Task("修复 batch-completion-behavior.test.ts 的失败")
Task("修复 tool-approval-race-conditions.test.ts 的失败")
// 三个全部并发运行

4. 审查与整合

当智能体返回时:

  • 阅读每个摘要
  • 验证修复无冲突
  • 运行完整测试套件
  • 整合所有改动

智能体提示词结构

好的智能体提示词应当:

  1. 聚焦 - 单一清晰的问题域
  2. 自包含 - 包含理解问题所需的全部上下文
  3. 对输出明确 - 智能体应返回什么?
修复 src/agents/agent-tool-abort.test.ts 中 3 个失败的测试:

1. "should abort tool with partial output capture" - 期望消息中包含 'interrupted at'
2. "should handle mixed completed and aborted tools" - 快速工具被中止而非完成
3. "should properly track pendingToolCount" - 期望得到 3 个结果但得到 0

这些是时序/竞态条件问题。你的任务:

1. 阅读测试文件,理解每个测试验证什么
2. 识别根因 - 时序问题还是真实 bug?
3. 通过以下方式修复:
   - 用基于事件的等待替换任意超时
   - 若发现中止实现中的 bug 则修复
   - 若测试行为已改变则调整测试预期

不要只是增大超时 - 要找到真正的问题。

返回:你发现和修复内容的摘要。

常见错误

❌ 过于宽泛: “修复所有测试” - 智能体会迷失 ✅ 具体: “修复 agent-tool-abort.test.ts” - 范围聚焦

❌ 没有上下文: “修复竞态条件” - 智能体不知道在哪 ✅ 有上下文: 粘贴错误信息和测试名称

❌ 没有约束: 智能体可能会重构一切 ✅ 有约束: “不要改动生产代码” 或 “仅修复测试”

❌ 输出模糊: “修复它” - 你不知道改了什么 ✅ 具体: “返回根因和改动的摘要”

何时不应使用

相关失败: 修复一个可能修复其他 - 先一起调查 需要完整上下文: 理解需要看到整个系统 探索性调试: 你还不知道哪里坏了 共享状态: 智能体会相互干扰(编辑相同文件、使用相同资源)

来自真实会话的示例

场景: 大规模重构后,3 个文件中出现 6 个测试失败

失败:

  • agent-tool-abort.test.ts:3 个失败(时序问题)
  • batch-completion-behavior.test.ts:2 个失败(工具未执行)
  • tool-approval-race-conditions.test.ts:1 个失败(执行次数为 0)

决策: 独立的问题域——中止逻辑、批处理完成、竞态条件三者相互独立

派发:

智能体 1 → 修复 agent-tool-abort.test.ts
智能体 2 → 修复 batch-completion-behavior.test.ts
智能体 3 → 修复 tool-approval-race-conditions.test.ts

结果:

  • 智能体 1:用基于事件的等待替换超时
  • 智能体 2:修复事件结构 bug(threadId 位置错误)
  • 智能体 3:增加对异步工具执行完成的等待

整合: 所有修复相互独立,无冲突,完整套件变绿

节省的时间: 3 个问题并行解决 vs 顺序解决

关键收益

  1. 并行化 - 多个调查同时进行
  2. 聚焦 - 每个智能体范围狭窄,需跟踪的上下文更少
  3. 独立性 - 智能体之间互不干扰
  4. 速度 - 以 1 个问题的时间解决 3 个问题

验证

智能体返回后:

  1. 审查每个摘要 - 理解改了什么
  2. 检查冲突 - 智能体是否编辑了相同代码?
  3. 运行完整套件 - 验证所有修复协同工作
  4. 抽查 - 智能体可能犯系统性错误

真实影响

来自调试会话(2025-10-03):

  • 3 个文件中 6 个失败
  • 3 个智能体并行派发
  • 所有调查并发完成
  • 所有修复成功整合
  • 智能体改动之间零冲突

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供高效的并行调试模式,显著提升多独立问题域场景下的调试效率
  • 具有明确的实用价值和广泛的应用场景
Trigger Precision95/100

Highlights

  • 触发条件描述精准完整,覆盖多种变体和使用场景
  • 提供了清晰的判断流程图和边界说明
Structure and Standards95/100

Highlights

  • 文档结构清晰完整,包含端到端示例和验证步骤
  • frontmatter 完整,章节划分合理
Execution Reliability90/100

Highlights

  • 提供了具体的任务派发示例和智能体提示词结构
  • 覆盖主要异常场景,有明确的约束和输出要求
Evidence Verifiability (mean of the first four)91/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.