Taskmaster — v5 Task Protocol
Purpose
Taskmaster is the default execution protocol for multi-step Codex work. v5
keeps the existing Debug-First core while expanding the skill into three task
shapes:
- Single Task — one deliverable, one shared context
- Epic Task — multiple child tasks with dependencies
- Batch Task — homogeneous row-level work executed through
spawn_agents_on_csv
Core Principles
- The current truth artifact on disk wins over memory.
- No step, subtask, or batch row becomes
DONE without explicit validation.
- Keep verbose reasoning in
PROGRESS.md, EPIC.md, or batch output files, not in the chat.
- Keep failures visible. Do not silently downgrade to manual or serial execution.
- Keep planning CSVs and batch worker CSVs separate.
- Build for Codex-only recovery: a cold restart must be resumable from files alone.
Shape Router
| Shape |
Use when |
Truth artifacts |
Example |
| Single Task |
One deliverable with shared context |
TODO.csv or SPEC.md + TODO.csv + PROGRESS.md |
Fix one OAuth redirect bug |
| Epic Task |
Multiple deliverables, modules, or dependency chains |
EPIC.md + SUBTASKS.csv + PROGRESS.md |
Ship billing dashboard across API, UI, docs |
| Batch Task |
Same instruction template across independent rows |
TODO.csv + batch/BATCH.md + workers-input.csv + workers-output.csv |
Audit 80 Markdown files for frontmatter |
Router Rules
- Start with Single Task when the user wants one deliverable and progress can stay in one shared context.
- Promote to Epic Task when one
TODO.csv starts carrying phases, subprojects, or independent deliverables.
- Use Batch Task only when rows are independent, share one instruction template, and success can be expressed in structured output fields.
- An Epic Task can contain
single-compact, single-full, or batch child tasks.
- A Batch Task must not be used for heterogeneous roles, cross-row dependencies, or shared write scopes.
Single Task
Single Task preserves backward compatibility with the old LITE/FULL behavior by
supporting two execution profiles.
Compact Single
Use Compact Single when the task is short, linear, and does not need recovery
logs or cached research artifacts.
- Files: project-root
TODO.csv only
- Template: compact_todo_template.csv
- Status set:
TODO | IN_PROGRESS | DONE
- Best for: short documentation edits, tiny cleanup passes, quick rename tasks
Compact Single example:
id,task,status,completed_at,notes
1,Locate root cause,IN_PROGRESS,,
2,Implement fix,TODO,,
3,Run verification,TODO,,
Full Single
Use Full Single for all code changes, long-running tasks, or any work that must
survive a context reset. This is the default single-task path.
- Files:
.codex-tasks/<task-name>/SPEC.md, TODO.csv, PROGRESS.md, raw/
- Templates:
- SPEC_TEMPLATE.md
- PROGRESS_TEMPLATE.md
- todo_template.csv
- perf_todo_template.csv
- Status set:
TODO | IN_PROGRESS | DONE | FAILED
- Best for: code implementation, bug fixes, refactors, multi-hour work
Full Single directory example:
.codex-tasks/20260313-auth-fix/
├── SPEC.md
├── TODO.csv
├── PROGRESS.md
└── raw/
Single Task Rules
- Re-read the active
TODO.csv before every new step.
- Keep
TODO.csv leaf-level only. Do not store phases, child projects, or batch rows there.
- Use
echo SKIP only when validation cannot be automated, and record why.
- If retries hit 5, change strategy explicitly or promote the task shape.
Epic Task
Epic Task is the parent coordination shape for large work that spans multiple
deliverables or dependency chains.
- Files:
.codex-tasks/<epic-name>/EPIC.md
.codex-tasks/<epic-name>/SUBTASKS.csv
.codex-tasks/<epic-name>/PROGRESS.md
.codex-tasks/<epic-name>/tasks/<child-task>/...
- Templates:
- EPIC_TEMPLATE.md
- subtasks_template.csv
- Status set:
TODO | IN_PROGRESS | DONE | FAILED
- Best for: multi-module features, staged refactors, long projects with clear child deliverables
Epic directory example:
.codex-tasks/20260313-billing-epic/
├── EPIC.md
├── SUBTASKS.csv
├── PROGRESS.md
└── tasks/
├── 20260313-api/
├── 20260313-frontend/
└── 20260313-docs/
Epic workflow:
- Define the global goal and delivery boundary in
EPIC.md.
- Register child tasks in
SUBTASKS.csv with task_type, dependencies, and task_dir.
depends_on: use ; to list multiple dependency IDs (e.g., 1;2). Empty means no dependency.
- Execute each child task with its own Single or Batch protocol.
- Bubble child validation back to
SUBTASKS.csv and parent PROGRESS.md.
- Close the Epic only when all child rows are
DONE and the final validation passes.
Use Epic instead of a single TODO.csv when one task file starts reading like
project management instead of execution.
Batch Task
Batch Task is for homogeneous row-level work that should be executed through
spawn_agents_on_csv. It can be a standalone task or a child inside an Epic.
- Files:
.codex-tasks/<task-name>/SPEC.md
.codex-tasks/<task-name>/TODO.csv for 3-5 high-level steps
.codex-tasks/<task-name>/PROGRESS.md
.codex-tasks/<task-name>/batch/BATCH.md
.codex-tasks/<task-name>/batch/workers-input.csv
.codex-tasks/<task-name>/batch/workers-output.csv
.codex-tasks/<task-name>/raw/
- Templates:
- BATCH_TEMPLATE.md
- workers_input_template.csv
- workers_output_template.csv
- Best for: bulk file audits, bulk metadata updates, structured per-row analysis
Batch directory example:
.codex-tasks/20260313-doc-audit/
├── SPEC.md
├── TODO.csv
├── PROGRESS.md
├── batch/
│ ├── BATCH.md
│ ├── workers-input.csv
│ └── workers-output.csv
└── raw/
Batch Eligibility Checklist
Only use Batch Task when all of the following are true:
- One instruction template can describe every row.
- Rows are independent and can be retried independently.
- Output can be expressed as structured fields in
output_schema.
- Writes are disjoint, or the batch is read-only.
Batch Lifecycle
- Identify a parent
TODO.csv step that is truly row-level and homogeneous.
- Create
batch/BATCH.md and define:
- instruction template
id_column
output_schema
max_workers
max_runtime_seconds
output_csv_path
- Build
workers-input.csv from real artifacts, not from plan steps.
- Run
spawn_agents_on_csv with explicit id_column, output_schema, max_workers, max_runtime_seconds, and output_csv_path.
- Inspect
workers-output.csv. Failed rows remain visible and may be retried with a filtered input CSV.
- Merge the aggregate result into parent
PROGRESS.md and only then mark the parent step DONE.
Example Batch step sequence:
id,task,status,acceptance_criteria,validation_command,completed_at,retry_count,notes
1,Build workers-input.csv,IN_PROGRESS,batch/workers-input.csv exists,test -f batch/workers-input.csv,,0,
2,Run spawn_agents_on_csv,TODO,batch/workers-output.csv exists,test -f batch/workers-output.csv,,0,
3,Merge row results,TODO,Failed rows are handled and summary is written,test -f PROGRESS.md,,0,
Mixed Shapes
- A Single Task can promote to Epic when one execution stream stops being coherent.
- A Single or Epic child step can delegate homogeneous work to Batch.
- Use the current layer's truth file only:
TODO.csv for step planning
SUBTASKS.csv for child-task state
workers-output.csv for row results
Mid-Task Shape Promotion
When complexity outgrows the current shape, promote in-place:
Single → Epic
- Create
.codex-tasks/<task-name>/EPIC.md from the existing SPEC.md goal.
- Convert remaining
TODO.csv rows into child task entries in SUBTASKS.csv.
- Move the original
SPEC.md, TODO.csv, PROGRESS.md into tasks/<original-task>/ as the first child.
- Create new child directories for the additional deliverables.
- Log the promotion reason in the parent
PROGRESS.md.
Single/Epic Step → Batch
- Identify the
TODO.csv or SUBTASKS.csv row that is actually N homogeneous items.
- Replace it with a 3-step Batch sequence: build input → run workers → merge results.
- Create
batch/ directory with BATCH.md and workers-input.csv.
- The parent step stays
IN_PROGRESS until the batch merge completes.
- Log the delegation in
PROGRESS.md.
Validation Rules
- Re-read the active truth file before every new step.
- No parent task can claim success while a child subtask or batch row still fails its merge criteria.
- Keep retry counts explicit.
- Keep raw fetched material under
raw/ for Full, Epic, and Batch shapes.
- If the work is heterogeneous, use a dedicated multi-agent flow instead of forcing it into Batch.
Context Recovery Protocol
Use the smallest artifact set that fully restores state:
- Compact Single: read
TODO.csv, resume from the first non-DONE row.
- Full Single: read
SPEC.md, TODO.csv, then the PROGRESS.md recovery block.
- Epic Task: read
EPIC.md, SUBTASKS.csv, parent PROGRESS.md, then the current child task directory.
- Batch Task: read
SPEC.md, TODO.csv, batch/BATCH.md, batch/workers-output.csv, then the PROGRESS.md recovery block.
Every recovery message must include:
任务: goal
形态: single-compact | single-full | epic | batch
进度: X/Y
当前: current step, child task, or failed row set
文件: active truth artifact path
下一步: exact next action
Output Contract
Every status update must include:
任务: one-line goal
形态: current task shape
进度: X/Y steps or rows complete
当前: active step, child task, or batch stage
验证: latest validation command and result
文件: active task directory or truth artifact
References
- SPEC_TEMPLATE.md
- PROGRESS_TEMPLATE.md
- todo_template.csv
- perf_todo_template.csv
- compact_todo_template.csv
- EPIC_TEMPLATE.md
- BATCH_TEMPLATE.md
- subtasks_template.csv
- workers_input_template.csv
- workers_output_template.csv
- EXAMPLES.md
1---2name: taskmaster3description: Unified task execution protocol for Codex-only work. Supports Single Task, Epic Task, and Batch Task while preserving CSV truth-source, validation gates, context recovery, and Debug-First failure exposure. WHEN TO USE: user asks to "track tasks", "create todo list", "make a plan", "track progress", "long task", "big project", "build from scratch", "autonomous session", "跟踪任务", "自主执行", "长时任务", "从零开始", "任务管理", "做个计划", "大工程", or when a task clearly requires 3+ ordered steps that produce file changes. DO NOT USE: single-step fixes, pure Q&A, code review, explaining code, search/research tasks, tasks with fewer than 3 steps, or tasks that do not produce file changes.4---56# Taskmaster — v5 Task Protocol78## Purpose910Taskmaster is the default execution protocol for multi-step Codex work. v511keeps the existing Debug-First core while expanding the skill into three task12shapes:1314- **Single Task** — one deliverable, one shared context15- **Epic Task** — multiple child tasks with dependencies16- **Batch Task** — homogeneous row-level work executed through `spawn_agents_on_csv`1718## Core Principles19201. The current truth artifact on disk wins over memory.212. No step, subtask, or batch row becomes `DONE` without explicit validation.223. Keep verbose reasoning in `PROGRESS.md`, `EPIC.md`, or batch output files, not in the chat.234. Keep failures visible. Do not silently downgrade to manual or serial execution.245. Keep planning CSVs and batch worker CSVs separate.256. Build for Codex-only recovery: a cold restart must be resumable from files alone.2627## Shape Router2829| Shape | Use when | Truth artifacts | Example |30|---|---|---|---|31| **Single Task** | One deliverable with shared context | `TODO.csv` or `SPEC.md + TODO.csv + PROGRESS.md` | Fix one OAuth redirect bug |32| **Epic Task** | Multiple deliverables, modules, or dependency chains | `EPIC.md + SUBTASKS.csv + PROGRESS.md` | Ship billing dashboard across API, UI, docs |33| **Batch Task** | Same instruction template across independent rows | `TODO.csv + batch/BATCH.md + workers-input.csv + workers-output.csv` | Audit 80 Markdown files for frontmatter |3435### Router Rules3637- Start with **Single Task** when the user wants one deliverable and progress can stay in one shared context.38- Promote to **Epic Task** when one `TODO.csv` starts carrying phases, subprojects, or independent deliverables.39- Use **Batch Task** only when rows are independent, share one instruction template, and success can be expressed in structured output fields.40- An **Epic Task** can contain `single-compact`, `single-full`, or `batch` child tasks.41- A **Batch Task** must not be used for heterogeneous roles, cross-row dependencies, or shared write scopes.4243## Single Task4445Single Task preserves backward compatibility with the old LITE/FULL behavior by46supporting two execution profiles.4748### Compact Single4950Use Compact Single when the task is short, linear, and does not need recovery51logs or cached research artifacts.5253- **Files**: project-root `TODO.csv` only54- **Template**: [compact_todo_template.csv](assets/compact_todo_template.csv)55- **Status set**: `TODO | IN_PROGRESS | DONE`56- **Best for**: short documentation edits, tiny cleanup passes, quick rename tasks5758Compact Single example:5960```csv61id,task,status,completed_at,notes621,Locate root cause,IN_PROGRESS,,632,Implement fix,TODO,,643,Run verification,TODO,,65```6667### Full Single6869Use Full Single for all code changes, long-running tasks, or any work that must70survive a context reset. This is the default single-task path.7172- **Files**: `.codex-tasks/<task-name>/SPEC.md`, `TODO.csv`, `PROGRESS.md`, `raw/`73- **Templates**:74 - [SPEC_TEMPLATE.md](assets/SPEC_TEMPLATE.md)75 - [PROGRESS_TEMPLATE.md](assets/PROGRESS_TEMPLATE.md)76 - [todo_template.csv](assets/todo_template.csv)77 - [perf_todo_template.csv](assets/perf_todo_template.csv)78- **Status set**: `TODO | IN_PROGRESS | DONE | FAILED`79- **Best for**: code implementation, bug fixes, refactors, multi-hour work8081Full Single directory example:8283```text84.codex-tasks/20260313-auth-fix/85├── SPEC.md86├── TODO.csv87├── PROGRESS.md88└── raw/89```9091### Single Task Rules9293- Re-read the active `TODO.csv` before every new step.94- Keep `TODO.csv` leaf-level only. Do not store phases, child projects, or batch rows there.95- Use `echo SKIP` only when validation cannot be automated, and record why.96- If retries hit 5, change strategy explicitly or promote the task shape.9798## Epic Task99100Epic Task is the parent coordination shape for large work that spans multiple101deliverables or dependency chains.102103- **Files**:104 - `.codex-tasks/<epic-name>/EPIC.md`105 - `.codex-tasks/<epic-name>/SUBTASKS.csv`106 - `.codex-tasks/<epic-name>/PROGRESS.md`107 - `.codex-tasks/<epic-name>/tasks/<child-task>/...`108- **Templates**:109 - [EPIC_TEMPLATE.md](assets/EPIC_TEMPLATE.md)110 - [subtasks_template.csv](assets/subtasks_template.csv)111- **Status set**: `TODO | IN_PROGRESS | DONE | FAILED`112- **Best for**: multi-module features, staged refactors, long projects with clear child deliverables113114Epic directory example:115116```text117.codex-tasks/20260313-billing-epic/118├── EPIC.md119├── SUBTASKS.csv120├── PROGRESS.md121└── tasks/122 ├── 20260313-api/123 ├── 20260313-frontend/124 └── 20260313-docs/125```126127Epic workflow:1281291. Define the global goal and delivery boundary in `EPIC.md`.1302. Register child tasks in `SUBTASKS.csv` with `task_type`, dependencies, and `task_dir`.131 - `depends_on`: use `;` to list multiple dependency IDs (e.g., `1;2`). Empty means no dependency.1323. Execute each child task with its own Single or Batch protocol.1334. Bubble child validation back to `SUBTASKS.csv` and parent `PROGRESS.md`.1345. Close the Epic only when all child rows are `DONE` and the final validation passes.135136Use Epic instead of a single `TODO.csv` when one task file starts reading like137project management instead of execution.138139## Batch Task140141Batch Task is for homogeneous row-level work that should be executed through142`spawn_agents_on_csv`. It can be a standalone task or a child inside an Epic.143144- **Files**:145 - `.codex-tasks/<task-name>/SPEC.md`146 - `.codex-tasks/<task-name>/TODO.csv` for 3-5 high-level steps147 - `.codex-tasks/<task-name>/PROGRESS.md`148 - `.codex-tasks/<task-name>/batch/BATCH.md`149 - `.codex-tasks/<task-name>/batch/workers-input.csv`150 - `.codex-tasks/<task-name>/batch/workers-output.csv`151 - `.codex-tasks/<task-name>/raw/`152- **Templates**:153 - [BATCH_TEMPLATE.md](assets/BATCH_TEMPLATE.md)154 - [workers_input_template.csv](assets/workers_input_template.csv)155 - [workers_output_template.csv](assets/workers_output_template.csv)156- **Best for**: bulk file audits, bulk metadata updates, structured per-row analysis157158Batch directory example:159160```text161.codex-tasks/20260313-doc-audit/162├── SPEC.md163├── TODO.csv164├── PROGRESS.md165├── batch/166│ ├── BATCH.md167│ ├── workers-input.csv168│ └── workers-output.csv169└── raw/170```171172### Batch Eligibility Checklist173174Only use Batch Task when all of the following are true:175176- One instruction template can describe every row.177- Rows are independent and can be retried independently.178- Output can be expressed as structured fields in `output_schema`.179- Writes are disjoint, or the batch is read-only.180181### Batch Lifecycle1821831. Identify a parent `TODO.csv` step that is truly row-level and homogeneous.1842. Create `batch/BATCH.md` and define:185 - instruction template186 - `id_column`187 - `output_schema`188 - `max_workers`189 - `max_runtime_seconds`190 - `output_csv_path`1913. Build `workers-input.csv` from real artifacts, not from plan steps.1924. Run `spawn_agents_on_csv` with explicit `id_column`, `output_schema`, `max_workers`, `max_runtime_seconds`, and `output_csv_path`.1935. Inspect `workers-output.csv`. Failed rows remain visible and may be retried with a filtered input CSV.1946. Merge the aggregate result into parent `PROGRESS.md` and only then mark the parent step `DONE`.195196Example Batch step sequence:197198```csv199id,task,status,acceptance_criteria,validation_command,completed_at,retry_count,notes2001,Build workers-input.csv,IN_PROGRESS,batch/workers-input.csv exists,test -f batch/workers-input.csv,,0,2012,Run spawn_agents_on_csv,TODO,batch/workers-output.csv exists,test -f batch/workers-output.csv,,0,2023,Merge row results,TODO,Failed rows are handled and summary is written,test -f PROGRESS.md,,0,203```204205## Mixed Shapes206207- A Single Task can promote to Epic when one execution stream stops being coherent.208- A Single or Epic child step can delegate homogeneous work to Batch.209- Use the **current layer's truth file** only:210 - `TODO.csv` for step planning211 - `SUBTASKS.csv` for child-task state212 - `workers-output.csv` for row results213214### Mid-Task Shape Promotion215216When complexity outgrows the current shape, promote in-place:217218#### Single → Epic2192201. Create `.codex-tasks/<task-name>/EPIC.md` from the existing `SPEC.md` goal.2212. Convert remaining `TODO.csv` rows into child task entries in `SUBTASKS.csv`.2223. Move the original `SPEC.md`, `TODO.csv`, `PROGRESS.md` into `tasks/<original-task>/` as the first child.2234. Create new child directories for the additional deliverables.2245. Log the promotion reason in the parent `PROGRESS.md`.225226#### Single/Epic Step → Batch2272281. Identify the `TODO.csv` or `SUBTASKS.csv` row that is actually N homogeneous items.2292. Replace it with a 3-step Batch sequence: build input → run workers → merge results.2303. Create `batch/` directory with `BATCH.md` and `workers-input.csv`.2314. The parent step stays `IN_PROGRESS` until the batch merge completes.2325. Log the delegation in `PROGRESS.md`.233234## Validation Rules235236- Re-read the active truth file before every new step.237- No parent task can claim success while a child subtask or batch row still fails its merge criteria.238- Keep retry counts explicit.239- Keep raw fetched material under `raw/` for Full, Epic, and Batch shapes.240- If the work is heterogeneous, use a dedicated multi-agent flow instead of forcing it into Batch.241242## Context Recovery Protocol243244Use the smallest artifact set that fully restores state:245246- **Compact Single**: read `TODO.csv`, resume from the first non-`DONE` row.247- **Full Single**: read `SPEC.md`, `TODO.csv`, then the `PROGRESS.md` recovery block.248- **Epic Task**: read `EPIC.md`, `SUBTASKS.csv`, parent `PROGRESS.md`, then the current child task directory.249- **Batch Task**: read `SPEC.md`, `TODO.csv`, `batch/BATCH.md`, `batch/workers-output.csv`, then the `PROGRESS.md` recovery block.250251Every recovery message must include:2522531. `任务:` goal2542. `形态:` `single-compact | single-full | epic | batch`2553. `进度:` X/Y2564. `当前:` current step, child task, or failed row set2575. `文件:` active truth artifact path2586. `下一步:` exact next action259260## Output Contract261262Every status update must include:2632641. `任务:` one-line goal2652. `形态:` current task shape2663. `进度:` X/Y steps or rows complete2674. `当前:` active step, child task, or batch stage2685. `验证:` latest validation command and result2696. `文件:` active task directory or truth artifact270271## References272273- [SPEC_TEMPLATE.md](assets/SPEC_TEMPLATE.md)274- [PROGRESS_TEMPLATE.md](assets/PROGRESS_TEMPLATE.md)275- [todo_template.csv](assets/todo_template.csv)276- [perf_todo_template.csv](assets/perf_todo_template.csv)277- [compact_todo_template.csv](assets/compact_todo_template.csv)278- [EPIC_TEMPLATE.md](assets/EPIC_TEMPLATE.md)279- [BATCH_TEMPLATE.md](assets/BATCH_TEMPLATE.md)280- [subtasks_template.csv](assets/subtasks_template.csv)281- [workers_input_template.csv](assets/workers_input_template.csv)282- [workers_output_template.csv](assets/workers_output_template.csv)283- [EXAMPLES.md](assets/EXAMPLES.md)