← ClaudeAtlas

arch-encodelisted

Turn an architectural mistake into a durable, enforceable rule. Use right after catching drift, a repeated bad pattern, or a review finding you want to stop recurring — or whenever someone says "add a rule so this never happens again." Writes the rule as a specific negative code example in the correct file (the nearest scoped AGENTS.md, or the repo's decisions.md), wires it into the mechanical gate when it is mechanically checkable, then proves the rule holds by reverting the bad change, clearing context, and re-running the original task. Also prunes bloated or contradictory rule files.
techfleetworks/enterprise-software-AI-skills · ★ 0 · AI & Automation · score 70
Install: claude install-skill techfleetworks/enterprise-software-AI-skills
# arch-encode — write rules that actually hold A stored rule *influences*, it does not *enforce*. It makes a violation less likely, not impossible. So write rules that are hard to misread and, where possible, back them with a mechanical check. A vague rule is worse than none — it costs context every session and catches nothing. ## 1. State the rule as a specific negative code example The example beats the principle. Convert the mistake into the smallest concrete rule, phrased as a prohibition with a ❌ / ✅ pair drawn from *this* codebase: ``` ### Data access never lives in a component // ❌ never — inside a UI component const { data } = await db.from('orders').select() // ✅ always — go through the owning hook/service const orders = useOrders() ``` Rules to avoid: "prefer thin controllers", "keep layers separate", "try to reuse" — they match nothing. Good rules split/fail cleanly: *"files in `services/` must not import from the UI framework or reference `window`/`document`."* ## 2. Put the rule where the code lives Don't dump everything in the root file. Place it at the right altitude: - A rule about one folder/kind of file → a nested `AGENTS.md` in that folder (loads only when the agent works there; costs nothing elsewhere). - A cross-cutting architectural decision → the repo's **`decisions.md`**. - A truly universal engineering rule → the root `AGENTS.md`. Keep it lean; it loads every session. Never auto-generate a rules file from the codebase or a prompt. Add one line