{"slug": "we-put-a-violate-when-exit-clause-on-every-agents-md-rule-agent-over-engineering", "title": "We put a 'Violate when:' exit clause on every AGENTS.md rule — agent over-engineering dropped from 3/10 to 8/10", "summary": "A developer published arch-rule-packs, an MIT-licensed AGENTS.md rule set in which every one of 21 architecture rules carries an explicit \"Violate when:\" exit clause so coding agents know when a rule does not apply. In a blind benchmark of 10 small design tickets, the pack raised design-quality scores from 3/10 to 8/10, while an over-design probe passed in both arms, indicating the clauses curb speculative abstraction rather than trading one failure mode for another.", "body_md": "AI coding agents (Claude Code, Codex, anything that reads `AGENTS.md`) obey architecture rules like dogma. So we put a **` Violate when:` exit clause on every single rule** — a rule without one does not ship. 21 rules, zero binaries, zero CI plugins. Our own bench on 10 small design tickets: **3/10 → 8/10** design-quality score, with an over-design probe proving the pack doesn't just trade one disease for another.\n\nRepo: [theBigGavin/arch-rule-packs](https://github.com/theBigGavin/arch-rule-packs?utm_source=devto&utm_medium=post&utm_campaign=arp-launch-202611)\n\nYou have probably seen this exact commit in your own AI-assisted repo:\n\nHere's the uncomfortable part: none of these are hallucinations. The agent is *following your rules*. Your `AGENTS.md` says \"prefer composition over inheritance\", \"open for extension\", \"separate domain from infrastructure\". The agent dutifully applies them, forever, at every scale — including scales where they cost 2 extra files per service and make the codebase 30% larger without removing a single coupling.\n\nEvery architecture rule is conditional, but almost nobody writes the condition. \"Interfaces at vendor boundaries\" is great advice — right up until you put an interface in front of `Math.max()` (not a joke; we have seen the equivalent in review).\n\nWhen you give an LLM a rule *without* a condition, it optimizes for **visibly obeying the rule**, because that's what's checkable in its context window. The judgment call — *does this rule apply here?* — silently defaults to \"yes\", because \"yes\" produces visible artifacts (an interface, a layer, a factory) and \"no\" produces... nothing. Nothing looks like failure to a model trained to look like it did something.\n\nOur pack ships each rule with two hard sections:\n\n```\n### R3 — Interfaces at vendor boundaries\n**Apply:** HTTP clients, payment SDKs, model providers — anything with a\nnetwork or a vendor you can swap.\n**Violate when:** the client has exactly one implementation AND no second\nimplementation is planned in this quarter. A concrete class is fine.\nDelete the interface the day the second implementation appears.\n```\n\nTwo properties make it work:\n\n`Violate when:` is machine-checkable prose.\nWe ran our own dogfood bench (public in `bench/`): 10 small design tickets — each a one-paragraph task a coding agent would plausibly get — scored **blind** on design quality by a hidden check that evaluates the *design*, not the tests. Same model, same tickets, one arm with the pack in `AGENTS.md`, one without.\n\n| Arm | Design-quality score | \n|---|---|\n| No pack | 3/10 | \n| arch-rule-packs | 8/10 | \n| Over-design probe (tickets that *punish* speculative abstraction) | passes in **both** arms | \n\nWe want to be straight with you about what this is and isn't:\n\n```\ncurl -fsSL -o AGENTS.md https://raw.githubusercontent.com/theBigGavin/arch-rule-packs/main/AGENTS.md\n```\n\nOr clone it and pick rules: each file in `rules/` is standalone. 21 rules, each with `Apply:` / `Violate when:`. MIT.\n\n**Repo:** [theBigGavin/arch-rule-packs](https://github.com/theBigGavin/arch-rule-packs?utm_source=devto&utm_medium=post&utm_campaign=arp-launch-202611) — if you've watched your agent invent a factory for a singleton, the bench README has the 10 tickets; open a PR with your score on your model. We collect them.", "url": "https://wpnews.pro/news/we-put-a-violate-when-exit-clause-on-every-agents-md-rule-agent-over-engineering", "canonical_source": "https://dev.to/w_bushg_ee2cdfa6c771a866/we-put-a-violate-when-exit-clause-on-every-agentsmd-rule-agent-over-engineering-dropped-from-1dm5", "published_at": "2026-11-30 04:38:44+00:00", "updated_at": "2026-11-30 04:45:54.405544+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "large-language-models"], "entities": ["arch-rule-packs", "theBigGavin", "Claude Code", "Codex"], "also_reported_by": [], "takeaway": "Attaching a machine-checkable \"Violate when:\" condition to each AGENTS.md architecture rule lifted blind design-quality scores from 3/10 to 8/10 on 10 small design tickets without failing an over-design probe.", "recommendation": {"advice": "Add an explicit \"Violate when:\" exit clause to every architecture rule in your AGENTS.md so coding agents skip rules that don't apply, and validate with a blind design-quality bench plus an over-design probe.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/we-put-a-violate-when-exit-clause-on-every-agents-md-rule-agent-over-engineering", "markdown": "https://wpnews.pro/news/we-put-a-violate-when-exit-clause-on-every-agents-md-rule-agent-over-engineering.md", "text": "https://wpnews.pro/news/we-put-a-violate-when-exit-clause-on-every-agents-md-rule-agent-over-engineering.txt", "jsonld": "https://wpnews.pro/news/we-put-a-violate-when-exit-clause-on-every-agents-md-rule-agent-over-engineering.jsonld"}}