prune-prompt-pollution
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePrune Prompt Pollution
清理提示词污染
Agent-facing documents steer by what they activate. A prohibition names the forbidden behavior and makes it more available, not less; an absence declaration spends tokens on what is not there; a stale meta-narrative teaches the agent to ignore the document itself; a strawman warning names the temptation and primes it. This skill rewrites those four patterns without weakening the constraints the document carries. It is guidance, not a script.
面向Agent的文档通过激活的内容来引导其行为。禁令会明确禁止的行为,反而会让该行为更容易被联想到,而不是减少;缺失声明会浪费token在不存在的事物上;过时的元叙述会让Agent学会忽略文档本身;稻草人警告会点明诱惑,反而诱导Agent去关注它。本Skill会重构这四种表述模式,同时不削弱文档承载的约束条件。这是指导性方法,而非固定脚本。
Scope
适用范围
The skill reads prose whose job is to steer the agent's current behavior; records and human-facing text stay with their own standards.
- In scope, automatic — rules files (/
AGENTS.md), skill bodies and descriptions, prompts and visible strings, and current-state design/plan/process documents.CLAUDE.md - In scope, on request — task and session files, which mix live guidance with process record; prune them only when asked.
- Out of scope — code, commit messages, decision records, postmortems, and player- or user-facing copy. These record history or rationale, or are read by people rather than by the model.
The keep list below is the safety valve: a load-bearing negative is restated as its consequence, never deleted.
本Skill处理用于引导Agent当前行为的散文式文本;记录类文本和面向人类的文本遵循各自的标准。
- 自动处理范围 — 规则文件(/
AGENTS.md)、Skill主体与描述、提示词及可见字符串,以及当前状态的设计/计划/流程文档。CLAUDE.md - 按需处理范围 — 任务和会话文件,这类文件混合了实时指导与流程记录;仅在收到请求时才对其进行精简。
- 不适用范围 — 代码、提交信息、决策记录、事后分析报告,以及面向玩家或用户的文案。这些内容用于记录历史或原理,或供人类而非模型阅读。
下方的保留列表是安全阀:承载关键约束的负面表述会被重构为对应的结果,绝不会被删除。
The four patterns
四种问题模式
- Negation priming — "don't think of an elephant", "never use X", "avoid Y". The negation is a weak modifier the strongly-activated concept overruns. Restate the positive target: "write one-line comments", "use the official seam". A prohibition stays only as a hard guardrail you cannot phrase positively; even then, pair it with the positive target so attention lands on what to do.
- Absence declarations — "there is no X", "this file does not contain Y". If the document's job is to state what is present, delete the absence line; if the absence is load-bearing (the agent must not assume X exists), state the consequence: "when X is absent, the lookup answers 503".
- Stale meta-narrative — "this doc used to say", "the old version covered", "previously we recommended". The reader needs the current rule, not its history. State the current rule; the history belongs in git log or a decision record.
- Strawman warnings — "some people think X, but we don't", "you might be tempted to Y, but don't". The warning names the temptation and primes it. State the correct pattern directly; the temptation is not the reader's problem.
- 否定诱导 — "不要想大象"、"永远不要使用X"、"避免Y"。否定是一个弱修饰词,会被强激活的概念盖过。重构为正向目标:"编写单行注释"、"使用官方接口"。只有当无法用正向表述来表达时,才保留禁令;即便如此,也要搭配正向目标,让注意力集中在该做的事情上。
- 缺失声明 — "没有X"、"本文件不包含Y"。如果文档的作用是说明存在的内容,删除缺失声明的行;如果缺失是关键约束(Agent不能假设X存在),则说明对应的结果:"当X不存在时,查询返回503"。
- 过时元叙述 — "本文档过去曾说明"、"旧版本涵盖了"、"我们之前推荐"。读者需要的是当前规则,而非历史。直接说明当前规则;历史内容应放在git日志或决策记录中。
- 稻草人警告 — "有些人认为X,但我们不这么认为"、"你可能会忍不住做Y,但不要做"。警告点明了诱惑,反而诱导了Agent。直接说明正确的模式;诱惑不是读者(Agent)需要考虑的问题。
Keep these
需保留的内容
- Hard guardrails with no positive phrasing — "never store literal secrets in credentials" cannot be restated positively without losing the constraint; keep it and pair it with the positive target ("store only references").
apiKeyEnv - Counterfactual regression pins — "without X, Y happens" states the invariant that keeps the behavior safe; keep it.
- Load-bearing absences — "this environment has no database" is a constraint the agent must honor; keep it or restate it as its consequence, never delete it.
- Suppression justifications — empty-catch explanations and ignore-reasons are required prose; fix a false reason, never delete it.
- Measured bounds — "(measured: 512 nests ≈ 0.15s)" calibrates a constant; the word "measured" is load-bearing.
- 无正向表述的硬性约束 — "永远不要在凭证中存储明文密钥"无法通过正向表述保留约束,因此保留该禁令并搭配正向目标("仅存储引用")。
apiKeyEnv - 反事实回归锚点 — "没有X的话,会发生Y"说明了保障行为安全的不变量;保留此类表述。
- 关键缺失声明 — "此环境无数据库"是Agent必须遵守的约束;保留或重构为对应的结果,绝不删除。
- 抑制理由说明 — 空catch块的解释和忽略原因是必要的文本;修正错误的理由,但绝不删除。
- 度量边界 — "(实测:512个nests≈0.15秒)"用于校准常量;"实测"一词是关键内容。
Workflow
工作流程
- Read the document as the agent will: what does each sentence activate?
- Classify every suspect passage: negation priming, absence declaration, stale meta-narrative, or strawman warning.
- Restate the surviving constraint as a positive target or a consequence, and delete the pollution around it.
- Verify the edit preserves every obligation, invariant, precondition, and postcondition the original carried.
- 以Agent的视角阅读文档:每句话会激活什么内容?
- 对所有可疑段落进行分类:否定诱导、缺失声明、过时元叙述或稻草人警告。
- 将保留的约束重构为正向目标或结果,并删除周围的污染性表述。
- 验证编辑后的内容保留了原文所有的义务、不变量、前置条件和后置条件。
Examples
示例
| Pollution | Restated |
|---|---|
"Don't use | "Use |
| "This file has no tests" | "Coverage lives in |
| "The old README recommended X" | "Use X." |
| "You might want to cache this, but don't" | "The lookup is O(1); no cache." |
| 污染性表述 | 重构后表述 |
|---|---|
"不要使用 | "对于永不重新赋值的绑定使用 |
| "本文件没有测试" | "测试覆盖率文件位于 |
| "旧版README推荐X" | "使用X。" |
| "你可能想要缓存这个,但不要这么做" | "查询操作是O(1)复杂度;无需缓存。" |