principle-encode-lessons-in-structure · git:20261109.c998def · 2026-11-09 · sha256 de3fc8e7fd66eb8e
principle-encode-lessons-in-structure git:20261109.c998defA
Immutable. This exact content never changes and is served at /api/v1/blob/de3fc8e7fd66eb8e.
No tool to install first
claude plugin marketplace add https://markdownregistry.com/mp/a/art_2xouwohr4a4nab3h/de3fc8e7fd66eb8e4eef4c7702d6068df4777e613bf56d726472735ba0fe277b.json
Then /plugin install principle-encode-lessons-in-structure@markdownregistry-2xouwohr4a4nab3h in Claude Code. It installs this exact version, the one graded A here, pinned to the commit it was graded at, and leaves it there.
---
name: principle-encode-lessons-in-structure
description: "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."
disable-model-invocation: true
---
# 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)
<!-- CORE-OVERLAY-START -->
## This repository (Asymmetric-al/core)
Vendored from [p3-stack](https://github.com/uzairansaruzi/p3-stack) (MIT) at commit `09909eb`. Provenance is in `references/upstream.md`. On conflict, the current user request, root `AGENTS.md`, the nearest nested `AGENTS.md`, and the matching `docs/ai/rules/*` rulebook win over this skill.
- Explicit invocation only: use it when the user invokes `/principle-encode-lessons-in-structure` (Claude Code, Cursor, T3 Code) or `$principle-encode-lessons-in-structure` (Codex), or when an invoked p3-stack skill routes here. Do not route other work to it.
- Confirm before outward-facing or hard-to-reverse actions such as pushing, merging, deploying, deleting, or posting messages, unless the user authorized that action for this task.
Edit this canonical copy in `docs/ai/skills/principle-encode-lessons-in-structure/`, then run `bun run skills:sync` and `bun run skills:verify`.
<!-- CORE-OVERLAY-END -->