| name | source-command-do-task |
| description | Converted Codex workflow from Claude slash command `do-task`. Use when the user asks to run the equivalent command or describes this workflow. |
Command Workflow: do-task
Treat Claude-only tool names as conceptual workflow steps and use available Codex tools/policies.
Codex Policy Gates
- Ask before external actions such as GitHub repository creation,
git push, deploys, or sending messages unless the user explicitly requested that exact action.
- Deployments must go through GitHub CI/CD; direct server access is only for emergency debugging of broken production.
- Never ask the user to paste secrets in chat. Direct them to
.env files or GitHub Actions secrets.
Do Task
Project Documentation Autosync
If this command changes any project-local .claude/** file, immediately run:
~/.claude/scripts/sync-to-codex.sh --project "$PWD" --apply
If sync reports a conflict, stop and report it. Include generated .codex/** changes in the same commit as the .claude/** source change.
Execute a spec-driven task with validation and status tracking.
Step 1: Read Task
- Read task file (user provides path or task number)
- If user didn't specify → ask: "Which task to execute?"
- Derive feature directory from task path:
work/{feature}/tasks/N.md → work/{feature}/
All logs/ paths in the task (Reviewers section, What to do, Acceptance Criteria) are relative to this feature directory. Resolve them as {feature_dir}/logs/... when creating files.
- Verify task status is
planned (if not → ask user before proceeding)
- Update task frontmatter:
status: planned → status: in_progress
- Read every file listed in the task's "Context Files" section
Step 2: Execute
- Load each skill listed in the task (frontmatter
skills: [...] and "Required Skills" section)
- If a skill is not found → warn user, continue with remaining skills
- If task has no skill (frontmatter
skills: [] or absent) → read the task, execute "What to do" and "Verification Steps" directly. For tasks with user instructions → show the instruction to user, wait for confirmation.
- Follow loaded skill workflow
- Git commit implementation (code + tests pass):
feat|fix|refactor: task {N} — {brief description}
- For each reviewer from the task's "Reviewers" section (if present):
- Spawn subagent via spawn_agent (subagent_type = reviewer name, e.g.
code-reviewer)
- Pass: git diff of changes, path to task file, path to tech-spec, path to user-spec
- Reviewer loads its own skill automatically (via agent frontmatter
skills:)
- Report is written to the path specified in the task's "Reviewers" section, resolved relative to the feature directory (e.g.,
logs/working/task-1/... → {feature_dir}/logs/working/task-1/...)
- Read report. If findings exist → fix, re-run tests, git commit:
fix: address review round {N} for task {N}, repeat (max 3 rounds)
Step 3: Verify
- Check each acceptance criterion from task file
- If task has "Verification Steps → Smoke" → execute each smoke command, record results in decisions.md Verification section
- If task has "Verification Steps → User" → ask user to verify, wait for confirmation
- If any verification fails → fix → re-run tests → re-run reviewers (new round) → re-verify
- After 3 failed rounds → stop, report failures to user, keep status
in_progress
- Tool unavailable → document, suggest manual check
Step 4: Complete
- Read template
~/.claude/shared/work-templates/decisions.md.template and write a concise execution report to work/{feature}/decisions.md. Follow template format strictly — no extra sections.
- Update task frontmatter:
status: in_progress → status: done
- Update tech-spec:
- [ ] Task N → - [x] Task N
- Git commit:
chore: complete task {N} — update status and decisions
Self-Verification