docs-style

A style and structure rulebook for writing documentation sites with VitePress, a tool that turns Markdown files into websites. It covers headings, Chinese-language typography, filenames, URLs, and links.

In plain words
What is it for?
Use it when editing docs files, especially to choose heading levels, format Chinese and English text, link between pages, reference GitHub examples, and preserve the required URL settings.
Why use it?
It keeps documentation consistent and avoids broken links or site behavior caused by incorrect VitePress settings.

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/docs-style
Clone the repo
git clone --depth 1 https://github.com/xuliang2024/cutcli-cookbook

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,758 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.01758
Opus 5 $0.00000 $0.00879
Sonnet 5 $0.00000 $0.00352
Haiku 4.5 $0.00000 $0.00176

Measured 2d ago against content hash 427089ed335f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

docs-style 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 2d ago.

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/docs-style.mdc · 164 lines

How it starts

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

文档编写规范(docs/**)

VitePress 配置约束

docs/.vitepress/config.mts 关键设置:

cleanUrls: false   // 必须保留:让 R2 直接命中 .html 文件

如果改成 cleanUrls: truedocs.cutcli.com/guide/installation 就需要 worker 强行重写到 .html,但 worker 已经做了路径回退(/foofoo.htmlfoo/index.html),这层回退是为了兼容 cleanUrls 风格的链接,不要因此关掉路径回退。

中文文档风格

  • 中英文之间 1 个空格:「使用 cutcli 创建草稿」
  • 数字与中文之间 1 个空格:「3 秒后退出」
  • 标点:使用全角中文标点(,。?!);代码 / 命令内保持半角
  • 引号:内容用「」,引用用 ""

标题层级

  • 每篇 markdown 唯一 H1(用文件 frontmatter title 也行,但要么 frontmatter 要么 H1,二选一不要双写)
  • H2 用作主要章节
  • H3 / H4 用作小节
  • 不要直接跳层(H2 → H4)

文件名 / URL 风格

  • 文件名 kebab-case:first-draft.mdtime-units.md
  • URL 不带扩展名(VitePress 自动加 .html
  • 内部链接用相对路径:./first-draft/guide/first-draft
  • 引用案例用绝对 GitHub 链接:https://github.com/xuliang2024/cutcli-cookbook/tree/main/examples/...

链接规则

场景 写法
同侧栏内的 guide 互链 [一节](./time-units)
跨侧栏(guide → reference) [CLI](/reference/cli)
引用案例目录 [examples/01-hello-caption](https://github.com/xuliang2024/cutcli-cookbook/tree/main/examples/01-hello-caption)
外链(cutcli.com、GitHub) 直接 <https://...>[文字](https://...)
引用图片资源 docs/public/ 下,URL 用 /foo.svg(不是 ./public/foo.svg

CI 用 scripts/check-links.mjs 校验内部链接,不通过 fail。

命令示例

  • 命令名严格 cutcli,不写 cut
  • 多行命令换行用 \ 续行
  • 复杂 JSON 用 --captions @data/captions.json 文件引用,避免 shell 转义噩梦
  • 时间字段必须是整数微秒(3000000);不写 3s / 3000ms

表格

  • 用纯 markdown 表格(| ... |
  • 不要拿 HTML table
  • 列对齐用 |---||:---||---:||:---:|

代码块

  • 都加语言:bashjsontypescriptyaml
  • shell 命令前不加 $ 提示符(VitePress 主题已视觉化)
  • 引用本地文件路径用 inline code,例如 `docs/.vitepress/config.mts`

VitePress 特有语法

::: tip
小提示
:::

::: warning
警告
:::

::: danger
危险操作
:::

::: details 折叠展开
里面写细节
:::

适度用,不要每段都包。

自动生成区域 ⚠

docs/reference/cli.mddocs/reference/api.mddocs/reference/concepts.mdjy_cli/scripts/sync-to-cookbook.mjs 单向覆盖。不要直接编辑

  • 改这些文件 → 下次同步会被覆盖回去
  • 真要改 → 改 jy_cli/docs/cli.md(或 api.md / README.md)→ 跑 node scripts/sync-to-cookbook.mjs

Read the full file on GitHub · 164 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. 2d ago First seen · 164 lines · 0 tokens per session scan A 427089ed335f

Subscribe to this mod's changes

docs-style is a cursor rule published in the GitHub repository xuliang2024/cutcli-cookbook (192 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,758 tokens. 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.