DEV Community

Cover image for With AI, staying in control of your architecture
ArmelDev
ArmelDev

Posted on Originally published at armeldev.xyz

With AI, staying in control of your architecture

I don't let AI decide how my projects are structured. I define it, and the AI follows. Well, most of the time.

Sometimes it steps outside the frame: ignoring a principle, working around a design pattern, adding a layer nobody asked for. It's quickly fixed. But only because I know exactly what I expected.

And that, to me, is where real control lies.

Architecture is decided before the first prompt

A developer designs the project architecture before turning to AI

Before I open an assistant, I already know how the project is organized: where the business logic lives, how the layers communicate, which patterns I use and why.

AI doesn't have that big picture. It answers what you show it: a file, a function, a question. If you don't give it the frame, it invents one. And that improvised frame changes from one answer to the next.

Architecture can't be delegated. It has to be passed on.

AI follows… until it improvises

A robotic arm places a block outside the planned structure

Even with clear instructions, AI sometimes drifts. It puts business logic in a controller instead of a service. It creates a useless abstraction. It adds a dependency for something three lines would have covered.

Taken one by one, each of these deviations looks harmless. The code works. But as they pile up, they turn a coherent project into a patchwork that is hard to maintain.

You can only fix quickly what you have clearly defined

Spotting a deviation requires a reference. If I know a given process must go through a service, I see immediately when the AI strays from it. Without that marker, the same code would look perfectly acceptable.

That's why the rules must exist before generation: written conventions, a deliberate folder structure, named principles. The more explicit the frame, the faster the correction.

How fast you correct depends on how clear your frame is.

You are still the architect

The developer holds the blueprint while the AI builds

AI speeds up writing code. It doesn't carry responsibility for its coherence.

Reviewing, turning down a suggestion, simplifying what got overcomplicated, documenting decisions so they outlive the project: that's the work that keeps a codebase healthy over time.

AI is an excellent builder. But the blueprint of the house stays in our hands.


So, are you the one guiding the AI, or is it slowly drawing your architecture for you?

Top comments (0)