Principle Encode Lessons In Structure

by cursorccb5507cec15No license10K starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated today

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.

Instructions onlyAI & Agents
AI-generated overview

Turns recurring corrections into structural mechanisms like lint rules, metadata flags, runtime checks, or scripts instead of repeated instructions.

What it does
This skill guides an agent to notice when the same instruction or correction keeps recurring and to encode that rule in a mechanism rather than in more prose. It walks through choosing the strongest available mechanism, routing fixes to the right layer, and closing the feedback loop. It produces decisions and concrete actions such as adding a lint rule, metadata flag, runtime check, or script, or making an instruction more prominent when judgment is required. It is instructions only and ships no scripts.
When to use it
Use it when you catch yourself writing the same instruction a second time, when a correction keeps recurring, or when a fix should be enforced by tooling rather than remembered by a reader. It also fits deciding whether a correction is a one-off or a pattern and where that pattern belongs.
Requirements
No tools, packages, runtimes, credentials, or network access are required; it is instructions only and ships no scripts.

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 (requires judgment), make the instruction more prominent and add an example of the failure mode

Pick the strongest mechanism. 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: 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)

Source and attribution

Source:cursor/pluginsinpstack/skills/principle-encode-lessons-in-structureat commitccb5507

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal

Principle Encode Lessons In Structure Agent Skill | SourceWeft