| name | cxb-file-op |
| description | Execute FileOpsREQ protocol requests. Handles autoflow domain ops for .curdx/ state management. |
FileOps Executor (Codex Side)
You receive FileOpsREQ JSON from Claude and must return FileOpsRES JSON only. No markdown, no prose.
Protocol Reference
See ~/.claude/skills/docs/protocol.md for full FileOpsREQ/FileOpsRES schema.
Execution Rules
- Parse the incoming FileOpsREQ JSON
- Validate against schema (proto, id, purpose, ops, done, report)
- Execute each op in order
- Return FileOpsRES JSON only
AutoFlow Domain Ops Implementation
All state files live under .curdx/ directory relative to repo root.
autoflow_plan_init
Input: plan object with taskName, objective, context, constraints, steps[], finalDone[]
Actions:
- Create
.curdx/ directory if not exists
- Build
state.json from plan:
{
"taskName": plan.taskName,
"objective": plan.objective,
"context": plan.context,
"constraints": plan.constraints,
"current": { "type": "step", "stepIndex": 1, "subIndex": null },
"steps": [ { "index": i+1, "title": title, "status": "todo" (first="doing"), "attempts": 0, "substeps": [] } ],
"finalDone": plan.finalDone
}
- Write
.curdx/state.json
- Generate
.curdx/todo.md from state (see formats.md)
- Generate
.curdx/plan_log.md with initial plan entry
autoflow_state_preflight
Input: path (default .curdx/state.json), maxAttempts (default 2)
Actions:
- Read
.curdx/state.json
- If file missing → return fail status with "No plan. Use /cxb-task-plan first."
- Validate
current pointer
- If
current.type == "none" → return ok with taskComplete flag
- Get current step/substep, check attempts < maxAttempts
- If attempts exceeded → return fail with "Max attempts exceeded"
- Increment attempts, write back
.curdx/state.json
- Return ok with
data.state (current pointer) and data.stepContext (step title, objective, relevant info)
autoflow_state_apply_split
Input: stepIndex, substeps (array of 3-7 title strings)
Actions:
- Read
.curdx/state.json
- Find step by stepIndex
- Set step.substeps = substeps mapped to
{ index: i+1, title: t, status: "todo" }, first one "doing"
- Set
current = { type: "substep", stepIndex: stepIndex, subIndex: 1 }
- Write
.curdx/state.json
- Regenerate
.curdx/todo.md
autoflow_state_finalize
Input: verification (string), changedFiles (optional array)
Actions:
- Read
.curdx/state.json
- Mark current step/substep status = "done"
- Advance
current to next todo step/substep:
- If substeps remain in current step → next substep
- If no substeps remain → next step
- If no steps remain → set
current = { type: "none", stepIndex: null, subIndex: null }
- If next item exists, set its status to "doing"
- Write
.curdx/state.json
- Regenerate
.curdx/todo.md
- Append completion entry to
.curdx/plan_log.md
autoflow_state_mark_blocked
Input: reason (string)
Actions:
- Read
.curdx/state.json
- Mark current step/substep status = "blocked"
- Write
.curdx/state.json
- Regenerate
.curdx/todo.md
autoflow_state_append_steps
Input: steps (array of 1-2 title strings), maxAllowed (default 2)
Precondition: current.type == "none" (task completed)
Actions:
- Read
.curdx/state.json
- If steps.length > maxAllowed → return fail
- Append new steps to steps array
- Set
current to first new step, mark it "doing"
- Write
.curdx/state.json
- Regenerate
.curdx/todo.md
- Append to
.curdx/plan_log.md
Output Format
Always return pure JSON matching FileOpsRES schema. Never wrap in markdown code blocks.