Skip to content

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 ​

1. Sync StateRead `.curdx/state.json`2. Design StepClaude + Codex draft3. Split CheckBreak oversized work4. Build RequestPrepare FileOpsREQ5. Send RequestDispatch to executor6. ExecuteCode, files, tests7. Handle Reply`ok`, `ask`, or `fail`8. ReviewDual assessment8.5 TestRun when needed9-10 FinalizeAdvance and final review

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 configBehavior
codexCodex handles the whole step
opencodeCodex supervises OpenCode
codex+opencodeCodex reads, OpenCode writes

7. Handle Response ​

StatusMeaningNext action
okWork completedContinue to review
askExecutor needs clarificationSurface question to the user
failExecutor cannot proceedMark 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:

  1. design the schema addition
  2. implement the storage path
  3. review the write flow
  4. run tests for admin mutation paths
  5. 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.