agentleFS
kkgogogo17kkgogogo17/pi-pstack/skills/principle-encode-lessons-in-structure/SKILL.md

principle-encode-lessons-in-structure

Skill9 starsChanged 3 months agoMITView on GitHub

Apply when you catch yourself writing the same instruction a second time, or notice a recurring correction. Encode the rule as a lint, metadata flag, runtime check, or script instead of more text.

We split this skill into the rules it gives an agent

7 rules. 7 are common, 0 are distinctive, and 0 are very specific to this project.

  • 7

    Common

    Most of the 38 edited versions we read keep these.

  • 0

    Distinctive

    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. Common:

    When you catch yourself writing the same instruction a second time:

    line 14
  2. Common:

    Ask: can this be a lint rule, a metadata flag, a runtime check, or a script?

    line 15
  3. Common:

    If yes, encode it. Delete the instruction

    line 16
  4. Common:

    If no (genuinely requires judgment), make the instruction more prominent and add an example of the failure mode

    line 17
  5. Common:

    Corollary: Don't paper over symptoms.

    line 21
  6. Common:

    Capture every correction: When the human intervenes or tests fail, decide if it's a one-off or a pattern.

    line 24
  7. Common:

    Close the loop: Don't just record. Apply now or create a concrete todo.

    line 26

“Common” is measured: kept by at least 6 in 10 of the 38 edited versions of this file we could read. “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

Encode recurring fixes in mechanisms (tools, code, metadata, automation) instead of textual instructions. Every error, human correction, and unexpected outcome is a learning signal. Capture it, route it, and close the loop.

Why: Textual instructions are easy to miss. They require the reader to notice, remember, and comply. Structural mechanisms (lint rules, metadata flags, runtime checks, automation scripts) enforce the rule without cooperation.

Pattern: When you catch yourself writing the same instruction a second time:

  1. Ask: can this be a lint rule, a metadata flag, a runtime check, or a script?
  2. If yes, encode it. Delete the instruction
  3. If no (genuinely requires judgment), make the instruction more prominent and add an example of the failure mode

Pick the strongest rung. When more than one mechanism would work, choose the strongest the situation allows (an unrepresentable state that cannot compile, then a lint or banned API that fails CI, then a canonical helper, then a runtime check), because agents copy whatever the surrounding code already does and a weaker guard becomes the next template.

Corollary: Don't paper over symptoms. If the fix is structural, ONLY use the structural fix. The instruction IS the symptom.

Feedback loop:

  • Capture every correction. When the human intervenes or tests fail, decide if it's a one-off or a pattern.
  • Route to the right layer. One-off -> brain note. Recurring fix -> skill or lint rule. Systemic issue -> principle.
  • Close the loop. Don't just record. Apply now or create a concrete todo.

Anti-patterns:

  • Acknowledging without recording ("I'll keep that in mind" does not persist)
  • Recording without routing (a brain note about a lint rule that should exist is wasted unless the lint rule gets implemented)
  • Fixing without generalizing (fixing one instance while leaving the recurring pattern intact)

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.

Reviews can't be read right now.

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.