搜索

PythonReactSEOPDF
GitHub Skill

file-op

Execute FileOpsREQ protocol requests. Handles autoflow domain ops for .ccb/ state management.

bfly123☆ 1,485 仓库 Stars137 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

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

  1. Parse the incoming FileOpsREQ JSON
  2. Validate against schema (proto, id, purpose, ops, done, report)
  3. Execute each op in order
  4. Return FileOpsRES JSON only

AutoFlow Domain Ops Implementation

All state files live under .ccb/ directory relative to repo root.

autoflow_plan_init

Input: plan object with taskName, objective, context, constraints, steps[], finalDone[]

Actions:

  1. Create .ccb/ directory if not exists
  2. 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
    }
    
  3. Write .ccb/state.json
  4. Generate .ccb/todo.md from state (see formats.md)
  5. Generate .ccb/plan_log.md with initial plan entry
autoflow_state_preflight

Input: path (default .ccb/state.json), maxAttempts (default 2)

Actions:

  1. Read .ccb/state.json
  2. If file missing → return fail status with "No plan. Use /tp first."
  3. Validate current pointer
  4. If current.type == "none" → return ok with taskComplete flag
  5. Get current step/substep, check attempts < maxAttempts
  6. If attempts exceeded → return fail with "Max attempts exceeded"
  7. Increment attempts, write back .ccb/state.json
  8. 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:

  1. Read .ccb/state.json
  2. Find step by stepIndex
  3. Set step.substeps = substeps mapped to { index: i+1, title: t, status: "todo" }, first one "doing"
  4. Set current = { type: "substep", stepIndex: stepIndex, subIndex: 1 }
  5. Write .ccb/state.json
  6. Regenerate .ccb/todo.md
autoflow_state_finalize

Input: verification (string), changedFiles (optional array)

Actions:

  1. Read .ccb/state.json
  2. Mark current step/substep status = "done"
  3. 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 }
  4. If next item exists, set its status to "doing"
  5. Write .ccb/state.json
  6. Regenerate .ccb/todo.md
  7. Append completion entry to .ccb/plan_log.md
autoflow_state_mark_blocked

Input: reason (string)

Actions:

  1. Read .ccb/state.json
  2. Mark current step/substep status = "blocked"
  3. Write .ccb/state.json
  4. Regenerate .ccb/todo.md
autoflow_state_append_steps

Input: steps (array of 1-2 title strings), maxAllowed (default 2)

Precondition: current.type == "none" (task completed)

Actions:

  1. Read .ccb/state.json
  2. If steps.length > maxAllowed → return fail
  3. Append new steps to steps array
  4. Set current to first new step, mark it "doing"
  5. Write .ccb/state.json
  6. Regenerate .ccb/todo.md
  7. Append to .ccb/plan_log.md

Output Format

Always return pure JSON matching FileOpsRES schema. Never wrap in markdown code blocks.

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-03-11
索引更新时间
2026-03-11
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!