ccwf-cli
它能做什么
这项技能教智能体如何在终端中处理工作流 JSON 文件。它可以检查文件中的错误,生成 Markdown 或 Mermaid 视图,打开预览,进行格式转换,或运行工作流。
适用场景
- ✓当用户想检查工作流文件是否存在结构定义错误时。
- ✓当用户想在终端中把工作流显示为图表或 Markdown 时。
- ✓当用户想运行或转换工作流文件夹中的工作流文件时。
技能链接
https://github.com/breaking-brake/cc-wf-studio/blob/main/packages/cli/skills/ccwf-cli/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我检查工作流文件是否有结构错误,并把它画成图表给我看。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会先确认 ccwf 命令可用,然后根据请求选择合适的子命令,例如 validate、render 或 preview。当参数不清楚时,它会读取命令的帮助输出。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
ccwf CLI
ccwf is the command-line entry into cc-wf-studio — a visual AI-agent workflow tool. It treats .vscode/workflows/*.json workflow files as inputs and lets you render them as Markdown, validate the schema, open them in a browser-based viewer, convert them into Agent Skills, or execute them. The same workflow JSON also drives the VSCode extension and an MCP server, so you can pick whichever interface fits the situation.
This Skill teaches Claude how to recognise when ccwf is the right answer and which subcommand to reach for. The subcommands and flags listed here are the source of truth — if behaviour seems off, check ccwf <subcommand> --help first.
Prerequisites
Confirm ccwf is available before running any other subcommand:
ccwf --version
If ccwf is not on PATH:
- Preferred: install globally —
npm install -g @cc-wf-studio/cli - Without install: prefix every command with
npx @cc-wf-studio/cli(e.g.npx @cc-wf-studio/cli render <file>) - In a project:
pnpm add -D @cc-wf-studio/cliand run viapnpm exec ccwf
If the user has a VSCode workspace and you can't find a workflow file, search .vscode/workflows/*.json first; that's the canonical location.
Core workflow
The natural flow when the user has a workflow file in hand:
ccwf validate <file>— schema-check it. Exit 0 = clean, exit 1 = errors. Run this first whenever you receive a workflow from elsewhere.ccwf preview <file>— opens a read-only viewer (Mermaid + per-node Markdown) in the browser. Use this when the user says "show me" / "what's in this workflow?" / "見せて".ccwf export <file>orccwf run <file>— materialises the workflow as Claude Code (or another agent's) Skill files. Userunwhen the user wants the next step to be actually executing the workflow withclaude.
If a step fails, stop and surface the exact error to the user before moving on.
Subcommand reference
ccwf render <file>
Print a Markdown bundle (Mermaid flowchart + per-node execution instructions) to stdout. Use when piping to another tool or pasting into a PR / chat message.
ccwf render ./.vscode/workflows/my-workflow.json # Markdown (default)
ccwf render ./.vscode/workflows/my-workflow.json -f mermaid # ```mermaid block only
Output is the same content ccwf preview shows in the right pane.
ccwf validate <file>
Schema-check the workflow JSON.
ccwf validate ./.vscode/workflows/my-workflow.json # exit 0/1, human-readable errors on stderr
ccwf validate ./.vscode/workflows/my-workflow.json --json # prints { valid, errors[] }
Use this:
- Before
ccwf run/ccwf exportif the file is hand-edited or AI-generated - In CI / pre-commit hooks
- When the user asks "is this workflow OK?" / "壊れてない?"
ccwf preview <file>
Open a read-only viewer in the browser. Mermaid flowchart on the left, per-node Markdown on the right. Auto-reloads when the file changes on disk. Auto-shuts down 30s after the last viewer tab closes.
ccwf preview ./my-workflow.json # boot, open browser
ccwf preview ./my-workflow.json --port 51234 # pin to a port
ccwf preview ./my-workflow.json --keep-alive # don't auto-shutdown when the tab closes
Use when the user says any of: "show me", "preview", "what does this workflow do?", "open it in a browser", "見せて", "可視化して".
The printed URL has the shape http://localhost:<port>/<uuid>/. The UUID just keeps two concurrent preview sessions from clobbering each other — it isn't a security boundary, since the server only listens on the loopback interface by default.
ccwf canvas <file> (experimental)
Open the full editable canvas in the browser (same UI as the VSCode extension). Saves write back to the workflow file. Heavier than preview; reach for it only when the user explicitly wants to edit without VSCode.
ccwf canvas ./my-workflow.json
Other VSCode-only features (Slack share, Claude API upload, MCP server management, agent-specific export buttons) return a CANVAS_UNSUPPORTED error in this mode — they require the extension proper.
ccwf export <file> [--agent <name>]
Materialise the workflow as Agent Skill files for a target agent. Pure file write, no execution.
ccwf export ./my-workflow.json # --agent claude-code (default)
ccwf export ./my-workflow.json --agent cursor # cu
常见问题
如何安装 ccwf?
技能说明,可以用 npm 全局安装该包,也可以通过 npx 运行而无需安装。
工作流文件通常保存在哪里?
技能说明,通常保存在 .vscode 目录下的 workflows 文件夹中。
validate 会返回什么?
退出代码为 0 表示文件没有问题,为 1 表示发现了错误。
详情
作者的原始描述
Use the `ccwf` CLI (from @cc-wf-studio/cli) to render, validate, preview, export, or run cc-wf-studio workflow JSON files from the terminal. Apply whenever the user mentions viewing, visualizing, checking, executing, or converting a workflow under `.vscode/workflows/` (or any `*workflow*.json`), wants a Mermaid diagram of a workflow, asks to "see" / "preview" / "open" a workflow, or wants to run a workflow as a Claude Code Skill without opening VSCode.
热度
- GitHub 星标
- 5.4k
- 排名
- #14844
- 许可证
- —
- 更新时间
- 2026/10/6
评论
- …