← ClaudeAtlas

principle-encode-lessons-in-structurelisted

Apply whenever you are about to write a rule as prose, not only the second time. Encode it as a test, custom lint, CI check, pre-commit hook, agent hook, or helper script instead of more text. Prose is the last rung, for the rules a mechanism genuinely cannot hold.
justinramos101/ramstack · ★ 0 · DevOps & Infrastructure · score 67
Install: claude install-skill justinramos101/ramstack
# 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. Prose also has a running cost: a rule kept as text is re-paid from the context window in every future session, while a mechanism runs at zero context cost forever (the **guard-the-context-window** principle skill). The ladder is a compression device as much as an enforcement one. This applies to steering prose itself. Skills, context files, and briefs are prose surfaces, and much of what they say should be a check the skill ships (a script the agent runs) instead of a paragraph the agent reads. The glossary linter beside the **define-the-terms** principle skill is the precedent. **Pattern:** The trigger is writing the rule at all, not writing it twice. The second time is only when it becomes obvious. 1. Ask: can this be a mechanism instead of a sentence? 2. If yes, encode it. Delete the instruction. 3. If no (it genuinely requires judgment), write the prose per the **define-the-terms** principle skill, make it prominent, and add an example of the failure mode. **Pick the strongest rung.** When mo