跳到正文
Skillpedia
通用编程15k · #10975

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-build-the-lever/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能