arch-encodelisted
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