There is a type of LinkedIn post I keep seeing: “AI-generated code is garbage. I spent three days refactoring what Copilot wrote. AI slop is killing codebases. Real developers write real code.”
The concern is legitimate. Teams are shipping unreviewed, unguided AI-generated code into production with no standards, guardrails, or architectural direction. They are creating codebases that will be expensive to unwind.
The diagnosis is wrong. AI did not create the absence of engineering leadership. It exposed it at machine speed.
A Model Has No Native Context For Your Codebase
An AI can write code quickly, recognize broad patterns, and explain a surprising amount of computer science. What it does not arrive with is local context. It does not know why your team chose one architecture over another, which abstractions are load-bearing, where the business rules belong, or which conventions keep twenty developers from creating twenty incompatible versions of the same application.
That is why the closest human analogy is not a bad engineer. It is a very fast new developer. The developer can produce a lot of work, but still needs to learn the system before they can make good local decisions. They need standards, examples, feedback, and someone who can explain why the rules exist.
Without that context, the model gravitates toward the easiest solution that satisfies the immediate request. That solution may compile, render, and pass a narrow test while still putting business logic in a controller, hardcoding a prompt in a UI path, or adding another incompatible pattern to a codebase that already has too many.
Spaghetti code is often not an AI failure. It is an unexamined default that a team allowed the AI to choose.
The Operating System Around The Agent
The fix is the same one a good manager uses with a new developer: make the standards explicit, establish a workflow, and inspect the result against the standard.
At my current employer, an agent starts by loading the base standards, the golden rules, and the agentic-workflow modules. Those modules tell it how to scaffold the task and which additional standards modules to load based on the work: UI, API, data access, infrastructure, testing, or another concern.
The agent also loads the code map before it begins changing code. That map tells it where the change belongs and which existing methods, services, models, and patterns already solve adjacent problems. The goal is to keep the agent from inventing a new structure when the correct structure already exists.
The standards dictate the architecture and the tests. The scorecard runs at the end. It does not merely pronounce the result good or bad. It shows where the work is strong, where it is weak, and where the next improvement belongs.
That workflow is an operating system around the agent. The model still writes the code, but it does not have to guess how this team builds software.
The Sales Tool Is The Evidence
The primary sales tool used by our field representatives was rebuilt with AI-assisted development under that system. As of July 24, 2026, the work spans three repositories with 1,952 code files, 405,579 lines of code, and 2,761 unit tests.
The team has since delivered multiple smaller applications in the new repositories and hundreds of points of work in legacy repositories using the same standards. The standards did not freeze the codebase in place. They gave the team a common way to add and change software without renegotiating the architecture every time an agent opened a session.
That is the part critics of AI-generated code often miss. The question is not whether an agent can generate a large amount of code. It clearly can. The question is whether the organization has made the desired code shape explicit enough that volume compounds into a coherent system instead of a larger cleanup problem.
During the sales-tool rebuild, the code map made that difference visible. With the map loaded, the agent could find and use the correct existing methods instead of hallucinating new ones. Code generation became faster, and the output became easier to review because it followed the system already in place.
Standards Are Not Magic
Standards do not make a weak model strong. They do not prevent hallucinations, eliminate bad requirements, or remove the need for human review. They give a capable model an easier path to the right answer, and they give the team a reliable way to detect when it misses.
That distinction matters. An instructions file is not a substitute for architecture, judgment, review, or testing. It is how those decisions become available at the moment an agent needs them.
If the codebase has no coherent standards, the agent will expose that problem. If the team cannot explain why a dependency should point inward, why a controller should remain thin, or why a specific test is required, it cannot expect an AI to infer the answer from scattered examples and tribal knowledge.
The AI did not create that gap. It made the gap impossible to ignore.
The Question That Matters
Writing instructions that produce consistent output requires a team to articulate what good code looks like. Specifically, precisely, and in writing.
Many teams were failing this test before AI arrived. Their standards lived in one senior developer’s head, in old code-review comments, or nowhere at all. Junior developers struggled, onboarding took too long, and quality varied by who happened to touch a file.
AI raises the cost of that ambiguity because it can multiply whatever direction you give it. Give it a clear architecture, relevant local context, tests, and a review loop, and it can produce clean work at extraordinary speed. Give it a vague ticket and an unexamined codebase, and it will multiply the drift already there.
The question is not whether AI can write good code. The question is whether you know what good code looks like well enough to define, teach, and verify it.
Receipts
- Current production work, measured July 24, 2026: The AI-assisted rework of the primary field-sales tool spans three repositories with 1,952 code files, 405,579 lines of code, and 2,761 unit tests.
- Standards workflow: Each agent session loads base standards, golden rules, agentic-workflow guidance, task-relevant modules, and a code map before implementation. The scorecard then identifies strengths, weaknesses, and improvement opportunities in the result.
- Observed delivery: The same standards support multiple smaller applications in the new repositories and hundreds of points of AI-assisted work in legacy repositories.
- Code-map effect: During the sales-tool rebuild, loading the code map helped the agent locate and use existing methods rather than hallucinating new ones, improving both generation speed and code-review quality.
- Public implementation: The agentic coding standards repository shows the modular standards approach. NuSpec.AI applies the same principle to NuGet package context.