parallel-task

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Parallel Task Executor

并行任务执行器

Use Orchestration Mode. Parse plan files and delegate tasks to parallel subagents.
使用编排模式。解析计划文件并将任务委派给并行子Agent。

Process

流程

Step 1: Parse Request

步骤1:解析请求

Extract from user request:
  1. Plan file: The markdown plan to read
  2. Sprint/Phase (optional): Which section to run
If sprint not provided, ask user which to run.
从用户请求中提取:
  1. 计划文件:要读取的Markdown计划
  2. 迭代/阶段(可选):要运行的章节
如果未提供迭代信息,询问用户要运行哪一个。

Step 2: Read & Parse Plan

步骤2:读取并解析计划

  1. Find sprint/phase section (e.g.,
    ## Sprint 1:
    )
  2. Extract task subsections (e.g.,
    ### Task 1.1:
    )
  3. For each task, extract:
    • Task ID and name
    • Full content (description, location, acceptance criteria, validation)
  4. Build task list
  1. 找到迭代/阶段章节(例如:
    ## Sprint 1:
  2. 提取任务子章节(例如:
    ### Task 1.1:
  3. 针对每个任务,提取:
    • 任务ID和名称
    • 完整内容(描述、位置、验收标准、验证方式)
  4. 构建任务列表

Step 3: Launch Subagents

步骤3:启动子Agent

For each task, launch subagent with:
  • description: "Implement task [ID]: [name]"
  • prompt: Use template below
If there are multiple unblocked tasks, launch multiple subagents in parallel.
针对每个任务,启动子Agent并传入:
  • 描述:"实现任务 [ID]: [名称]"
  • 提示词:使用下方的模板
如果存在多个未阻塞的任务,并行启动多个子Agent。

Task Prompt Template

任务提示词模板

You are implementing a specific task from a development plan.
You are implementing a specific task from a development plan.

Context

Context

  • Plan: [filename] - [sprint/phase]
  • Goals: [relevant overview from plan]
  • Dependencies: [prerequisites for this task]
  • Related tasks: [tasks in same sprint]
  • Constraints: [risks from plan]
  • Plan: [filename] - [sprint/phase]
  • Goals: [relevant overview from plan]
  • Dependencies: [prerequisites for this task]
  • Related tasks: [tasks in same sprint]
  • Constraints: [risks from plan]

Your Task

Your Task

Task [ID]: [Name]
Location: [File paths] Description: [Full description]
Acceptance Criteria: [List from plan]
Validation: [Tests or verification from plan]
Task [ID]: [Name]
Location: [File paths] Description: [Full description]
Acceptance Criteria: [List from plan]
Validation: [Tests or verification from plan]

Instructions

Instructions

  1. Examine and explore the plan, all relevant files & dependencies. Ensure ambiguities are cleared up.
  2. Implement changes for all acceptance criteria
  3. Keep work atomic and committable
  4. For each file: read first, edit carefully, preserve formatting
  5. Run validation if feasible
  6. Return summary of:
    • Files modified/created
    • Changes made
    • How criteria are satisfied
    • Validation performed or deferred
  1. Examine and explore the plan, all relevant files & dependencies. Ensure ambiguities are cleared up.
  2. Implement changes for all acceptance criteria
  3. Keep work atomic and committable
  4. For each file: read first, edit carefully, preserve formatting
  5. Run validation if feasible
  6. Return summary of:
    • Files modified/created
    • Changes made
    • How criteria are satisfied
    • Validation performed or deferred

Important

Important

  • Be careful with paths
  • Stop and describe blockers if encountered
  • Focus on this specific task
undefined
  • Be careful with paths
  • Stop and describe blockers if encountered
  • Focus on this specific task
undefined

Step 4: Monitor & Log

步骤4:监控与记录

After subagents complete:
  1. Collect results
  2. ALWAYS mark completed tasks and update with:
    • Concise work log
    • Files modified/created
    • Errors or gotchas encountered
子Agent完成后:
  1. 收集结果
  2. 务必标记已完成的任务,并更新以下信息:
    • 简洁的工作日志
    • 修改/创建的文件
    • 遇到的错误或注意事项

Step 5: Repeat

步骤5:重复执行

Now, pause and read the whole plan again to see what new tasks are unblocked.
Start back at step 3. Continue launching agents on unblocked tasks in parallel.
Repeat this loop until the plan is done.
Do not stop until the plan is fully completed or you encounter a blocker.
现在,暂停并重新阅读整个计划,查看哪些新任务已解除阻塞。
回到步骤3,继续为已解除阻塞的任务并行启动Agent。
重复此循环,直到计划完成。
在计划完全完成或遇到阻塞前,请勿停止。

Step 6: Validate

步骤6:验证

After completing all tasks, validate the plan's success by checking the final state against the original plan. Perform available tests and ensure success. If there are any issues, address them before marking the plan as complete.
After validation, provide a summary of:
  • Files modified/created
  • Changes made
  • How criteria are satisfied
  • Validation performed or deferred
完成所有任务后,通过将最终状态与原始计划进行对比,验证计划是否成功。执行可用测试并确保成功。如果存在任何问题,在标记计划为完成前解决这些问题。
验证完成后,提供以下内容的总结:
  • 修改/创建的文件
  • 所做的更改
  • 验收标准的满足情况
  • 已执行或推迟的验证操作

Error Handling

错误处理

  • Sprint not found: List available sprints/phases
  • Parse failure: Show what was tried, ask for clarification
  • 未找到迭代:列出可用的迭代/阶段
  • 解析失败:展示已尝试的操作,请求用户澄清

Example Usage

示例用法

/parallel-task plan.md
/parallel-task ./plans/auth-plan.md sprint 2
/parallel-task user-profile-plan.md phase 1
/parallel-task plan.md
/parallel-task ./plans/auth-plan.md sprint 2
/parallel-task user-profile-plan.md phase 1

Execution Summary Template

执行总结模板

markdown
undefined
markdown
undefined

Sprint/Phase Execution Summary

Sprint/Phase Execution Summary

Tasks Assigned: [N]

Tasks Assigned: [N]

Completed

Completed

  • Task [ID]: [Name] - [Brief summary]
  • Task [ID]: [Name] - [Brief summary]

Issues

Issues

  • Task [ID]: [Name]
    • Issue: [What went wrong]
    • Resolution: [How resolved or what's needed]
  • Task [ID]: [Name]
    • Issue: [What went wrong]
    • Resolution: [How resolved or what's needed]

Blocked

Blocked

  • Task [ID]: [Name]
    • Blocker: [What's preventing completion]
    • Next Steps: [What needs to happen]
  • Task [ID]: [Name]
    • Blocker: [What's preventing completion]
    • Next Steps: [What needs to happen]

Overall Status

Overall Status

[Completion summary]
[Completion summary]

Files Modified

Files Modified

[List of changed files]
[List of changed files]

Next Steps

Next Steps

[Recommendations]
undefined
[Recommendations]
undefined