⚠️ Malware / Trojaner / VirenAndroid-Malware blockiert Google Play per VPN-Trick(24.08.2026 um 13:00 Uhr)
🪟 Windows TippsWindows 11: Falsche Defender-Warnungen und kaputte Mauszeiger(31.08.2026 um 11:58 Uhr)
🕵️ SicherheitslückenDropbox-Hack: Tausende Konten kompromittiert(02.09.2026 um 11:02 Uhr)
⚠️ Malware / Trojaner / VirenAtombomben-Frage trickst KI-Malware-Scanner aus(02.09.2026 um 12:46 Uhr)
🪟 Windows TippsMehr Sicherheit in Windows 11(03.09.2026 um 11:51 Uhr)
⚠️ Malware / Trojaner / VirenNeue Android-Malware schreit Sie an, wenn Sie nicht zahlen(11.09.2026 um 10:33 Uhr)
🐧 Linux TippsMehrere Probleme in freerdp2 (Fedora)(11.09.2026 um 23:24 Uhr)
🐧 Linux TippsMehrere Probleme in kamailio (Debian)(11.09.2026 um 23:28 Uhr)
🐧 Linux TippsAusführen beliebiger Kommandos in dokuwiki (Fedora)(11.09.2026 um 23:28 Uhr)
🐧 Linux TippsAusführen beliebiger Kommandos in python-asteval (Fedora)(11.09.2026 um 23:28 Uhr)
⚠️ Malware / Trojaner / VirenAndroid-Malware blockiert Google Play per VPN-Trick(24.08.2026 um 13:00 Uhr)
🪟 Windows TippsWindows 11: Falsche Defender-Warnungen und kaputte Mauszeiger(31.08.2026 um 11:58 Uhr)
🕵️ SicherheitslückenDropbox-Hack: Tausende Konten kompromittiert(02.09.2026 um 11:02 Uhr)
⚠️ Malware / Trojaner / VirenAtombomben-Frage trickst KI-Malware-Scanner aus(02.09.2026 um 12:46 Uhr)
🪟 Windows TippsMehr Sicherheit in Windows 11(03.09.2026 um 11:51 Uhr)
⚠️ Malware / Trojaner / VirenNeue Android-Malware schreit Sie an, wenn Sie nicht zahlen(11.09.2026 um 10:33 Uhr)
🐧 Linux TippsMehrere Probleme in freerdp2 (Fedora)(11.09.2026 um 23:24 Uhr)
🐧 Linux TippsMehrere Probleme in kamailio (Debian)(11.09.2026 um 23:28 Uhr)
🐧 Linux TippsAusführen beliebiger Kommandos in dokuwiki (Fedora)(11.09.2026 um 23:28 Uhr)
🐧 Linux TippsAusführen beliebiger Kommandos in python-asteval (Fedora)(11.09.2026 um 23:28 Uhr)

🔧 Programmierung 🕛 vor 6 Monaten 14 Min Lesezeit
0

An LLM Broke My Architecture in One Generation. I Made That a Build Error

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

How custom detekt rules, specialized AI agents, and specification-driven development keep Clean Architecture intact — even when an LLM writes the code.



Part 4 — | spent 2,000 words establishing.



LLMs are fast. They're also statistically inclined to produce the most common pattern they've seen — and in the Kotlin ecosystem, that's Spring annotations on everything, exceptions for error handling, and no concept of layer boundaries. Your architecture documentation might say "no Spring in application layer." The LLM has seen 100,000 Spring Boot examples that do exactly the opposite.



The three previous articles in this series built an architecture where:





  • : Domain and application tests run in milliseconds with no Spring context


  • , every fallible operation returns Either<XxxError, T>. No exceptions. The return type is the complete error specification.



    LLMs don't naturally write this way. They reach for throw IllegalArgumentException("invalid input") because that's what most Kotlin code does.




    CODE
    class NoThrowOutsidePresentationRule(config: Config) : Rule(config, "...") {

    private val forbiddenLayers = setOf("domain", "application", "infrastructure")

    override fun visitThrowExpression(expression: KtThrowExpression) {
    super.visitThrowExpression(expression)

    val file = expression.containingKtFile
    if (file.virtualFilePath.contains("/test/")) return

    val packageName = file.packageFqName.asString()
    val layer = packageName.removePrefix("$projectBase.").substringBefore(".")

    if (layer in forbiddenLayers) {
    report(Finding(
    Entity.from(expression),
    "throw detected in '$packageName'. Use Either<XxxError, T> instead.",
    ))
    }
    }
    }






    Three layers are covered: domain, application, and infrastructure. The only layer where throw is permitted is presentation — because Spring's exception handler infrastructure (ResponseStatusException, GraphQLException) requires it.



    Together, these two rules turn architecture guidelines into compiler-level enforcement. The LLM writes code, the Kotlin compiler checks types, and detekt checks architecture. Violations are build errors, not code review comments.









    From documentation to specification: SDD for LLMs



    — automated. Tests are written before implementation. Implementation is written to pass the tests. The architecture rules are checked after every cycle. The orchestrator doesn't trust the implementer — it verifies.









    Hooks: the last line of defense



    Claude Code supports hooks — shell commands that trigger on specific events. Two hooks close the loop between the LLM and the architecture rules:




    CODE
    {
    "hooks": {
    "PostToolUse": [
    {
    "matcher": "Write|Edit",
    "hooks": [{
    "type": "command",
    "command": "cd $CLAUDE_PROJECT_DIR && ./gradlew ktlintFormat 2>&1 | tail -60",
    "timeout": 30
    }]
    }
    ],
    "Stop": [
    {
    "hooks": [{
    "type": "command",
    "command": "cd $CLAUDE_PROJECT_DIR && ./gradlew detekt 2>&1 | tail -60",
    "timeout": 120
    }]
    }
    ]
    }
    }






    PostToolUse on Write/Edit: Every time the LLM creates or modifies a file, ktlint auto-formats it. No style drift. No formatting discussions. The code matches the project style before the LLM's next turn.



    Stop: When the LLM finishes its work, detekt runs automatically. If the custom rules detect a throw in the domain layer or a Spring import in the application layer, the violation is surfaced immediately. The LLM sees the failure output and can self-correct.



    This creates a feedback loop: write → auto-format → continue → finish → architecture check → fix if violated. The LLM operates within the enforcement boundary in real time.



    In : The structure — 5 Gradle modules, Arrow-kt Either, value classes, explicit DI. How to build it.



    : The proof — swapped the database client, added GraphQL. Domain and application: zero files changed. How to prove the architecture delivers on its promise.



    Part 4: The automation — custom detekt rules, specialized agents, SDD pipeline. How to let an LLM build on the architecture without breaking it.



    The architecture didn't change between parts. The same module boundaries, the same Either error handling, the same sealed interface hierarchies. What changed was who writes the code — from a human following conventions, to an LLM constrained by static analysis, agent prompts, and automated verification.



    Clean Architecture was designed to make software maintainable by humans. It turns out the same constraints — explicit dependencies, typed errors, pure layers — are exactly what LLMs need to write code safely. The architecture didn't change. The developer did.



    The full source is on GitHub: |

    Vollständiger Original-Bericht
    Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
    ↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Stealing AI Reasoning Traces
1 Quelle
AIs as Modern Genies
1 Quelle
Bitcoin: KI-Hacker räumen Millionen ab! Wird Künstliche Intelligenz zum Problem? - ftd.de
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten An LLM Broke My Architecture in One Generation. I Made That a Build Error

Thematisch verwandte Begriffe: Broke, Architecture, Generation, Made · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...