example-spec

A rulebook for adding or changing example projects in the repository. It defines required files, folder names, metadata fields, naming rules, and validation requirements.

In plain words
What is it for?
Use it when creating or editing an example, including its English and Chinese README files, executable run script, metadata, data files, and optional preview GIF.
Why use it?
It prevents examples from failing automated checks or becoming inconsistent with the rest of the collection.

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/example-spec
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,895 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 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.01895
Opus 5 $0.00000 $0.00948
Sonnet 5 $0.00000 $0.00379
Haiku 4.5 $0.00000 $0.00189

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

Security

Grade C, and why

example-spec scanned grade C with 2 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

echo "cutcli not found. Install: curl -s https://cutcli.com/cli | bash" >&2

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

echo "cutcli not found. Install: curl -s https://cutcli.com/cli | bash" >&2
.cursor/rules/example-spec.mdc · 223 lines

How it starts

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

案例规范(examples/**)

改动任何 examples/<id>-<slug>/ 都要遵守。CI 会用 scripts/validate-example.mjs 校验。

目录结构

examples/<id>-<slug>/
├── README.md         # 必填:英文版(5 段,英文 H2 标题)
├── README.zh.md      # 必填:中文版(5 段,中文 H2 标题)
├── run.sh            # 必填:可执行 + set -euo pipefail
├── meta.json         # 必填:通过 schema 校验
├── data/             # 复杂 JSON 拆这里
│   ├── captions.json
│   ├── images.json
│   └── ...
└── preview.gif       # 推荐:≤ 3 MB,3-8s

命名规则

  • <id> 范围:
    • 01~09 = P0 入门案例(官方维护)
    • 10~19 = 营销 / 产品类
    • 20~29 = 知识 / 教育类
    • 30~39 = Vlog / 个人类
    • 99-community/<github-handle>/<case>/ = 社区贡献区
  • <slug> 用 kebab-case,如 hello-captionproduct-promo-30s

meta.json schema

{
  "id": "01-hello-caption",
  "title": "Hello Caption",
  "tags": ["captions", "animation"],
  "author": "your-github-handle",
  "duration": 5,
  "resolution": "1080x1920",
  "gif": "preview.gif",
  "description": "一句话描述",
  "level": 1
}

字段约束(详见 scripts/_lib/example-schema.mjs):

字段 类型 约束
id string ^[a-z0-9][a-z0-9-]*$
tags string[] 至少 1 个
duration number > 0
resolution string ^[0-9]+x[0-9]+$
level int 1-5(推荐难度)

README.md(英文)+ README.zh.md(中文)必有 5 个 H2 章节

README.md 必须用英文章节(CI 严格匹配):

## When to use

## Run it

## Key parameters

## Customize

## cutcli features used

如果存在 README.zh.md(强烈推荐 + lint:i18n 强制成对),中文章节必须是:

## 适用场景

## 一行运行

## 关键参数解释

## 进阶改造

## 用到的 cutcli 能力

第一段必须包含 ![preview](preview.gif)(即使 gif 还没录,也要占位)。两个 README 顶部都要有双语切换链接:

[English](README.md) · [简体中文](README.zh.md)

run.sh 必有要素

#!/usr/bin/env bash
# <id>: <一句话描述>
# Usage: bash run.sh
set -euo pipefail

if ! command -v cutcli >/dev/null 2>&1; then
  echo "cutcli not found. Install: curl -s https://cutcli.com/cli | bash" >&2
  exit 1
fi
if ! command -v jq >/dev/null 2>&1; then
  echo "jq not found." >&2
  exit 1
fi

HERE="$(cd "$(dirname "$0")" && pwd)"

DRAFT_ID=$(cutcli draft create --width 1080 --height 1920 --name "<id>" | jq -r '.draftId')

# ... 加内容
cutcli captions add "$DRAFT_ID" --captions "@$HERE/data/captions.json" ...

cutcli draft info "$DRAFT_ID" --pretty

Read the full file on GitHub · 223 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 · 223 lines · 0 tokens per session scan C 7242e447fe1c

Subscribe to this mod's changes

example-spec 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,895 tokens. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.