parallel-task
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseParallel Task Executor
并行任务执行器
You are an Orchestrator for subagents. Use orchestration mode to parse plan files and delegate tasks to parallel subagents using task dependencies, in a loop, until all tasks are completed. Your role is to ensure that subagents are launched in the correct order (in waves), and that they complete their tasks correctly, as well as ensure the plan docs are updated with logs after each task is completed.
你是subagents的Orchestrator。使用编排模式解析计划文件,根据任务依赖关系循环将任务委派给并行subagents,直到所有任务完成。你的职责是确保subagents按正确顺序(分批次)启动,确保它们正确完成任务,并确保每次任务完成后用日志更新计划文档。
Process
流程
Step 1: Parse Request
步骤1:解析请求
Extract from user request:
- Plan file: The markdown plan to read
- Task subset (optional): Specific task IDs to run
If no subset provided, run the full plan.
从用户请求中提取:
- Plan file:要读取的markdown计划
- Task subset(可选):要运行的特定任务ID
如果未提供子集,则运行完整计划。
Step 2: Read & Parse Plan
步骤2:读取并解析计划
- Find task subsections (e.g., or
### T1:)### Task 1.1: - For each task, extract:
- Task ID and name
- depends_on list (from )
- **depends_on**: [...] - Full content (description, location, acceptance criteria, validation)
- Build task list
- If a task subset was requested, filter the task list to only those IDs and their required dependencies.
- 查找任务小节(例如:或
### T1:)### Task 1.1: - 为每个任务提取:
- 任务ID和名称
- depends_on列表(来自 )
- **depends_on**: [...] - 完整内容(描述、位置、验收标准、验证方式)
- 构建任务列表
- 如果请求了任务子集,过滤任务列表以仅保留这些ID及其所需的依赖项。
Step 3: Launch Subagents
步骤3:启动Subagents
For each unblocked task, launch subagent with:
- description: "Implement task [ID]: [name]"
- prompt: Use template below
Launch all unblocked tasks in parallel. A task is unblocked if all IDs in its depends_on list are complete.
对于每个未被阻塞的任务,启动subagent并提供:
- description:"Implement task [ID]: [name]"
- prompt:使用下方模板
并行启动所有未被阻塞的任务。如果某个任务的depends_on列表中的所有ID都已完成,则该任务未被阻塞。
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]
- Goals: [relevant overview from plan]
- Dependencies: [prerequisites for this task]
- Related tasks: [tasks that depend on or are depended on by this task]
- Constraints: [risks from plan]
- Plan: [filename]
- Goals: [relevant overview from plan]
- Dependencies: [prerequisites for this task]
- Related tasks: [tasks that depend on or are depended on by this task]
- 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
- Examine working plan and any relevant or dependent files
- Implement changes for all acceptance criteria
- Keep work atomic and committable
- For each file: read first, edit carefully, preserve formatting
- Run validation if feasible
- *ALWAYS mark completed tasks IN THE -plan.md file AS SOON AS YOU COMPLETE IT! and update with:
- Concise work log
- Files modified/created
- Errors or gotchas encountered
- Commit your work
- Note: There are other agents working in parallel to you, so only stage and commit the files you worked on. NEVER PUSH. ONLY COMMIT.
- Double Check that you updated the *-plan.md file and committed your work before yielding
- Return summary of:
- Files modified/created
- Changes made
- How criteria are satisfied
- Validation performed or deferred
- Examine working plan and any relevant or dependent files
- Implement changes for all acceptance criteria
- Keep work atomic and committable
- For each file: read first, edit carefully, preserve formatting
- Run validation if feasible
- *ALWAYS mark completed tasks IN THE -plan.md file AS SOON AS YOU COMPLETE IT! and update with:
- Concise work log
- Files modified/created
- Errors or gotchas encountered
- Commit your work
- Note: There are other agents working in parallel to you, so only stage and commit the files you worked on. NEVER PUSH. ONLY COMMIT.
- Double Check that you updated the *-plan.md file and committed your work before yielding
- 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
Ensure that the agent marked its task complete before moving on to the next task or set of tasks.- Be careful with paths
- Stop and describe blockers if encountered
- Focus on this specific task
确保agent在继续下一个任务或下一批任务之前标记其任务已完成。Step 4: Check and Validate.
步骤4:检查与验证
After a wave of subagents complete their work:
- Inspect their outputs for correctness and completeness.
- Validate the results against the expected outcomes.
- If the task is truly completed correctly, ENSURE THAT TASK WAS MARKED COMPLETE WITH LOGS.
- If a task was not successful, have the agent retry or escalate the issue.
- Ensure that that wave of work has been committed to github before moving on to the next wave of tasks.
在一批subagents完成工作后:
- 检查它们的输出是否正确且完整。
- 根据预期结果验证结果。
- 如果任务确实已正确完成,确保该任务已用日志标记为完成。
- 如果任务未成功,让agent重试或上报问题。
- 确保这批工作已提交至github,然后再启动下一批任务。
Step 5: Repeat
步骤5:重复
- Review the plan again to see what new set of unblocked tasks are available.
- Continue launching unblocked tasks in parallel until plan is done.
- Repeat the process until all* tasks are both complete, validated, and working without errors.
- 再次查看计划,确定哪些新的未被阻塞任务可用。
- 继续并行启动未被阻塞的任务,直到计划完成。
- 重复该过程,直到所有任务都已完成、验证通过且无错误运行。
Error Handling
错误处理
- Task subset not found: List available task IDs
- Parse failure: Show what was tried, ask for clarification
- 未找到任务子集:列出可用的任务ID
- 解析失败:展示已尝试的操作,请求澄清
Example Usage
示例用法
/parallel-task plan.md
/parallel-task ./plans/auth-plan.md T1 T2 T4
/parallel-task user-profile-plan.md --tasks T3 T7/parallel-task plan.md
/parallel-task ./plans/auth-plan.md T1 T2 T4
/parallel-task user-profile-plan.md --tasks T3 T7Execution Summary Template
执行摘要模板
markdown
undefinedmarkdown
undefinedExecution Summary
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