commit-flow

A contribution and release checklist for the cutcli-cookbook project. It covers required checks, commit-message format, pull requests, and continuous integration, the automated system that tests submitted changes.

In plain words
What is it for?
Use it before committing changes to examples, templates, prompts, docs, scripts, or the Cloudflare Worker, and when preparing a branch or pull request.
Why use it?
It reduces broken documentation, examples, and deployment code reaching the project by defining what must be checked before submission.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/xuliang2024/cutcli-cookbook/commit-flow
Clone the repo
git clone --depth 1 https://github.com/xuliang2024/cutcli-cookbook

Made for: Cursor.

Per session 1,256 This file is loaded in full into every session.
When invoked 1,256 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01256 $0.01256
Opus 5 $0.00628 $0.00628
Sonnet 5 $0.00251 $0.00251
Haiku 4.5 $0.00126 $0.00126

Measured yesterday against content hash b0654032d5ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

commit-flow scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/commit-flow.mdc · 154 lines

How it starts

The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.

提交流程

提交前自检(必跑)

npm run lint            # cases + commands + links 全过
npm run docs:build      # VitePress 构建无错

如果改动了案例:

node scripts/validate-example.mjs examples/<your-case>
bash examples/<your-case>/run.sh    # 真跑一遍,剪映打开验证

如果改动了 Worker:

cd worker && npx tsc --noEmit       # type-check
cd worker && npx wrangler dev       # 本地起测一下

Conventional Commits

格式:

<type>(<scope>): <subject>

[可选正文]

[可选 footer,如 BREAKING CHANGE / Closes #123]
type 用途
feat 新功能、新案例、新模板
fix bug 修复
docs 文档变更(含 README、guide、cookbook)
chore 构建脚本、依赖升级、CI、配置
refactor 重构、不影响行为
test 测试代码
style 仅格式调整

scope 推荐:examples / templates / prompts / docs / worker / scripts / ci / release

例子:

feat(examples): add 06-cinematic-title with bouncy text
fix(worker): handle trailing slash in path resolution
docs(guide): translate first-draft.md to English
chore(ci): bump cloudflare/wrangler-action to v3.5
refactor(scripts): extract walk() into _lib

PR 流程

  1. Fork 或创建分支
    git checkout -b feat/my-case
    
  2. 改动 + 自检(见上文)
  3. Push 到 origin
    git push -u origin feat/my-case
    
  4. 开 PR
    gh pr create --title "feat(examples): add my-case" --body-file <(cat <<'EOF'
    ## 这个 PR 做了什么?
    ...
    ## 自检
    - [x] npm run lint 通过
    - [x] bash examples/my-case/run.sh 本地跑成功
    - [x] preview.gif 已加(≤3 MB)
    EOF
    )
    
  5. 等 CI 绿(约 1-2 分钟)
  6. 等 review:默认要 1 个 approve

CI 必过线

PR 必须满足:

检查 workflow 任务
Lint ci.yml npm run lint:cases / lint:cmds / lint:links
文档构建 ci.yml npm run docs:build
Worker 类型检查 ci.yml cd worker && npx tsc --noEmit

合并到 main 后还会自动跑:

Workflow 触发 内容
deploy-docs.yml push 到 main 且改了 docs/worker/ build + R2 上传 + worker deploy + smoke test
scheduled-cases-test.yml 每天 02:00 UTC+8 跑全部案例校验,失败自动开 issue

Read the full file on GitHub · 154 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 154 lines · 1,256 tokens per session scan A b0654032d5ba

Subscribe to this mod's changes

commit-flow is a cursor rule published in the GitHub repository xuliang2024/cutcli-cookbook (192 stars, last pushed 3mo ago), licensed MIT. It adds 1,256 tokens to every session, about $0.0063 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.