Command Palette

Search for a command to run...

Назад к скиллам
скилл № 56075

encode-corrections

Use when the user corrects the agent, above all for a mistake it was corrected for before, or asks that a mistake never come back. Turns each correction into…

БесплатноЗапускает вложенные скрипты
fcsouzaот fcsouza★ 29 звёзд на GitHub

Установить encode-corrections в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Encode corrections

Turn each correction into a check that fails when the mistake comes back. A line of prose in CLAUDE.md fails silently: the next agent may not read it, may not weigh it, or may find a reason to skip it. A type error, a lint error or a failing test stops the change.

Adapted from pstack v0.15.46 by Lauren Tan, https://github.com/cursor/plugins/tree/main/pstack (the correct and no-comments skills, the comment-reviewer agent, five principle skills and the TypeScript guide) under the MIT licence, with ideas from her 2026 AI Engineer talk on keeping agent-written code clean. Modified: two modes, a level for harness hooks, an approval rule, TypeScript and Biome recipes checked against current docs, and a tested ratchet script. Licence details: NOTICE.md.

Why this works

  • The codebase is the largest input an agent reads. It copies what it finds there. One workaround becomes the pattern the next agent follows.
  • A rule in prose holds only while someone reads it and agrees. A check holds every time it runs.
  • Some APIs need nuance to use well, and agents use them badly. Ban them outside one wrapper instead of teaching the nuance.
  • Comments cannot be enforced. They go stale, and they give an agent a place to justify a workaround instead of fixing the cause.
  • Each mistake encoded is one less thing a reviewer has to look for.

Rules

  1. Highest level that works. Go through the levels below in order. Stop at the first level that makes the mistake fail.
  2. Prove the check. Reintroduce the real past mistake in a scratch change, watch the new check fail, then drop the scratch change. A check you have not seen fail is a guess.
  3. Same command locally and in CI. Wire the check into the script developers already run and into CI under that same script. A check that runs only in CI teaches the agent nothing until push.
  4. Exceptions sit on the offending line, with a reason. Use the tool's one-line suppression, naming the rule and the reason, and link the issue when the repo tracks one. No file-wide or range suppressions, and no rule switched off for a whole folder to get past one hit.
  5. The error message names the fix. It says what to use instead and where it lives: the function, the file, the type. "Do not use X" alone sends the agent looking for a way around.
  6. Stop new occurrences first. If the pattern is already common, add a ratchet that fails only when a change adds more, then clean up the old ones in their own change.
  7. No prose when structure exists. If a type, lint, test or hook now enforces the rule, do not also add the rule to CLAUDE.md. The table row (below) is the only prose.
  8. Ask before you reshape. Architecture changes, public API changes and anything that touches many files: propose and wait. Use AskUserQuestion. A hook changes harness settings the team shares, so propose it and wait too. Adding a lint, type or test for the correction at hand needs no approval.
  9. Fix the cause, not the spot. Encoding the check does not finish the job. Fix the instance that triggered the correction at its root, and find every other instance of the same fault.

Levels

Level Encode as Fits when
1 Architecture or API design The wrong path can be deleted, hidden or made unreachable: one owner per piece of state, one supported way per task, internals not exported.
2 Types The bad state can be made unwritable: branded ids, parse at the boundary, discriminated unions, exhaustive switch.
3 Lint or CI check Bad code still compiles: a banned import, global or call shape, an import across a layer boundary, a count that must not grow.
4 Behaviour test The mistake is wrong behaviour that no static rule can see. The test asserts what a user of the code observes.
5 Harness hook The mistake is agent behaviour, not code: the wrong package manager, a skipped git hook, a forbidden command.
6 Prose A judgment call that no tool can decide. Write the rule, the failure it prevents, and one example of it.

Details, signs that a level fits and stack-agnostic examples: references/levels.md. TypeScript, bun and Biome recipes: references/typescript-biome.md. Hooks: references/harness-hooks.md.

Mode 1: a correction just happened

  1. Name the class. State the mistake as a class, not an instance. "Imported a main-process module into renderer code", not "wrong import in view.ts".
  2. Check the table. Open the rule table in CLAUDE.md or AGENTS.md. If a row covers this class and its enforcer is prose, this is a repeat: encode it at the highest level in this same change. If a check already covers it and did not fire, the check misses this case: widen it.
  3. Pick the level. Go through the levels from level 1. Write down why each higher level does not work.
  4. Fix the instance at its root. Then search for other instances of the same class (git grep, the new lint run ov
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • NOTICE.md
  • references/harness-hooks.md
  • references/levels.md
  • references/sources.md
  • references/sweep.md
  • references/typescript-biome.md
  • scripts/ratchet.sh

FAQ

Что делает скилл encode-corrections?

Use when the user corrects the agent, above all for a mistake it was corrected for before, or asks that a mistake never come back. Turns each correction into something that fails when the mistake recurs, in this order of preference, an architecture or API change, a type, a lint or CI check whose message names the fix, a behaviour test, or a Claude Code hook, and leaves prose in CLAUDE.md or AGENTS.md only for judgment calls. Also use for an explicit sweep, when the user asks to mine commits, reverts, review comments, instruction files and workaround comments for mistake classes that happened at least twice. Use on phrases like "I already told you this", "you did it again", "you keep doing X", "stop doing that", "add a rule so this never happens again", "turn this into a lint", "encode this lesson", "já te corrigi isso", "para de fazer isso", "de novo isso?", "quantas vezes vou ter que falar", or "varre o repo atrás de erros repetidos".

Как установить скилл encode-corrections?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл encode-corrections запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить encode-corrections с