<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/your-ai-written-backend-works-great-until-you-need-to-change-something-te6v3q7yn" -->

---
title: Your AI Written Backend Works Great… Until You Need to...
description: AI-generated backends tend to become tightly coupled over time, making changes risky once a codebase grows past a few months old. A ports-and-adapters...
canonical: https://daily.dev/posts/your-ai-written-backend-works-great-until-you-need-to-change-something-te6v3q7yn
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Your AI Written Backend Works Great… Until You Need to Change Something | daily.dev
og:description: AI-generated backends tend to become tightly coupled over time, making changes risky once a codebase grows past a few months old. A ports-and-adapters...
og:url: https://daily.dev/posts/your-ai-written-backend-works-great-until-you-need-to-change-something-te6v3q7yn
og:image: https://api.daily.dev/og/posts/te6v3Q7yn.png
og:image:alt: Your AI Written Backend Works Great… Until You Need to Change Something
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Your AI Written Backend Works Great… Until You Need to Change Something

**[WebCraft](https://daily.dev/sources/webcraft)** · [@saadh393](https://daily.dev/saadh393) · 1 min read · 82 upvotes · 11 comments

## Summary

AI-generated backends tend to become tightly coupled over time, making changes risky once a codebase grows past a few months old. A ports-and-adapters (hexagonal) style architecture pattern is presented through two practical scenarios as a way to keep AI-assisted codebases modular and easier to change, framed without academic theory.

## Content

**AI can build features fast.** But after 6 months, changing one thing can break the whole backend.

That’s the scary part of most AI-generated codebases. Everything becomes tightly connected without you even noticing it.

Recently I was exploring a very interesting architecture pattern that helps solve this problem. I explained it with 2 very real scenarios in a simple way without academic theory.

If you are building products with AI, this architectural thinking is probably more important than ever now.

[🐛 https://saadh393.github.io/blog/adapter-port-architecture-two-cases](https://saadh393.github.io/blog/adapter-port-architecture-two-cases)

## Community discussion

Top comments from developers on daily.dev.

**@apperside** · 4 upvotes

> I think this concept can be expanded generically to every kind of software: people are blindly delegating every aspect of software development to AI, but blindly trusting architecture decision leads to high probable disaster. I think that AI can be blindly trusted only during execution phase of a carefully crafted and reviewed architectural plan. Developing software nowadays is not about writing code anymore, but being able to plan a good architecture and save time by delegating execution to AI

**@pdfopsdev** · 4 upvotes

> hexagonal helps but the real fix is making the boundary itself dumb and typed. ports without a schema at the edge just relocate the coupling, learned that after an AI-generated adapter silently reshaped a field and nothing downstream broke until prod.

**@xynorash** · 2 upvotes

> This is why code reviews are more and more important. Generating code with AI is good but controlling the generated code to be able to handle future changes and still have the "flexible" part is critical for the long run.

**@rsosenke** · 1 upvotes

> Good post. The point that stuck with me: design the port before writing the first adapter. Write the adapter first and the port ends up shaped like that provider’s API, not like what your business logic actually wants to say. Small detail, but it’s the difference between a real port and a wrapper with extra steps.

**@agustinbarrientos** · 0 upvotes

> Architecture tests should reject adapter imports inside business logic. One fixture should prove the rule catches a generated shortcut around the service layer.

## Similar posts on daily.dev

- [A developer’s guide to designing AI-ready frontend architecture](https://daily.dev/posts/a-developer-s-guide-to-designing-ai-ready-frontend-architecture-iv0cryopm) · LogRocket · 6 upvotes · 0 comments
- [The architectural trade-offs of AI code generation](https://daily.dev/posts/the-architectural-trade-offs-of-ai-code-generation-qmcfovlie) · RUBYLAND · 1 upvotes · 0 comments
- [Design Patterns Were Always Second Priority. AI Just Removed the Excuse](https://daily.dev/posts/design-patterns-were-always-second-priority-ai-just-removed-the-excuse-6v0y9objf) · Medium · 0 upvotes · 0 comments
- [The Black Box Problem: Why AI-Generated Code Stops Being Maintainable](https://daily.dev/posts/the-black-box-problem-why-ai-generated-code-stops-being-maintainable-7ovjc2yg0) · Towards Data Science · 189 upvotes · 15 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#backend](https://daily.dev/tags/backend), [#ai-coding](https://daily.dev/tags/ai-coding)

[View this post on daily.dev](https://daily.dev/posts/your-ai-written-backend-works-great-until-you-need-to-change-something-te6v3q7yn)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/your-ai-written-backend-works-great-until-you-need-to-change-something-te6v3q7yn","headline":"Your AI Written Backend Works Great… Until You Need to Change Something","text":"AI-generated backends tend to become tightly coupled over time, making changes risky once a codebase grows past a few months old. A ports-and-adapters (hexagonal) style architecture pattern is presented through two practical scenarios as a way to keep AI-assisted codebases modular and easier to change, framed without academic theory.","url":"https://daily.dev/posts/your-ai-written-backend-works-great-until-you-need-to-change-something-te6v3q7yn","datePublished":"2026-08-24T11:15:37.177Z","dateModified":"2026-09-13T21:25:47.708Z","author":{"@type":"Person","name":"Saad Hasan","url":"https://daily.dev/saadh393","image":"https://avatars.githubusercontent.com/u/22261152?v=4","description":"I help fast-growing tech teams build scalable, reliable JavaScript infrastructures that grows.","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":2350}},"image":"https://media.daily.dev/image/upload/s--_3V5S07J--/f_auto/v1780164019/posts/LxyOyjBwc?_a=BAMAMiWQ0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":82},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":11}],"comment":[{"@type":"Comment","text":"I think this concept can be expanded generically to every kind of software: people are blindly delegating every aspect of software development to AI, but blindly trusting architecture decision leads to high probable disaster. I think that AI can be blindly trusted only during execution phase of a carefully crafted and reviewed architectural plan. Developing software nowadays is not about writing code anymore, but being able to plan a good architecture and save time by delegating execution to AI","datePublished":"2026-08-25T03:23:01.648Z","url":"https://daily.dev/posts/te6v3Q7yn#c-alkX0RWPh","author":{"@type":"Person","name":"Apperside","url":"https://daily.dev/apperside","image":"https://avatars.githubusercontent.com/u/5955338?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4}},{"@type":"Comment","text":"hexagonal helps but the real fix is making the boundary itself dumb and typed. ports without a schema at the edge just relocate the coupling, learned that after an AI-generated adapter silently reshaped a field and nothing downstream broke until prod.","datePublished":"2026-08-24T18:03:07.415Z","url":"https://daily.dev/posts/te6v3Q7yn#c-OCaPLc49L","author":{"@type":"Person","name":"PDFops","url":"https://daily.dev/pdfopsdev","image":"https://media.daily.dev/image/upload/s---8isRBKc--/f_auto/v1782922291/avatars/avatar_orjMeK8QKaaVZwGq7ScPz?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4}},{"@type":"Comment","text":"This is why code reviews are more and more important. Generating code with AI is good but controlling the generated code to be able to handle future changes and still have the “flexible” part is critical for the long run.","datePublished":"2026-08-25T05:34:03.238Z","url":"https://daily.dev/posts/te6v3Q7yn#c-fyINI8o4Q","author":{"@type":"Person","name":"Nash Tefison","url":"https://daily.dev/xynorash","image":"https://media.daily.dev/image/upload/s--LPVE6vXx--/f_auto/v1787551373/avatars/avatar_ujWPdmiVVp2MF1Mf4u33v?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"Good post. The point that stuck with me: design the port before writing the first adapter. Write the adapter first and the port ends up shaped like that provider’s API, not like what your business logic actually wants to say. Small detail, but it’s the difference between a real port and a wrapper with extra steps.","datePublished":"2026-08-25T13:17:11.298Z","url":"https://daily.dev/posts/te6v3Q7yn#c-qxW25mfhv","author":{"@type":"Person","name":"Ruben Sosenke","url":"https://daily.dev/rsosenke","image":"https://lh3.googleusercontent.com/a/AAcHTteqeUzx4dcB6stASG3Hz3GVg2fzorKICU7F3ZLkzXtpEZPC=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"Architecture tests should reject adapter imports inside business logic. One fixture should prove the rule catches a generated shortcut around the service layer.","datePublished":"2026-08-26T01:23:57.210Z","url":"https://daily.dev/posts/te6v3Q7yn#c-p2y9AYJq2","author":{"@type":"Person","name":"Agustin Barrientos","url":"https://daily.dev/agustinbarrientos","image":"https://media.daily.dev/image/upload/s--5ayxQnqn--/f_auto/v1788281802/avatars/avatar_wQYYVe5Tbj0NJ7C7qPoa8?_a=BAMAMicg0"}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/webcraft","name":"WebCraft"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"WebCraft","item":"https://daily.dev/squads/webcraft"},{"@type":"ListItem","position":3,"name":"Your AI Written Backend Works Great… Until You Need to Change Something"}]}
```

