HeadlinesBriefing favicon HeadlinesBriefing.com

Domain-Driven Agents for Legacy Code Refactoring

Hacker News •
×

I've been using LLMs heavily in software engineering for coding and productivity gains. While effective in greenfield projects, quality drops sharply in legacy codebases with heavy dependencies, strong coupling, and tech debt. The model invents inconsistent spellings of concepts, writes adapters where none are needed, or calls through where adapters are required. This stems from confusion and missing shared language in the codebase.

Brownfield projects have two layers: technical depth and confusion beneath. The model guesses wrong because the system doesn't answer key questions. Readiness can be built incrementally. At software engineering's beginning, tech debt was the only concern. Teams deliver fast, paying tradeoffs. The usual answer is spending 10-20% of budget on cleanups, but deciding what to change remains expensive while implementation became cheap with LLMs.

I split authorship into strategic and tactical work. Strategic involves reading the system, deciding what needs to change, and ensuring alignment. Tactical carries decisions into files. Strategic work requires deep system understanding; tactical work is now cost-effective. I create GitHub issues analyzing codebases generically, then address them with AI systems using skills and sub-agents. Skills are markdown procedures ensuring consistent execution.