Treat prompts like code: skills, evals, and ship-gate CI for Cursor slash commands

Treat prompts like code: skills, evals, and ship-gate CI for Cursor slash commands

将 Prompt 视为代码:为 Cursor 斜杠命令引入技能、评估与 CI 门禁

Most Cursor command packs are markdown snippets. You paste a prompt, hope the agent behaves, and when it regresses you shrug and rewrite the paragraph. That is fine for personal notes. It is a bad way to ship workflows other people install. 大多数 Cursor 命令包本质上只是 Markdown 片段。你粘贴一个 Prompt,祈祷 AI 代理能按预期运行;一旦效果退化,你只能耸耸肩,重写那段文字。这种方式用于个人笔记尚可,但对于分发给他人使用的生产力工作流来说,这显然是不合格的。

I wanted the opposite: slash commands that behave like a small product. Each /command is a thin entry. The real contract lives in a paired skill. Behavioral evals score PASS / PARTIAL / FAIL. Ship-gate fixtures in CI fail the build if a safety guard disappears from the skill text. No LLM judge on every PR. Structural anchors only: cheap, boring, enforceable. 我想要的是反其道而行之:让斜杠命令像一个小产品一样运作。每个 /command 只是一个轻量级的入口,真正的契约存在于配套的“技能”(Skill)中。行为评估(Behavioral evals)会给出“通过/部分通过/失败”的评分。CI 中的门禁测试(Ship-gate fixtures)会确保如果技能文档中删除了安全防护措施,构建就会失败。我们不需要在每次 PR 时都运行 LLM 评测,只需依靠结构化的锚点:廉价、枯燥但可强制执行。

A walk through /gauntlet-loop 以 /gauntlet-loop 为例

Take /gauntlet-loop. The idea is simple and mean: stop saying “make it better.” Beat a real example. Command file. Thin YAML frontmatter plus Overview, Defaults, Steps, Anti-patterns, Examples. Step 1 always resolves the skill contract (workspace path, then user install fallback). Anti-patterns use a fixed shape: Trigger / Wrong / Correct / Reason. The Correct behavior must also exist as a positive guard in the skill. 以 /gauntlet-loop 为例,其核心理念简单且严苛:别再说“做得更好”,而是要超越一个真实的范例。命令文件包含轻量级的 YAML 元数据,以及概述、默认设置、步骤、反模式和示例。第一步始终是解析技能契约(优先查找工作区路径,其次是用户安装的备用路径)。反模式采用固定格式:触发条件 / 错误示例 / 正确示例 / 原因。正确的行为必须作为正向防护措施存在于技能文档中。

Skill contract. Intake requires a GOAL and a REAL-WORLD EQUIVALENT, plus an inspectable reference pack (files, screenshots, clip, build, or repo path). A famous name alone is not a pack. The agent decomposes into independent parts, runs a per-part state machine (build → critique → pass | iterate | terminal), and never lets builders grade their own work. Critics use fresh context. Pass only if better than the reference; equal fails. After all parts pass, an integration critic grades the whole. Optional budget, taste-domain pride gate, and a gap ledger for resume. 技能契约要求输入明确的“目标”和“现实世界等价物”,以及可检查的参考包(文件、截图、剪辑、构建或仓库路径)。仅有一个响亮的名字是不够的。代理会将任务分解为独立部分,运行一个分步状态机(构建 → 评审 → 通过/迭代/终止),且绝不允许构建者评估自己的工作。评审者使用全新的上下文。只有优于参考范例才算通过;平局即失败。所有部分通过后,集成评审者会对整体进行评分。此外还包括可选的预算、审美领域门禁以及用于简历的差距记录。

Eval rubric. Cases cover missing reference, missing pack, equal-is-fail, skip-critic, fabricated blind, budget exhaustion, resume-without-retrying-stalled-gaps, and more. PARTIAL counts as fail on the ship gate. 评估准则涵盖了缺失参考、缺失包、平局即失败、跳过评审、伪造盲测、预算耗尽、未重试停滞差距的简历等多种情况。在 CI 门禁中,“部分通过”会被计为失败。

Fixtures in CI. eval/fixtures.yaml lists skill_required phrases that must appear verbatim in SKILL.md. Delete “Do not let builders evaluate their own work” and run-eval-fixtures.py —strict turns red. That is the point: negative knowledge is locked, not tribal. CI 中的测试夹具。eval/fixtures.yaml 列出了必须在 SKILL.md 中逐字出现的“技能必需”短语。如果删除了“不要让构建者评估自己的工作”这一条,运行 run-eval-fixtures.py --strict 就会报错。这就是重点:负面知识被锁定在代码中,而不是依赖口口相传的经验。

Why this matters for installers. When you add the repo as a Cursor user plugin, you get the contracts and the CI story, not just a menu of vibes. The catalog stays portable (generic examples, no employer names). Plugin install syncs with your account across desktop, web, CLI, and mobile. 这对安装者意味着什么?当你将该仓库作为 Cursor 用户插件添加时,你获得的是契约和 CI 流程,而不仅仅是一堆凭感觉写的命令。目录保持可移植性(使用通用示例,不含雇主名称)。插件安装会通过你的账户在桌面端、Web 端、CLI 和移动端同步。

Install: https://github.com/emaraschio/cursor-commands via Customize → Plugins. Not an official Cursor product. MIT. 安装方式:通过 Customize → Plugins 安装 https://github.com/emaraschio/cursor-commands 。非 Cursor 官方产品,采用 MIT 协议。

If you maintain your own slash commands, the reusable idea is smaller than the whole catalog: pair every command with a skill, write a few ship-gate cases, and fail CI when the guard text disappears. That alone beats hoping the model remembers last month’s prompt. 如果你维护自己的斜杠命令,其核心复用逻辑其实很简单:为每个命令配对一个技能,编写几个 CI 门禁测试用例,并在防护文本消失时让 CI 失败。仅此一点,就比祈祷模型能记住上个月的 Prompt 要强得多。