principle-build-the-lever
它能做什么
为智能体提供一条规则:用审阅者可以重新运行的工具实现可重复工作的自动化。适合面对大规模、重复性或难以验证的改动的工程师。
适用场景
- ✓当某项改动要以相同方式触及许多文件的时候。
- ✓当你希望有审阅者可以重新运行的分析或检查的时候。
- ✓当一项工作即将手动完成,而脚本本可以可靠地完成它的时候。
技能链接
https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-build-the-lever/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我们需要在 200 个文件中重命名这个 API。请编写一个我们可以重新运行的脚本,而不是逐个编辑。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会先手动完成第一个单元,以了解其规律,然后构建一个可重新运行的工具,例如代码批量转换工具。它会在该单元上重新运行工具,并将结果与手工完成的版本进行比较,以证明工具有效。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Build the Lever
When the work isn't trivial, build the tool that does it instead of doing it by hand.
A codemod, generator, or script does the work the same way every time and reruns for free. The tool is one artifact a reviewer can read and rerun to check the work. Hand-done changes can only be re-verified by redoing them. A deterministic script turns "trust me" into "run this".
Default to building the lever. Skip it only when the task is trivial, a couple of obvious edits you can see at a glance.
- Do the first unit by hand to learn the recipe, then build the tool. Prove it by rerunning it on that unit and diffing against your hand-done version. Make the lever safe to rerun.
- Codemod or script for edits, generator for repetitive files, a dump-to-sqlite query for analysis, a rerunnable check for verification.
- A deterministic lever beats fan-out. If the tool can process every unit in one pass, run it yourself. Don't fan out delegates to hand-apply what a script can do.
- When you fan work out to subagents, write the lever as a skill they all read: the recipe, the verification contract, and the do-not-touch fences in one artifact. Keep it outside the delegates' write scope so they can't quietly edit the contract.
- Applying this principle produces a file. If you cited it and there is no codemod, script, generator, or delegate skill in the diff, you didn't apply it.
- Commit the lever when the work outlives the session.
The bar is triviality, not repetition. A one-off still earns a lever when the lever is what makes the work checkable. Per the Laziness Protocol, build the smallest script that does or proves the job, never a framework.
Distinct from Encode Lessons in Structure, which makes a recurring instruction a durable guardrail. This is throughput and reviewability on the work in front of you. For scripting the verification itself, see Prove It Works.
常见问题
什么时候可以不构建工具?
对于琐碎的工作,例如两处显而易见的编辑,手动完成即可。
为什么脚本比手动工作更好?
它每次都以相同的方式运行,而且审阅者可以运行它来验证工作。
辅助智能体怎么办?
如果一个脚本能一次性完成全部工作,就应该用脚本,而不是把工作分派给辅助智能体。
详情
作者的原始描述
Apply to any non-trivial work, not just bulk work: edits, migrations, analyses, checks. Build the tool that does it or proves it (codemod, script, generator, or a skill your subagents follow) instead of working by hand. The tool is the artifact a reviewer can rerun.
repo: cursor/plugins
热度
- GitHub 星标
- 15k
- 排名
- #10975
- 许可证
- —
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
advisor
15k如果你开启该功能,让你的智能体在关键节点咨询一个更强的第二模型,例如在重大决定之前,或在错误上卡住时。
check-agent-compatibility
15k全面检查 AI 编程智能体能否启动、验证和记录某个代码仓库,并返回一个兼容性评分以及主要问题。
cli-for-agents
15k教你的智能体设计或审查命令行工具,使 AI 智能体无需提示即可运行,并提供清晰的帮助文字和示例。
continual-learning
15k通过把回顾过往对话的工作交给专门的记忆更新程序,使你的 AGENTS.md 笔记保持最新。