encode-lessons
Skill2 starsChanged 17 days agoMITView on GitHub
Use when a correction, failure, workaround, or instruction recurs, or when a costly mistake could be prevented structurally. Encode the lesson in the smallest durable guard instead of relying on someone to remember it.
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- act-within-scopeSkill
- build-filesSkill
- codingSkill
- context-managementSkill
- create-verification-skillSkill
- domain-modelingSkill
- experience-firstSkill
- eyes-onSkill
- fluxSkill
- frontend-designSkill
- gitSkill
- grill-with-docsSkill
- in-your-own-wordsSkill
- lint-rulesSkill
- maintain-verification-skillSkill
- scripted-verificationSkill
- security-auditSkill
- skill-evaluationSkill
- test-auditSkill
- test-behavior-not-implementationSkill
- writingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 15 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Treat a human correction, preventable failure, repeated workaround, or missed instruction as a learning signal.
- Distinctive: line 23
Requires judgment: keep a clear instruction. Make the failure mode and the decision it requires obvious.
- Distinctive: line 26
Do not confuse a vague preference with a proven pattern.
- Distinctive: line 31
Prefer a mechanism that prevents the wrong path over text that asks someone not to take it.
- Distinctive: line 35
Add a static check, lint rule, CI validation, or banned API.
- Distinctive: line 38
Use a concise rule and a concrete failure example when the decision cannot be enforced without judgment.
- Distinctive: line 46
When a durable guard is justified:
- Distinctive: line 48
Put it in the layer that owns the failure.
- Distinctive: line 50
Remove or shorten any redundant reminder, while keeping useful rationale, exceptions, and user-facing documentation.
- Distinctive: line 52
Leave the surrounding code, tooling, or skill easier to follow than before.
- Distinctive: line 54
When the guard reaches beyond the current task's natural scope, report the specific pattern and proposed guard.
- Distinctive: line 60
Do not promise to “remember” a recurring correction without recording or enforcing it.
- Distinctive: line 62
Do not fix one instance while leaving a known repeatable cause untouched.
- Distinctive: line 63
Do not record a lesson without giving it a concrete owner and next action.
- Distinctive: line 64
Do not preserve explanatory text that only repeats what a reliable mechanism now guarantees.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Encode Lessons in Structure
A repeated correction is evidence that attention is the wrong control. When a small durable mechanism can prevent the same mistake, prefer it to another reminder.
Decide Whether The Lesson Is Durable
Treat a human correction, preventable failure, repeated workaround, or missed instruction as a learning signal. Classify it before changing the system:
- One-off: fix the immediate problem. Do not create a permanent rule for a minor isolated event.
- Recurring or costly: find the smallest guard that prevents the pattern.
- Requires judgment: keep a clear instruction. Make the failure mode and the decision it requires obvious.
Do not confuse a vague preference with a proven pattern. A single high-risk or high-cost mistake can still justify a durable guard.
Choose The Strongest Suitable Guard
Prefer a mechanism that prevents the wrong path over text that asks someone not to take it.
- Make an invalid state impossible through data shape, types, or ownership.
- Add a static check, lint rule, CI validation, or banned API.
- Provide a canonical helper, template, generated structure, or safe default.
- Validate at runtime when input is external or the condition is dynamic.
- Use a concise rule and a concrete failure example when the decision cannot be enforced without judgment.
Choose the smallest mechanism that is reliable for the actual risk. Do not build a framework, tool, or policy layer for a minor one-off preference.
Close The Loop
When a durable guard is justified:
- Put it in the layer that owns the failure.
- Prove the guard catches the bad path or makes it impossible.
- Remove or shorten any redundant reminder, while keeping useful rationale, exceptions, and user-facing documentation.
- Leave the surrounding code, tooling, or skill easier to follow than before.
When the guard reaches beyond the current task's natural scope, report the specific pattern and proposed guard. Do not start an unrelated framework or repository-wide migration without approval.
Avoid Weak Learning
- Do not promise to “remember” a recurring correction without recording or enforcing it.
- Do not fix one instance while leaving a known repeatable cause untouched.
- Do not record a lesson without giving it a concrete owner and next action.
- Do not preserve explanatory text that only repeats what a reliable mechanism now guarantees.
Source
Adapted from Pstack's Encode Lessons in Structure principle.
Related
- A comment that states a contract is a lesson waiting for a guard. The
codingskill's comment rules and the no-comments reference send those here. scripted-verificationwhen the repeated work is judging results.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

