principles/principle-encode-lessons-in-structure/SKILL.md

name: principle-encode-lessons-in-structure description: "Apply when writing the same instruction twice. Encode it as a lint, check, or script instead of more prose."

Encode Lessons in Structure

Recurring corrections belong in a mechanism, not another paragraph. A lint, type, runtime check, or script enforces the rule without hoping the next reader notices.

Why: Prose is easy to miss. It requires notice, memory, and compliance. Structure fails closed.

Pattern:

  • Catch yourself writing the same instruction a second time: can this be a lint, a type, a check, or a script?
  • If yes, encode it and delete the instruction.
  • If it genuinely needs judgment, keep the instruction and make the failure mode concrete with an example.
  • Pick the strongest rung that fits: unrepresentable state, then CI lint, then canonical helper, then runtime check.
  • One-off stays a note. Recurring goes into a skill or lint. Systemic goes into a principle.
  • "I'll keep that in mind" does not persist. Close the loop in this session.
  • The instruction is the symptom. If the fix is structural, only ship the structural fix.