cxb-file-op
Execute FileOpsREQ protocol requests. Handles autoflow domain ops for .curdx/ state management.
- License 许可
- MIT
- 最近更新
- 2026-05-06
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- cxb-file-op
- description
- Execute FileOpsREQ protocol requests. Handles autoflow domain ops for .curdx/ state management.
03 SKILL.md 正文
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.jsonfrom 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.mdfrom state (see formats.md) - Generate
.curdx/plan_log.mdwith 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
currentpointer - 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) anddata.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
currentto 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
currentto 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.
04 同仓库更多 Skills
cxb-status
Report which CURDX providers are mounted (session exists AND daemon is online). Outputs JSON.
cxb-reply
View latest reply from AI provider (gemini/codex/opencode/claude).
cxb-plan
Collaborative planning using abstract roles (designer + inspiration + reviewer).
cxb-ping
Test connectivity with AI provider (gemini/codex/opencode/claude).
cxb-ask
Send the user's request to specified AI provider asynchronously
cxb-task-run
Execute current step in AutoFlow workflow. Use when running /cxb-task-run or continuing task execution.