Your Architecture Is Why Your Coding Agent Keeps Writing Bad Code

https://hackernoon.imgix.net/images/cL7T6rbbFzdLtIotXI5ReI1Y6Ex2-nn8390p.jpeg

A few months ago I realized that as the code and modules inside the structure we’d built kept growing, it was starting to become a problem, and developing with AI was getting really hard.

I’d ask Cursor or Claude Code to make a very simple change to a frontend module. At first glance it looked great. Then I’d open the PR and inspect it: it had done state management differently from the rest of the app, it had written copies of helper functions that already existed, it had pulled some random third-party package we never use into the project, and it had completely ignored the configs we’d added for design.

At first I thought it was the LLM’s fault, because everyone around me was complaining about this too — model A is terrible, model B is too expensive, that kind of thing. I looked for the problem in the small...

Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE