{"slug": "why-ai-agents-keep-breaking-your-code-and-what-to-do-about-it", "title": "Why AI Agents Keep Breaking Your Code (And What to Do About It)", "summary": "A developer created the ANSS (AI-Native System Specification Standard) after repeatedly finding that AI coding agents broke code by misinterpreting human-written requirements. The format introduces tagged sections like `[A]` for agents and verifiable `Check` fields, reducing rework iterations from 5-7 down to 2-3 by treating AI as a first-class reader rather than an afterthought. Agents using ANSS now surface contradictions in specs before writing code, with a hard rule to stop and ask questions if more than three problems are found.", "body_md": "Picture this: you write a requirement. Clear, specific. The agent reads it, does exactly what you wrote — and breaks three things you never mentioned.\n\nNot because the agent is bad at its job. Because the spec was written for a human reader, not a machine.\n\nHuman developers tolerate ambiguity. They fill gaps from experience. They ask before doing something irreversible. AI agents don't work that way — they fill gaps with whatever their training data suggests. Sometimes that's fine. Sometimes it destroys an afternoon.\n\nAfter hitting this wall enough times, I stopped trying to write better prompts and started thinking about the spec format itself.\n\nIEEE 830. ISO/IEC 29148. GOST 34.602. All written decades before AI coding agents existed. All designed for a human reader who can tolerate a certain level of \"you know what I mean.\"\n\nAgents don't know what you mean. They know what you wrote.\n\nThe gap between those two things is where most rework happens.\n\n**ANSS (AI-Native System Specification Standard)** is a spec format where AI agents are treated as first-class readers — not an afterthought.\n\nHere's what changed in my workflow after adopting it: instead of 5–7 back-and-forth iterations to get an agent to do something right, I'm down to 2–3. Agents started surfacing contradictions in my *own specs* before writing a single line of code. That alone saved me hours I didn't know I was losing.\n\nEvery section gets a tag:\n\n```\n[D] Domain        — WHAT to build   → Product Owner, PM\n[E] Engineering   — HOW to build    → Developer, Architect\n[A] Agent         — HOW agent does it → AI agents (read this first)\n```\n\nAgents read `[A]`\n\nsections first. Everything they need to operate without guessing lives there.\n\n``` js\nINV-001: No external npm packages\nCannot: add require() of npm modules\nReason: app must run without npm install\nCheck: no node_modules imports in server.js\n```\n\nThe `Check`\n\nfield is what makes this different from a comment. It's a verifiable rule. Before invariants, I wrote \"keep the codebase minimal\" — an agent once interpreted that as license to add three npm packages. Invariants eliminate that interpretation space.\n\nBefore writing anything, the agent audits the spec:\n\n**Hard rule: more than 3 problems found → stop and ask. Do not proceed.**\n\nThe first time an agent told me \"I found 5 contradictions in your spec\" before writing a line of code, I realized how many hours of rework I'd been generating for myself.\n\n```\nCurrent State → Desired State → What NOT to change → Impact → Rollback\n```\n\n\"What NOT to change\" is the section that doesn't exist in any classic spec format. It's the most useful thing I've added to my workflow.\n\n```\nCORE        15–20 pages   Bots, SaaS, APIs, automations (80% of projects)\nEXTENDED    40–60 pages   Security, compliance, detailed testing\nENTERPRISE  Full standard Banks, regulated industries, AI platforms\n```\n\nGive it to your agent. Ask it to run Agent Review before writing code. See what it finds in your own requirements.\n\n→ [github.com/Kholomyanskiy/anss-standard](https://github.com/Kholomyanskiy/anss-standard)\n\nCC BY-NC-SA 4.0. Two real filled examples. Works with Claude Code, Cursor, GitHub Copilot.\n\n*Artem Kholomyanskiy — AI automation consultant, EVAI Consulting*", "url": "https://wpnews.pro/news/why-ai-agents-keep-breaking-your-code-and-what-to-do-about-it", "canonical_source": "https://dev.to/artem_kholomyanskiy_9d803/why-ai-agents-keep-breaking-your-code-and-what-to-do-about-it-5bp0", "published_at": "2026-06-03 23:35:06+00:00", "updated_at": "2026-06-03 23:41:20.936754+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "ai-products", "ai-research", "large-language-models"], "entities": ["ANSS", "IEEE 830", "ISO/IEC 29148", "GOST 34.602"], "alternates": {"html": "https://wpnews.pro/news/why-ai-agents-keep-breaking-your-code-and-what-to-do-about-it", "markdown": "https://wpnews.pro/news/why-ai-agents-keep-breaking-your-code-and-what-to-do-about-it.md", "text": "https://wpnews.pro/news/why-ai-agents-keep-breaking-your-code-and-what-to-do-about-it.txt", "jsonld": "https://wpnews.pro/news/why-ai-agents-keep-breaking-your-code-and-what-to-do-about-it.jsonld"}}