cursor-rule

A Cursor rule for adding a guided walkthrough to a static HTML prototype: a movable explanation card, step markers, highlighted page areas, and text for each step. It works in a copy of the demo so the original remains untouched.

In plain words
What is it for?
Use it when a static HTML prototype needs a browser-based product walkthrough. It covers copying the demo, adding the walkthrough files, creating its configuration, and checking it in a browser.
Why use it?
It provides a repeatable process for turning a prototype into something that can explain its requirements interactively, without risking the source demo.

Cursor rule

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/yyshawn/explain-kit/cursor-rule
Clone the repo
git clone --depth 1 https://github.com/YYShawn/explain-kit
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 661 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.00661
Opus 5 $0.00000 $0.00331
Sonnet 5 $0.00000 $0.00132
Haiku 4.5 $0.00000 $0.00066

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

Security

Grade A, and why

cursor-rule 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.

launchers/cursor-rule.mdc · 21 lines

What it actually says

当用户要求给当前原型 demo 加「需求讲解」时,按以下流程(全程在原 demo 的副本里操作,原 demo 不动):

  1. 定位 demo 根:找到含 .html 的目录作为 demo 根——可能就是当前目录,也可能是子文件夹(如 demo/)。需求文档可能在兄弟文件夹(如 需求文档/)。
  2. 复制 demo 到同级副本:在 demo 根同级建 <原名>-讲解/,整份 cp -R 复制 demo 根进去。单文件 demo(一个 .html 躺在大杂烩文件夹里)只复制该 .html + 它引用的本地资源(<link>/<script>/<img>/<source>/<video>/<audio> 本地路径,不含 http(s)://data:),保持目录结构;原代码绝对路径(/assets/...file:///C:\...)在副本里改相对,避免引用失效。后续都在副本里。
  3. 读 explain-kit 的 PLAYBOOK.md 并按其流程操作:
    • 全局装过 skill 时位于 ~/.claude/skills/explain/PLAYBOOK.md(或 ~/.codex/skills/explain/PLAYBOOK.md);
    • 否则从克隆的 explain-kit 仓库根读取 PLAYBOOK.md
  4. engine/ 拷到副本根(与 .html 同级)。
  5. 给副本里涉及的每个 .html 加 3 行 include(engine/explain.css + engine/explain-engine.js + explain-config.js,相对路径),不动副本里的原 demo 内容。
  6. 基于 explain-config.template.js 在副本根生成 explain-config.js(需求→steps;Explain.registerAction / registerCleanup / registerExit;每步 setup 自包含)。
  7. 需求文档:若用户没给,先问用户要(路径/粘贴/按 demo 推断),不要臆造;多份文档时问「逐个生成」还是「一次性生成」并给利弊,建议默认逐个跑通第一条再批量。
  8. 告诉用户用浏览器打开副本里的 .html 验证:右下角「📖 需求讲解」→ 选需求卡片 → 走右侧步骤点;讲解卡挡内容时可拖标题栏移开。

engine/PLAYBOOK.md 是单一真相源,与 explain skill 共用。

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 · 21 lines · 0 tokens per session scan A 32509ab78b3f

Subscribe to this mod's changes

cursor-rule is a cursor rule published in the GitHub repository YYShawn/explain-kit (2 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 661 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-31.