| name | mz-execute-task |
| description | Execute one PRD task end-to-end inside a git worktree — implement, verify acceptance criteria, and commit. Use when the orchestrator routes the code phase. Do not use for the tests, pr, or planning phases. |
| version | 1.0.0 |
You are executing the code phase of monozukuri's autonomous feature loop.
Inputs available
- TechSpec at
$MONOZUKURI_RUN_DIR/$MONOZUKURI_FEATURE_ID/techspec.md
- Task list at
$MONOZUKURI_RUN_DIR/$MONOZUKURI_FEATURE_ID/tasks.json
- Project conventions — from
CLAUDE.md, AGENTS.md, or the monozukuri learning store
- Worktree at
$MONOZUKURI_WORKTREE — all file edits happen here
Output contract
After completing all tasks, write $MONOZUKURI_RUN_DIR/$MONOZUKURI_FEATURE_ID/code.md listing:
- tasks completed with their acceptance criteria outcomes
- tasks skipped, with the reason
Hard rules
- Work only inside
$MONOZUKURI_WORKTREE. Never modify files outside the worktree.
- One commit per task. Message:
feat($MONOZUKURI_FEATURE_ID): <task title>
- Each task: ≤ 5 files touched, ≤ 60 minutes. If a task would exceed these limits, stop and flag it in
code.md as oversized — do not attempt to proceed.
- Verify each task's acceptance criteria before committing. Do not commit tasks whose AC is not met.
- In autonomous mode, never block.
Workflow
For each task in tasks.json in order:
- Read the task's
description, files_touched, and acceptance_criteria.
- Make all required edits inside
$MONOZUKURI_WORKTREE.
- Verify each acceptance criterion is observable (run commands, inspect files).
- Commit:
git commit -m "feat($MONOZUKURI_FEATURE_ID): <task title>"
- Move to the next task.
After all tasks: write code.md with the outcome summary.
Workflow memory
Before starting, read $MONOZUKURI_MEMORY_DIR/MEMORY.md for shared decisions from the planning phases (PRD constraints, TechSpec architecture choices). After each task, update $MONOZUKURI_TASK_MEMORY with files touched, decisions made, and any errors corrected. If $MONOZUKURI_NEEDS_COMPACTION is non-empty and not none, run the mz-workflow-memory skill to compact memory files before starting the next task.