cd /news/ai-agents/we-put-a-violate-when-exit-clause-on… · home › topics › ai-agents › article
[ARTICLE · art-178393] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

We put a 'Violate when:' exit clause on every AGENTS.md rule — agent over-engineering dropped from 3/10 to 8/10

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.

recommendation

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.

more in playbook: Working with AI coding agents
by read2 min views3 publishedNov 30, 2026

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.

Repo: theBigGavin/arch-rule-packs

You have probably seen this exact commit in your own AI-assisted repo:

Here'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.

Every 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).

When 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.

Our pack ships each rule with two hard sections:

### R3 — Interfaces at vendor boundaries
**Apply:** HTTP clients, payment SDKs, model providers — anything with a
network or a vendor you can swap.
**Violate when:** the client has exactly one implementation AND no second
implementation is planned in this quarter. A concrete class is fine.
Delete the interface the day the second implementation appears.

Two properties make it work:

Violate when: is machine-checkable prose. We 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.

Arm Design-quality score
No pack 3/10
arch-rule-packs 8/10
Over-design probe (tickets that punish speculative abstraction) passes in both arms

We want to be straight with you about what this is and isn't:

curl -fsSL -o AGENTS.md https://raw.githubusercontent.com/theBigGavin/arch-rule-packs/main/AGENTS.md

Or clone it and pick rules: each file in rules/ is standalone. 21 rules, each with Apply: / Violate when:. MIT.

Repo: theBigGavin/arch-rule-packs — 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.

── more in #ai-agents 4 stories · sorted by recency
── more on @arch-rule-packs 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/we-put-a-violate-whe…] indexed:0 read:2min 2026-11-30 · —