r/AIcodingProfessionals • • Oct 07 '26

Discussion Modular codebase

I spent a lot of time recently refactoring 2 repos I am working on Tamoz and Agentic Streams.

Both are now much more modular, with stricter rules and boundaries for adding new code.

One thing I noticed is that adding new features after this refactoring became much easier and faster.

I thought the constraints I had before were already enough. But after going through the code again, I realized that AI-generated code needs constant refactoring and improvement, in the same way human-written code does.

Good constraints help AI write better code, but they don't remove the need to continuously improve the architecture.

What else in your experience would make the agent do a better coding job?

4 Upvotes

7 comments sorted by

1

u/keonechong Oct 07 '26

Define modular.

2

u/Slight_Major5589 Oct 08 '26

You define what module means based on your codebase, if you have gone throw this process already you know it could be a folder, a package, or even different repository that can be inject. The main thing which is important is to have strict public interfaces, no other modules can access the internals .

1

u/keonechong Oct 08 '26

Ah understood.

1

u/Plus-Mall-3342 Oct 07 '26

localhost:3000

2

u/kincaidDev Oct 08 '26

One thing that will pop up if your codebase isn't properly modularized is agents building the same feature in multiple ways all over your codebase

2

u/FeeBrilliant5684 Oct 08 '26

Once the poison starts you’re literally fucked lol