pin-the-case-that-narrowed-the-rule
When a check fires on the wrong target, the fix makes it weaker. Capture the false positive as a test in the same commit, or the rule erodes silently.
由读过该卡片的评审者赋予,而不是文件自我声明的。智能体在处理不可信内容的运行中提炼出的卡片,生来即被标记为受污染,在被检索之前会一直等待评审。
何时会想到它
- the linter flagged something legitimate
- adding an exception
- false positive in CI
- relaxing a check
价值通常在「避免」和「检查」里。「该做」是人人都会写的那一节。
触发
A check you wrote has failed on something that is actually fine, and you are about to add an exemption, an allowlist entry, or a narrower pattern.
It does not apply when the check found a real problem — fix the problem. It also does not apply to tuning a threshold before the check has ever run in anger.
该做
- Write down, in one sentence, why the flagged case is legitimate. If you cannot, the check may be right and the code wrong.
- Add both cases to the test suite: the legitimate one that must pass, and a synthetic version of the real violation that must still fail.
- Narrow the rule as little as possible. Exempt a path, not a whole directory; require a negation nearby, rather than deleting the phrase from the list.
- Put the narrowing in its own commit, and say in the message which case forced it.
避免
Deleting the rule because it was annoying once. Also avoid the quieter version: broadening an exemption until the rule covers nothing — an allowlist that grows every sprint is a rule being retired one line at a time, without anyone deciding to retire it.
Avoid exempting by file when the real distinction is by meaning. A phrase check that bans a sentence outright will ban the warning that negates it, and the honest fix is to require the negation, not to stop checking that page.
检查
After narrowing, run the suite with the original violation reintroduced. It must still fail.
Then read the diff of the rule itself and ask: what class of problem can now get through that could not before? If you cannot answer, the narrowing was not understood.
风险
This adds a test for every exception, and a suite full of exception tests is a suite that is tedious to read.
The bigger risk is treating the pinned test as proof the rule is still strong. It proves one case still fails. A rule narrowed five times has five pinned cases and possibly a large hole between them, and only re-reading the rule as a whole will show that.
如何使用
卡片就是数据。克隆仓库并按路径导入——任何经由网络到达的内容都会被视为受污染并等待批准,这正是你想要的行为,也是这里没有一行命令安装器的原因。
git clone https://github.com/brcampidelli/chimera-agent.gitchimera skills-import chimera-agent/skills/pin-the-case-that-narrowed-the-rule/SKILL.md完整性
文件发布版本的 SHA-256。导入方可以据此核对收到的内容与本页展示的一致。
a878d8a7114eead1afe465e99b172ab65da44fb14318990266466158fe6f7f7f