Selectively turn a recurring, high-leverage failure mode into the cheapest mechanical check when its payoff beats maintenance and runtime cost. Type it after the same bug, boundary break, or review finding shows up more than once.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Encode?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/sgathrid-encode)
---
name: encode
description: Selectively turn a recurring, high-leverage failure mode into the cheapest mechanical check when its payoff beats maintenance and runtime cost. Type it after the same bug, boundary break, or review finding shows up more than once.
disable-model-invocation: true
---
# Encode
Most mistakes need a fix, not a new rule. Reach for mechanical enforcement only when a failure mode repeats, hurts when it slips through, and can be caught cheaply without slowing down every run.
## Decide whether to encode
Skip encoding when the issue happened once, needs human judgment to evaluate, or costs more to maintain and run than the mistakes it prevents. Land a clean fix and move on.
Encode when the same bug class, broken invariant, or boundary leak keeps returning and a fast, deterministic check can catch it with near-zero false positives.
Guard against rule bloat. Avoid catch-all lints, style policing, and slow checks that drag down the inner loop. One sharp invariant beats ten noisy rules.
## Pick the cheapest mechanism
Follow the ladder in `${CLAUDE_PLUGIN_ROOT}/shared/principles.md#encode`, stopping at the lightest layer that holds. Reuse the repo's existing check runner and conventions; do not add a new linter, framework, or slow build step without asking. When two source files share a runtime format, command or invariant across a boundary that cannot share an import, `@seam <id>` comments link them symmetrically and `LINT.IfChange`/`LINT.ThenChange(<path>)` links a source block to another file (including docs or configs) for `${CLAUDE_PLUGIN_ROOT}/skills/graph/SKILL.md` at zero runtime cost.
## Make failures teach the fix
When writing a custom check, lint, or invariant test, make the failure message state what broke, what is expected, and the exact fix or canonical helper to use. A clear remediation message lets the next contributor repair the violation in one turn instead of guessing.
## Prove it and clean up
Verify the new check fails on a real violation (or a minimal reproduction of one) and passes on the clean repo. Confirm its runtime cost stays negligible.
Delete any prose note, comment, or checklist line the check now replaces (`${CLAUDE_PLUGIN_ROOT}/shared/principles.md#less`).
## Report
Name the failure mode, the mechanism you chose (or why you skipped encoding), how you proved it catches a real violation, its rough runtime cost, and any prose you deleted.