agentleFS
AnthonyPoschenAnthonyPoschen/agent-skills/skills/encode-lessons/SKILL.md

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.

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
  1. Distinctive:

    Treat a human correction, preventable failure, repeated workaround, or missed instruction as a learning signal.

    line 17
  2. Distinctive:

    Requires judgment: keep a clear instruction. Make the failure mode and the decision it requires obvious.

    line 23
  3. Distinctive:

    Do not confuse a vague preference with a proven pattern.

    line 26
  4. Distinctive:

    Prefer a mechanism that prevents the wrong path over text that asks someone not to take it.

    line 31
  5. Distinctive:

    Add a static check, lint rule, CI validation, or banned API.

    line 35
  6. Distinctive:

    Use a concise rule and a concrete failure example when the decision cannot be enforced without judgment.

    line 38
  7. Distinctive:

    When a durable guard is justified:

    line 46
  8. Distinctive:

    Put it in the layer that owns the failure.

    line 48
  9. Distinctive:

    Remove or shorten any redundant reminder, while keeping useful rationale, exceptions, and user-facing documentation.

    line 50
  10. Distinctive:

    Leave the surrounding code, tooling, or skill easier to follow than before.

    line 52
  11. Distinctive:

    When the guard reaches beyond the current task's natural scope, report the specific pattern and proposed guard.

    line 54
  12. Distinctive:

    Do not promise to “remember” a recurring correction without recording or enforcing it.

    line 60
  13. Distinctive:

    Do not fix one instance while leaving a known repeatable cause untouched.

    line 62
  14. Distinctive:

    Do not record a lesson without giving it a concrete owner and next action.

    line 63
  15. Distinctive:

    Do not preserve explanatory text that only repeats what a reliable mechanism now guarantees.

    line 64

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

  1. Make an invalid state impossible through data shape, types, or ownership.
  2. Add a static check, lint rule, CI validation, or banned API.
  3. Provide a canonical helper, template, generated structure, or safe default.
  4. Validate at runtime when input is external or the condition is dynamic.
  5. 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:

  1. Put it in the layer that owns the failure.
  2. Prove the guard catches the bad path or makes it impossible.
  3. Remove or shorten any redundant reminder, while keeping useful rationale, exceptions, and user-facing documentation.
  4. 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 coding skill's comment rules and the no-comments reference send those here.
  • scripted-verification when the repeated work is judging results.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.