一份让 Agent 指令文件自我精简的审查提示词
写 agent 提示词的人都知道上下文越塞越乱,这份来自 lauren 的提示词把 AGENTS.md、cursor rules 这些文件逐个审计,能用 linter 和测试替代的 prose 全删掉,最后还用盲测消融验证留下的文本到底有没有用。想让仓库指令瘦身又不想靠感觉砍的开发者直接抄走就能跑。
lauren(@poteto)分享了一个用于审计代码仓库中 Agent 面向文本的提示词,目标对象包括 AGENTS.md、skills、cursor rules、架构与 spec 类 markdown 文档。提示词要求先清点每个文件的字节数,并把其中的声明分成三类:重复代码或类型的直接删除、可机械化执行的转成 linter、编译检查、类型化 API 或测试后删除原文、不可再简化的判断类内容才考虑保留。
流程的第二步是把可执行规则迁入 CI、lints 和测试,让根指令只保留自动化检查覆盖不到的部分。第三步设计了盲测消融实验:从仓库中选 1-2 个有客观评分标准的真实任务,预注册修剪规则(例如大一组文本的中位数不比小组高出至少 2 分就删掉),在仅文本不同的干净提交上跑 3 次独立复现,分 A(全量指令)、B(仅领域指令)、C(仅最小根指令)三组,用独立 judge 模型和自动化探针测试对盲化 diff 打分。
最后输出记分卡,标注哪些文档和 skills 从未被打开、哪些文本起了负作用,凡是未通过预注册修剪规则的内容一律删除,并把反复出现的失败模式转成测试或 lint 而非新的散文。这套方法把上下文窗口里“哪些文字真正有价值”从经验之争变成了可量化的实证问题。
她给的审查提示词 lauren @poteto here's a prompt you can try Audit all unstructured agent-facing text in this repo (AGENTS.md, skills, cursor rules, architecture/spec markdown docs) and replace as much of it as possible with executable code, types, lints, and tests. Then prove empirically what text actually earns its context window. 1. Inventory: list every doc, rule, and skill file, its byte size, and classify each claim into: - Restates code or types (delete) - Mechanically enforceable (convert into a linter, compiler check, typed API, or test, then delete the prose) - Irreducible judgment call (candidate to keep, only if concise) 2. Prune and enforce: move enforceable rules into CI/lints/tests first, delete the dead prose, and shrink root instructions to only what automated checks cannot catch. 3. Run a blinded ablation eval before keeping any remaining instructions/skills: - Pick 1 to 2 representative real tasks from this repo with an objective rubric and stress tests. - Pre-register a prune rule before running (for example: drop the larger text set unless its median beats the smaller set by at least 2 points). - Run 3 fresh isolated replicates per condition on clean commits that differ ONLY in the text under test: - A: full current instructions/skills - B: domain-only instructions - C: minimal root instructions only (0 skills/extra docs) - Audit transcripts for leaks (verify which files were actually opened vs just sitting in the system prompt). - Grade blinded diffs + built artifacts only (strip branch names, SHAs, and notes) using a separate judge model + automated probe tests. 4. Report the scorecard, which docs/skills were never opened, where extra text hurt or helped, and delete everything that fails the pre-registered prune rule. Turn any recurring failure modes into tests or lints, not new prose. 🔗 View Quoted Tweet
本条情报归属 AITOP「技巧」核心栏目,重点聚焦北美前沿实验室与硅谷科技巨头。在跨区域产业观察坐标中,该动态直接关联「AI 开发者工具链、Coding Agent 与工程化实践」研究主线,反映出当前技术演进与商业落地的最新风向。涉及核心实体与技术议题包括:提示词工程、AGENTS.md、cursor rules、Agent,读者可通过下方标签进入对应专题页查阅历史脉络与关联对比。
信源核验说明:本文原始信息发布自一手权威信源「歸藏(guizang.ai)」(Tier-1 一手发布),具备高确定性参考价值。