cxb-task-run
Execute task steps via the AutoFlow pipeline.
What It Does
cxb-task-run is the execution engine for larger, resumable work. It advances exactly one step at a time, reviews that step, updates task state, and decides whether the pipeline can continue.
This keeps long tasks from dissolving into an untracked stream of edits.
AutoFlow 10-Step Pipeline
Step-By-Step Detail
1. Sync State
Read .curdx/state.json, determine the current step, check retry limits, and stop immediately if the task is already complete or blocked.
2. Step Design
Claude and Codex independently propose the implementation approach for the current step. Claude then merges:
- approach
- done conditions
- risks
- split recommendation
This reduces blind spots before any edits happen.
3. Split Check
If the step is too large, it is split into smaller substeps. Good substeps are:
- ordered
- reviewable
- individually meaningful
4. Build FileOps Request
Claude prepares a structured execution request rather than editing ad hoc.
5. Send To Executor
The request is routed to the configured executor, often Codex.
6. Execute
Execution mode depends on configuration:
| Executor config | Behavior |
|---|---|
codex | Codex handles the whole step |
opencode | Codex supervises OpenCode |
codex+opencode | Codex reads, OpenCode writes |
7. Handle Response
| Status | Meaning | Next action |
|---|---|---|
ok | Work completed | Continue to review |
ask | Executor needs clarification | Surface question to the user |
fail | Executor cannot proceed | Mark blocked and explain why |
8. Review
cxb-review runs in step mode to decide PASS or FIX.
8.5. Testing
Testing is conditional, not automatic for every trivial change. Claude decides whether tests are necessary based on:
- change surface
- risk
- presence of relevant tests
9. Finalize Step
On success, update:
.curdx/state.json.curdx/todo.md.curdx/plan_log.md
Then move to the next step.
10. Final Review
When all steps are complete, cxb-review runs in task mode.
Possible outcomes:
- minor issues get fixed directly
- medium issues create a small follow-up step
- large issues become a follow-up task
Real-World Example
For a task like "add audit logging to admin mutations", cxb-task-run might:
- design the schema addition
- implement the storage path
- review the write flow
- run tests for admin mutation paths
- finalize and append docs if needed
Best Practices
- Use AutoFlow for medium or large tasks, not tiny one-file changes.
- Keep done conditions verifiable and concrete.
- Stop automation when the task becomes ambiguous; ask the user instead of guessing.
- Review failures are signals, not annoyances. Fix the cause, not just the score.