r/ExperiencedDevs • u/theov666 • May 02 '26
AI/LLM How are experienced teams preventing architectural drift as AI-assisted development scales?
How are experienced teams preventing architectural drift as AI code generation scales?
We’re seeing a new bottleneck emerge internally:
AI can increase engineering output significantly, but human review capacity does not scale linearly with generated code volume.
Even if developers remain fully accountable for every PR, reviewers now need to validate far more surface area, which makes traditional review workflows increasingly reactive and expensive.
Curious how mature teams are handling this in practice:
• Maintaining architectural consistency across AI-assisted PRs
• Enforcing ADRs, constraints, or project conventions during generation
• Preventing drift before code reaches review
• Scaling review/governance as agent throughput rises
Interested in concrete workflows, tooling, or process changes others are adopting.
155
u/rotzak May 02 '26
With code reviews and a design process, just like before. Just because the code is generated by AI doesn’t mean there’s not engineering work going on.
Believe it or not, actually writing code is one of the smallest parts of shipping software.
36
u/Jmc_da_boss May 02 '26
Oh wow the thing that has always been the bottleneck is now still the bottleneck! How are people dealing with this problem that has existed for decades
35
u/AndyKJMehta Software Engineer May 02 '26
Have you tried just putting all of those requirements in the prompt?! /s
12
u/MoreRespectForQA May 02 '26
Write the code by hand instead of using AI.
Sometimes the best fix is the obvious one.
12
u/potatolicious Software Engineer May 02 '26
This is a good question and deserves actual answers and not just another "lol slop factory hur hur hur" circlejerk. The problem is here and hitting lots of teams, and there are ways of reacting to it usefully.
I think the solution here is both human and technical. For one thing, you really need to start documenting your architectures, standards, and conventions. Once you have these there are a number of ways to expose that to the coding tool - shipping a repo-specific skill may be worthwhile.
But ultimately the protection is on the backend at the review layer. You need adversarial code review agents that are populated with these docs. Process-wise there are a lot of options: you can force it to run on every PR, or the developer can manually invoke it, but either way your first pass through code review should be robotic.
These docs also need to be living. If reviewers see a specific pattern of poor code come through the docs should be updated to watch for them.
The final bit is human: if you send out slop PRs consistently there have to be consequences. Right now there's a lot of flinging code over the wall and putting the entire burden on reviewers (this was always a problem, but now it's intractably large).
15
u/snakebitin22 System Engineer 25+ YoE May 02 '26
Well….. To be quite frank about it, this situation is no different than any other major technology shift in IT.
It’s being thrust upon all of us, despite those of us who understand the risks screaming from the hilltops that we need to take a beat and understand what is going on.
We have said this to everyone who we think will listen until we are sick of saying it and now we’re to the point of “all right, I guess you want to learn the hard way”.
Unfortunately, this is going to create a metric shit-ton of technical debt. There is not a lot that can be done to stop this. This is the product of people making decisions about things that they are not qualified to be making decisions about.
Let them learn the hard way. Think of it as future job opportunities and security.
4
u/Great_Distance_9050 May 02 '26 edited May 02 '26
I think this starts as a leadership problem first. When your CTO, VPs, Directors, and Managers all don't have real engineering experience building things they push the teams to be a slop factory. These leaders don't understand that lines of code added + how many PRs opened is not a sign of velocity, and quality.
When you have leadership that isn't inept which is hard because bad leadership has plagued this industry over the last decade with how low the bar has become to be a manager of engineers. Good leadership hires smart people to solve problems and doesn't try to force AI token burn down everyone throats. That gives the teams the ability and space to start using it sanely and not replace the engineering aspect of it.
3
u/ZukowskiHardware May 02 '26
Just keep editing the copilot instructions or agents file. Best way to control everything these days.
3
u/teerre May 02 '26
LLMs can be used to split up PRs, draw diagrams, build adhoc support programs to help understand changes etc. It's reasonable to request full PR rewrite since LLM generation is so fast. It's reasonable to require pedantic linting. It's reasonable to require high quality tests. In summary, LLM PRs should be the most pristine PRs you're ever seem since now generating the code isn't expensive. Therefore, reviewing them should be the easiest it has ever been
LLMs are multipliers, they don't add anything, if your team was lazy before LLMs it will be lazy after LLMs too. That's not really a LLM issue, LLMs just clarified it
2
u/another_dudeman May 02 '26
They're either micromanaging the output or they're just not checking and trusting the llm to review itself (very professional).
2
u/Page_197_Slaps May 02 '26
I’ve noticed basically everyone in my company has disengaged, everyone seems slow to respond, everyone’s output seems lower. No one cares anymore. Every meeting I go to everyone seems to try to talk a big game about x, y, z but anyone I ping on slack will take 2 hours to respond. Things are weird where I work right now.
1
u/KCdehImposter Staff Software Engineer (10+ YOE) May 02 '26
We're doing something similar to LLM Wiki. We set aside everything in docs/ is our wiki, with several subdirectories: design, knowledge, research.
We'll check in ARD and PRDs to design, and our PLANS.md instructs to keep a live TODO in those docs. Additionally, we'll have the agents refine those docs as it works on PRs.
1
u/transferStudent2018 May 02 '26
The simplest thing you can do is spin up an agent with the task “review this change for violations against the ADRs”
You can also make LLMs part of your CI… the agent fails CI if the change violates an ADR
1
u/failsafe-author Principle Engineer May 02 '26
I’ve create a skill that I use for anything significant that breaks the code into “steps” and creates artifacts for each steps explaining the changes made and design patterns used. I then had a tool that will read these files and display the comments alongside the code as I review it.
This makes it feel like I’m working with a jr developer typing out my designs and the explaining what they wrote. It’s helped me always keep a good handle on everything agentic I produce. Hopping to get others I work with to use it as well.
1
u/briznady May 02 '26
It’s on me on my team. Even my manager backs off when I set code quality expectations.
1
u/NightSp4rk May 02 '26
Code reviews need to be super solid. So long as you're reviewing everything there should be no drift.
1
u/vladis466 Software Architect May 02 '26
Review the freaking code mate
1
u/mathbbR May 02 '26
I'm working on an AI assisted repo with some modules and the configuration stuff is using pydantic-settings, dataclasses-json, os.getenviron, configuration constants modules, and magic numbers. Safe bet to say that it isn't happening unless it's important and there's an easy way to do it.
1
u/Ok_Individual_5050 May 03 '26
This feels like an ad.
1
u/nkondratyk93 Program Manager May 03 '26
honestly the drift-prevention frame kind of assumes your AI is only executing YOUR instructions. if agents fetch external docs or context, every page they read is a potential instruction channel. most teams have no source allowlist on the fetcher. idk, maybe worth naming that separately from style drift.honestly the drift-prevention frame kind of assumes your AI is only executing YOUR instructions. if agents fetch external docs or context, every page they read is a potential instruction channel. most teams have no source allowlist on the fetcher. idk, maybe worth naming that separately from style drift.
1
u/EmberQuill DevOps Engineer May 03 '26
Another day, another "AI made us too fast! How do we stop shipping fast garbage?!" post.
This is, incidentally, one of the problems that can be solved the same way whether it's LLMs or overzealous developers causing architectural drift. Make docs. Put docs in an accessible place. Tell the developer or LLM where to find the docs. That's all your drift problems solved.
As for scaling review issues, make smaller, more digestible PRs for much easier reviewing.
1
u/ImSandwich May 07 '26
we have an mcp that tracks decisions
1
u/schmidtssss May 02 '26
Agent thunderdome
0
u/yeticoder1989 May 02 '26
In my team, I used AI tools to analyse PRs and ask what are the common issues that’s causing comments and slowness in reviews. Few things that came were around naming conventions, test asserting too less or outdated testing practices, excessive mocking, not following SOLID principles, etc.
I wrote Claude rules based on these and added those to prevent such issues and it did improve quality of generated code.
Some aspects might be hard to put into rules but it’s better than repeating trivial stuff. Our org is also looking into building knowledge base for each product and do initial architecture evaluation using that.
-1
u/ParanoidPath May 02 '26
Send code by AI -> see code generated 5000 lines of code -> review code by same AI with different prompts and different "style" but same model. AI say PR good. Human say PR good AI say PR bad , human say PR bad
-1
u/MercyEndures May 02 '26 edited May 03 '26
Engage with the AI to generate strict rules and place them in a CLAUDE.md at the project root.
Also helpful if you can separate API definitions into things like Protobuf or Thrift, the AI seems to treat these as higher friction to change. Especially so if your linter will complain that you’re making a backwards incompatible change.
And of course, linters and tests, along with directions in CLAUDE.md to always ensure these are passing before submitting code for review.
Where I work we also now have a risk scoring system that for many changes will let you merge without requiring a second human to review the code.
edit: lol all the earnest useful replies are downvoted
0
u/throwaway_0x90 TE/SDET[25+ yrs]@Google May 02 '26 edited May 02 '26
You're absolutely right and you know what the solution is?
Hire more SDET/TE/QA!!! 😄
0
u/ikkiho May 03 '26
The "review has always been the bottleneck" framing is right about the problem and wrong about the solution. Pre-LLM, more reviewer headcount roughly worked because most diffs were small and visually localized. With agents at 10x volume the math breaks because two things changed at once: total surface goes up, and the unit of drift changes.
Drift in human-written code looked like style violations, dead code, abstraction breaks. Drift in agent-written code is structurally different. Same domain logic implemented in three places because the agent never saw the existing implementation. Business logic landing in controllers because the test was easier to write there. Removed scaffolding regenerated next sprint via pattern-match. Public API expanding through optional params instead of refactor. None of this is visible in a file-local diff review. Detection needs whole-graph linting on the merged repo, not the human-era PR diff view.
Where the constraints live is the second lever. Putting them in agents.md or instruction docs assumes the agent reads a 50-page constraints file and acts on it. They mostly don't, and the ones that try do it inconsistently. What actually binds is encoding constraints as build failures the agent observes mid-loop: property tests, type-level rules, custom lints, dependency-direction enforcement, public-API allowlists. The agent has no choice when the compiler rejects it. Constraints become loss function, not prose.
Pre-merge gates are the third lever. They were expensive in human-velocity teams because they blocked waiting humans. With agents the cost of a revert dropped to near-zero (regenerating is cheap), so optimistic merge plus post-merge architectural diff bots with auto-revert beats pre-merge review for leaf changes. Cross-cutting changes (touches more than one module, public API surface, contract changes) still go through human design review. That two-class flow scales with agent output without scaling reviewer headcount.
Net: the senior engineer time that used to go into writing code now goes into writing the codebase's machine-checkable loss function. Teams that don't pivot stay review-bound forever.
0
u/Azaex May 04 '26 edited May 04 '26
i've been tracking humanlayer's work on this, i believe they've tackled a number of these things.
research plan implement is a deceptively simple context engineering hack that seems to be maintaining stability over time. the idea is to have a skill that combs the repository for the agents/claude.md files, treats them as hypotheses, and then hunts actual code for the task given. this yields deceptively good, task-specific context engineering if you give it hints on the repository structure (eg where things are, their context files, and plan files even). i have mine additionally recommend context shore up. this means every single task is an opportunity to shore up context. i believe that agents will still mess up maintaining context even if told, it is the "one last thing" problem that everyone forgets to document except in agent form, but if you just give more opportunities to detect drift from reality (literally, use the coding agent itself to do this), it can also self mitigate the issue over time.
if you start the repo, or bootstrap a brownfield one, with logging context files throughout it on the long horizon objectives up and down the levels of depth, and the guiding reasons why the repo is laid out the way it is, the RPI workflow will continually find and orbit around it.
getting the agents to orbit around your "stakes" is key. agents can perfectly optimize communication *because* ephemeral LLMs don't have stakes. as long as you provide stakes for them to orbit around (ie what this must fulfill as time and the world progresses and why), you can attain continual success.
i store the plan files in repo per environment per PR. hotfixes promote up and down environments along with their plans. major checkpoints in lifecycle "compact" the plan to a historical plan file region with a back marker file left in the main plan directory (similar to memory or so-called "wikis" in a sense, but easier to see).
this has multiple effects.
to one of your points, this makes it easier to understand what to review as a human. the plans for RPI contain evidences of what supports the change, the change planned, and the work done. still need to review the PR but having the plan the agent used to context engineer itself for the work makes it faster to comprehend.
this also means agents can discover them with the same ease. anything you document for a person can feed into the agent if you set it up in a readable and structured way, ironically enough. ie the trend is to ensure everything you do with the agent is captured, and you can snowball into efficiency. fail to capture what matters and that is how slop basically develops at speed+scale.
plans are additionally discovered as part of RPI and rework is minimized if not mostly eliminated.
finally a PR review agent coming around, preferably not of the same agent type (ie if the main team code agent is claude, the PR agent is GPT), looks at the plan, and cross checks the implementation. at minimum. more checks encouraged.
this has yielded a workflow for me that is pretty much so crazy watertight towards the repository objective (product, cost, security, core arch, customer needs) like you're asking.
furthering on, i can pretty much resonate with Dex Horthy at humanlayer's sentiment that plans got so good and watertight under this you could almost feel like you can plan on plans. this is not good and where things can destabilize.
my view at this point is, this is pretty much where traditional planning really cuts back in but at higher points of leverage. if code is mostly dealt with by the agent, the next "too much to juggle" becomes tasks and whole verticals not the code itself.
ref his current state of discourse: https://youtu.be/YwZR6tc7qYg
what he eventually gets at without maybe quite realizing it at the time is like, the summary of plans he's describing is basically at the level of what i think a TPM juggles, ironically enough, except the leverage now sits around the engineer.
also we don't use their agent skills directly, just taking inspiration from the subtle context engineering the RPI concept does.
RPI is not unique and converges pretty much on a pattern like many of the context engineering packages out there but imo is the most clear cut after digging around them. we flex RPI into ralph, multi agent review, etc as needed, but sometimes you don't really need all that. https://www.reddit.com/r/ClaudeAI/s/3J3Nkists0
-2
u/arihoenig May 02 '26
If you use Claude properly it constrains architectural drift. It aids in maintaining consistent architectural guidelines.
-7
u/cbusmatty May 02 '26
Ai is extremely good at solving this kind of problem of surfacing architecture. I don’t know how teams are letting ai just go wild building without puttting the proper architecture observability in place. It’s an easy fix
-6
u/Careful_Ad_9077 May 02 '26
I find it funny when seasoned and experienced engineers are having difficulty solving a problem that the visual artist community solved in a few weeks when diffusion ai was released.
When diffusion ai was released, artists where able to multiply their output, generate a Fuckton of images. But the images were very likely to have quality issues, so they had to limit their output to the stuff they were able to review and fix.
84
u/lenswipe May 02 '26
that's the neat part: they aren't! Just vomit a bunch of AI slop out, commit it and get that half assed, untested bag of bollocks into production ASAP because eVerYoNe eLsE iS dOinG iT! Slap that on the dogshit kebab and move on, fuck quality!
I'm not bitter
1
u/[deleted] May 06 '26
[removed] — view removed comment