ワンクリックで
execute-batch
Handles one batch of tasks. Spawns task agents in parallel using git worktrees, waits for completion, and updates state.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Handles one batch of tasks. Spawns task agents in parallel using git worktrees, waits for completion, and updates state.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Break down a PRD or CRD into self-contained implementation tasks for LLM execution. Use when you have a PRD/CRD file and want to generate executable task files for autonomous implementation.
Incremental PROJECT.md update using git diff. Only re-analyzes changed areas for efficient context maintenance.
Analyze the impact of a proposed change on an existing codebase. Identifies affected files, features, and potential breaking changes.
Deep codebase investigation to generate PROJECT.md context. Analyzes architecture, patterns, features, APIs, and schemas.
Orchestrates Change Request Document workflow. Manages context, captures changes, analyzes impact, and generates CRD files.
Main entry point for hierarchical task execution. Orchestrates layer-by-layer implementation of PRD tasks with parallel worktree execution.
| name | execute-batch |
| description | Handles one batch of tasks. Spawns task agents in parallel using git worktrees, waits for completion, and updates state. |
| context | fork |
| allowed-tools | Read Write Bash Task Glob TaskOutput |
| model | claude-sonnet-4-5 |
You coordinate the parallel execution of a batch of independent tasks. Each task runs in its own git worktree via the Task tool.
Parse these from the prompt:
| Argument | Required | Description |
|---|---|---|
--tasks-path <path> | Yes | Path to tasks directory |
--task-ids <ids> | Yes | Comma-separated task IDs (e.g., "L1-001,L1-002,L1-006") |
--project-path <path> | Yes | Main project directory |
--worktree-dir <path> | Yes | Directory for worktrees |
--batch-number <N> | Yes | Batch number within layer |
--layer <name> | Yes | Layer name (for status reporting) |
Split the comma-separated task IDs:
--task-ids "L1-001,L1-002,L1-006"
→ ["L1-001", "L1-002", "L1-006"]
Read execute-state.json to get current state for each task:
cat {tasks_path}/execute-state.json
Check each task's status:
pending: Will create new worktreein_progress with worktree: Will resume with existing worktreefailed: Will retry with retry feedbackFor each task ID, locate the task XML file:
find {tasks_path} -name "{task_id}-*.xml" -type f
Example: L1-001 → docs/tasks/voice-prd/1-foundation/L1-001-create-enums.xml
CRITICAL: Launch ALL task agents in a SINGLE message using multiple Task tool calls.
For each task, invoke the Task tool:
Task(
subagent_type: "task-implementer",
prompt: <task execution prompt>,
run_in_background: true,
description: "Execute task {task_id}"
)
Task execution prompt template:
You are executing task {task_id} using the /execute-task skill.
Execute the following command:
/execute-task --task-file {task_file_path} --project-path {project_path} --worktree-dir {worktree_dir} --attempt {attempt}
{IF RETRY:}
--worktree-path {existing_worktree_path}
--retry-feedback '{retry_feedback_json}'
{END IF}
Return the RESULT JSON when complete.
Example - launching 3 tasks in parallel:
In a SINGLE message, call Task tool 3 times:
<Task>
<subagent_type>task-implementer</subagent_type>
<run_in_background>true</run_in_background>
<description>Execute task L1-001</description>
<prompt>Execute /execute-task --task-file .../L1-001-create-enums.xml ...</prompt>
</Task>
<Task>
<subagent_type>task-implementer</subagent_type>
<run_in_background>true</run_in_background>
<description>Execute task L1-002</description>
<prompt>Execute /execute-task --task-file .../L1-002-create-model.xml ...</prompt>
</Task>
<Task>
<subagent_type>task-implementer</subagent_type>
<run_in_background>true</run_in_background>
<description>Execute task L1-006</description>
<prompt>Execute /execute-task --task-file .../L1-006-setup-config.xml ...</prompt>
</Task>
After launching all tasks, use TaskOutput to wait for each:
TaskOutput(task_id: "{task_1_id}", block: true, timeout: 600000)
TaskOutput(task_id: "{task_2_id}", block: true, timeout: 600000)
TaskOutput(task_id: "{task_3_id}", block: true, timeout: 600000)
Timeout: 10 minutes per task (600000ms)
Parse the RESULT JSON from each task agent:
Success result:
{
"task_id": "L1-001",
"status": "verified",
"attempt": 1,
"worktree_path": "/path/.worktrees/L1-001",
"branch": "worktree-L1-001",
"commit_hash": "abc1234",
"files_created": ["app/models/enums.py"],
"verification_summary": "3/3 steps passed"
}
Failure result (will retry):
{
"task_id": "L1-002",
"status": "failed",
"attempt": 2,
"worktree_path": "/path/.worktrees/L1-002",
"error": {
"type": "verification_failed",
"step": "pytest tests/...",
"message": "1 test failed"
},
"retry_feedback": "Fix validation in create_project"
}
Abandoned result (max retries):
{
"task_id": "L1-003",
"status": "abandoned",
"attempt": 5,
"worktree_path": "/path/.worktrees/L1-003",
"final_error": "Still failing after 5 attempts"
}
Read current state, update each task, write back:
# For each task result:
if result["status"] == "verified":
state["tasks"][task_id]["status"] = "verified"
state["tasks"][task_id]["completed_at"] = now()
state["merge_queue"].append({
"task_id": task_id,
"priority": next_priority,
"status": "ready"
})
elif result["status"] == "failed":
state["tasks"][task_id]["status"] = "failed"
state["tasks"][task_id]["errors"].append(result["error"])
elif result["status"] == "abandoned":
state["tasks"][task_id]["status"] = "abandoned"
state["abandoned"].append(task_id)
Write updated state:
echo '{updated_state_json}' > {tasks_path}/execute-state.json
Output batch completion summary:
[BATCH {layer} #{batch_number}] Complete
Verified: L1-001, L1-002
Failed: L1-003 (attempt 2, will retry)
Abandoned: none
Merge queue: 2 tasks ready
Output structured result for layer agent:
{
"batch_number": 1,
"layer": "1-foundation",
"tasks_total": 3,
"verified": ["L1-001", "L1-002"],
"failed": ["L1-003"],
"abandoned": [],
"merge_queue_ready": 2,
"should_stop": false
}
If any task is abandoned:
{
"batch_number": 1,
"layer": "1-foundation",
"tasks_total": 3,
"verified": ["L1-001"],
"failed": [],
"abandoned": ["L1-002"],
"merge_queue_ready": 1,
"should_stop": true,
"stop_reason": "Task L1-002 abandoned after 5 attempts"
}
run_in_background: true--max-parallel limit from layer agentIf TaskOutput times out:
If Task tool returns error:
If state file can't be written:
End with structured result:
BATCH_RESULT:
{json object}
The layer agent parses this to update layer state and decide next steps.
For minimal output mode:
[BATCH 1-foundation #1] L1-001 ✓, L1-002 ✓, L1-006 ✓ (3/3)
With failures:
[BATCH 2-backend #2] L2-003 ✓, L2-004 ✗ (attempt 2), L2-005 ✓ (2/3)