{"slug": "stop-your-ai-coding-agent-from-rewriting-your-whole-repo", "title": "Stop Your AI Coding Agent From Rewriting Your Whole Repo", "summary": "A developer published UNIVERSAL-AGENTS.md, an MIT-licensed, technology-agnostic AGENTS.md file that constrains AI coding agents to minimal, in-scope changes, reuse of existing code, plan-before-implement workflows, and honest reporting of test results. The ruleset, which now spans 36 sections covering command execution, file edits and Git operations, ships with adapters for Claude Code, Gemini CLI, GitHub Copilot and Cursor plus a project template for build, test and protected-path conventions. Its core principle is that agents should do less rather than more when uncertain, producing smaller reviewable diffs.", "body_md": "You ask an AI coding agent to fix one bug.\n\nThe diff comes back with 14 changed files. Variables were renamed, imports reordered, a dependency was bumped \"while it was there\", and a helper you already had was rewritten from scratch. At the end it tells you the tests pass. You check, and nobody ran them.\n\nThe agent is capable. It just has no idea where the boundaries are.\n\nSo I wrote them down.\n\n`AGENTS.md`\n[**UNIVERSAL-AGENTS.md**](https://github.com/NTDevLops/UNIVERSAL-AGENTS.md) is a single, technology-agnostic `AGENTS.md` you drop into the root of any repository. It tells an AI agent how to analyze, plan, change, verify, and report, with one core idea:\n\n**When uncertain, do less, not more.**\n\nIt is not tied to a language, framework, or tool. It works for Android, iOS, web, backend, desktop, games, libraries, and SDKs.\n\nHere is the same request, \"fix the login button\", handled two ways. This is an illustration, not a benchmark.\n\n**Without guardrails**\n\n**With the rules**\n\nThe result is a small diff you can review in two minutes.\n\nThe original 26 sections cover the whole workflow. These are the ones that make the biggest difference.\n\n**1. Minimal changes only.** Every changed line must have a clear relationship to the request. No drive-by refactors, formatting changes, renames, or dependency upgrades. The file puts it plainly: a change being beneficial does not make it in scope.\n\n**2. Existing code first.** Search before writing. Reuse, then extend, and create new code only when nothing suitable exists.\n\n**3. Plan before implementing.** A concise plan with a **Before vs After** visualization, kept proportional to the change:\n\n```\nBefore                After\n\nUser                  User\n  │                     │\n  ▼                     ▼\nSubmit                Submit\n  │                     │\n  ▼                     ▼\nNo Validation         Input Validation\n                        │\n                        ▼\n                      Processing\n```\n\n**4. Ask, don't guess.** If a request is ambiguous in a way that matters, the agent stops and asks the minimum number of questions.\n\n**5. Honest reporting.** The agent must not claim tests passed unless they ran, or that something was verified when it wasn't.\n\nThere is also a full section on `.gitignore` management: detect the real stack, preserve existing rules, never ignore required files.\n\nAgents now run commands, edit files, and touch Git. Sections 27–36 add rules for that:\n\nThe new sections only add to the original rules. Sections 1–26 keep their numbering and purpose.\n\n`adapters/` folder (Claude Code, Gemini CLI, GitHub Copilot, Cursor). Many tools read `templates/AGENTS.project.template.md` to `AGENTS.project.md` and fill in your build and test commands, conventions, and protected paths.\nProject rules rank above the universal ones, except for the safety rules, which only an explicit user instruction can override.\n\nThe rules include a short report format, so every task ends the same way:\n\n```\nChanged:        <files and a one-line description each>\nNot changed:    <things intentionally left alone>\nReused:         <existing code relied on>\nDocumentation:  <updated files, or \"no update required\">\nVerification:   <commands run and their actual results, or \"not run: reason\">\nAssumptions:    <or \"none\">\nObservations:   <unrelated issues worth knowing, or \"none\">\n```\n\nReviewing becomes a checklist instead of an investigation.\n\nThe agent should behave like a disciplined software engineer:\n\nNone of that is exotic. It is what you'd expect from a good teammate, written down so an agent can follow it.\n\nIt's MIT licensed, so use it, fork it, and adapt it to your workflow:\n\n👉 [https://github.com/NTDevLops/UNIVERSAL-AGENTS.md](https://github.com/NTDevLops/UNIVERSAL-AGENTS.md)\n\nIf it saves you one painful diff, a star helps other developers find it. If a rule is unclear or an agent finds a loophole, open an issue and I'll tighten it.\n\n*What's the worst thing an AI agent has done to your repo? Tell me in the comments.*", "url": "https://wpnews.pro/news/stop-your-ai-coding-agent-from-rewriting-your-whole-repo", "canonical_source": "https://dev.to/codenamew/stop-your-ai-coding-agent-from-rewriting-your-whole-repo-3llf", "published_at": "2026-10-07 23:05:25+00:00", "updated_at": "2026-10-07 23:17:10.779603+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["Claude Code", "Gemini CLI", "GitHub Copilot", "Cursor", "NTDevLops"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/stop-your-ai-coding-agent-from-rewriting-your-whole-repo", "markdown": "https://wpnews.pro/news/stop-your-ai-coding-agent-from-rewriting-your-whole-repo.md", "text": "https://wpnews.pro/news/stop-your-ai-coding-agent-from-rewriting-your-whole-repo.txt", "jsonld": "https://wpnews.pro/news/stop-your-ai-coding-agent-from-rewriting-your-whole-repo.jsonld"}}