The Architecture Sparring Partner
I thought I was prepared
Section titled “I thought I was prepared”When I joined a new project in spring 2025, I’d been warned. The application had grown over the years, and every change took the developers a long time. My job was to find out why and help them pick up the pace.
I’ve been programming since 1996. I started out in startups and had already seen some memorable software architectures, so I went in fairly confident. Even in a difficult system, there’s usually somewhere to start. I spent a while looking for that place on this project.
Over roughly 13 years, the application had grown into a Big Ball of Mud. The domain boundaries barely held up in the code. Technical responsibilities ran through every layer, and homegrown mechanisms had taken the place of basic framework features. There were no automated tests and no useful technical documentation.
If you’d asked me which principles of software engineering the system violated, my shortest answer would probably have been “yes.”
I’ve since written a series about the structural and organizational problems of such systems, Big Ball of Mud – Architecture Under Real-World Conditions. What interests me here is how that project changed the way I worked with AI.
You have to start somewhere
Section titled “You have to start somewhere”When I’m getting to know an application, I like to start with the login. It usually gives me a sense of how the application is put together, how users find their way around, and which technical responsibilities come into play as they enter. From there I can usually follow a few promising threads.
Here the frontend made a request, and the backend sent back a route among other things. A shell application used that route to decide which of the applications beneath it to open. My first attempt to understand the frontend had already taken me beyond its boundaries. I scaled back my ambitions and asked a simpler question. How did the application handle the response to a login attempt?
Four hours and about ten layers of abstraction later, I’d forgotten what I was looking for.
Another investigation convinced me this was more than a bad place to start. A Korean lead developer had joined the project with me. I’d mentored and trained her for six or seven years. She was an exceptionally good developer with a knack for making sense of complicated systems, and I trusted her judgment on technical questions like these.
She’d looked into the application’s proprietary encryption and showed me what she’d found in about ten pages of diagrams. Watching her, I felt as though I were watching a Korean pro gamer. She moved from diagram to diagram at a breathtaking pace, following dependencies and explaining how the pieces fit. She clearly understood this part of the system. At some point I simply couldn’t keep up.
While I tried to follow her explanation, one question kept coming back to me. Is software even allowed to be this complicated? We were still talking about a login and how to handle encrypted data. We hadn’t come close to what the application actually did for its users.
Those two experiences left me with a list of things I knew were wrong. After nearly three decades of building software, I still couldn’t turn that list into a place to start modernizing. I needed a way to investigate the system and someone to work it out with.
What should I do?
Section titled “What should I do?”At the start of the project, we’d been given Windsurf, an AI-assisted development environment with models from Anthropic. The company told us the legal requirements for using it had been taken care of. Nobody had shown us how to work it into our development process. There was no training or plan for that. The instructions amounted to “go play with it.”
That worked for me. Playing is one of my core competencies.
Up to that point, I’d mostly told AI what I wanted it to do. As I described in the previous chapter, I made the technical decisions myself and asked for help turning them into instructions someone else could follow. Now I didn’t even know what a useful assignment would look like.
So I asked a fairly open question. What should I do?
I needed to understand the system before I could make a decision about its future architecture. The conversation with AI began with the audit itself. Which problems could we identify, how widespread were they, and where did they affect one another?
We chose seven or eight dimensions of software quality, including maintainability, code quality, architecture, security, documentation, and DevOps. For each, we worked out a scale from one to ten. A one meant a fundamental failure in that area, and a ten meant an example you could put in a textbook. These were informal scales. Their purpose was to settle what we would look for in each area before we started looking.
I also wanted to see what would turn up beyond the problems my experience had already led me to suspect. I asked the AI to be methodical, be candid, and feel free to surprise me with findings outside my specialty. That freedom came with one condition. It had to show the evidence for what it said.
Show me the evidence
Section titled “Show me the evidence”One of my first investigations dealt with dependencies in the Angular application. The first components and services I opened relied on an unusually large number of other parts of the system. I wanted to know whether I’d happened upon a few extreme cases or seen something characteristic of the architecture.
I asked the AI to count the injected dependencies per Angular component and service, calculate the average, and identify outliers in both directions. In that audit I found an average of more than 25 injected dependencies per component or service.
With dependency injection, Angular supplies a component or service with the objects it needs, such as a service that sends HTTP requests. The component or service doesn’t have to create those objects itself. A high count alone told me little about whether the connections were justified. It gave me a concrete place to ask which responsibilities were tied together and why.
That kind of evidence mattered when people disagreed about the code. In one conversation about outdated libraries, I was told Bootstrap 3.3.6 was still in the project but had effectively fallen out of use. With AI’s help, I’d already found around 5,000 direct uses of Bootstrap CSS classes in the source. I could also point to uses of related UI components and other outdated dependencies. That answered the question of whether the library was still in use. Assessing the security risk was a separate investigation.
The distinction helped when I looked at asynchronous code. I repeatedly saw imperative, Promise-based operations inside reactive flows. Under certain conditions, operations can overlap and the outcome can depend on which runs first. That’s a race condition. At the time we classified more than 200 cases that way.
An async callback in an Observable was a reason to look more closely. To substantiate a finding, I wanted to know what could actually run concurrently, under what conditions, and how the ordering changed the application’s behavior. When the source left the outcome open, I needed reproducible evidence from an actual run.
What impressed me was how much ground I could cover. I used my experience to decide where to look, then used AI to investigate those patterns systematically across the repository. I could go into an architecture discussion with specific locations in the code.
The first complete tool I built with AI
Section titled “The first complete tool I built with AI”As the results accumulated, I had to find a way to communicate them. A long list of dependencies or a handful of code examples only went so far in showing how much of the application was tied together.
I’d already asked AI to extract the dependencies from the source code, so I asked it to visualize them with D3, a JavaScript library for visualizing data in the browser. I got a runnable script that started a local Python web server and displayed the dependency structure. It worked remarkably well. This was the first time I’d had AI build a complete tool I could use in my work.

Until then, AI had mostly helped with tasks I already knew how to do. Now I could have it build a tool for a specific investigation. That changed which questions I could reasonably ask.
A method for the investigation
Section titled “A method for the investigation”The same approach can help make sense of other existing systems. I start with the decision the audit should inform and work out what evidence I’ll need to make it. The sequence gives me a place to start. When the evidence is insufficient or a hypothesis fails, I go back to the method and criteria.
| Step | What to do |
|---|---|
| Define the investigation goal | Identify the decisions the analysis should inform and the problems it should explain. |
| Choose quality dimensions | Consider maintainability, architecture, security, testability, or operability. |
| Set assessment criteria | Agree on what a good or bad result would look like in each dimension before investigating. |
| Design investigation methods | Identify what can be measured and which relationships can be investigated in the code. |
| Gather evidence | Collect specific code locations, dependencies, statistics, reproducible analyses, and runtime tests where needed. |
| Test hypotheses | Challenge claims, seek counterexamples, and distinguish observations from interpretations. |
| Evaluate options | Examine possible actions, prerequisites, risks, and organizational constraints. |
AI can play a different role at each step. It can help design the investigation, build a tool, examine a lot of code, or suggest another explanation for a finding. For reproducible measurements, I prefer a tool whose work I can inspect. A language model can help write a script that counts dependencies. I want the numbers from running the script. And a rating of two out of ten means very little on its own. I want to see the findings, the criteria, and whether the findings justify the rating.
By then I had a much clearer picture of what was wrong. It was time to work out what to do about it.
Prove me wrong
Section titled “Prove me wrong”I sometimes like to put forward a slightly provocative hypothesis and see whether it holds up. The audits gave me plenty of opportunities for that.
One hypothesis concerned our ability to upgrade Angular. As I remember it, the project was still moving from Angular 15 to 17, and the framework itself had moved well beyond that. Given what I knew of the Angular roadmap and what the audit had found about our use of private interfaces, homegrown infrastructure, and workarounds, I suspected later upgrades would get harder. I was concerned we could reach a point where updating the framework would take more effort than we could reasonably afford.
My hypothesis was that we were creating our own framework lock-in. My instruction to the AI was “Prove me wrong.”
I already had arguments for my hypothesis. I wanted to find out which assumptions might be wrong, what else could explain the findings, and whether a realistic upgrade path still existed. That changed the conversation. I was beginning to use AI to discuss what the findings meant and look for arguments against my own position. It became particularly useful once we started talking about how to modernize the system.
From analysis to strategy
Section titled “From analysis to strategy”I already knew the Strangler Fig pattern. The idea is to build new parts alongside the old system and let them take over its responsibilities gradually.
It looked promising for our project. I still wanted to see how it compared with our other options, so I used AI to work through the prerequisites, consequences, and architecture principles of the strategies we could consider. I came away with the same choice. I had better grounds for making it. I knew many of the concepts going in, but working through the models behind them and weighing their implications for our system gave me more confidence in the decision.
Strangler Fig gave us a way to replace the application in stages. For the boundaries of the new parts, I considered Self-Contained Systems, or SCS. A self-contained system would handle a distinct domain responsibility as an independent application with its own UI, business logic, and data storage. We could build new capabilities outside the old architecture and eventually take existing responsibilities out of it. The question was whether our system could support that approach.
What the existing system allowed
Section titled “What the existing system allowed”That brought me back to the proprietary encryption I’d encountered at the beginning. It reached all the way into the UI. Under the conditions at the time, we had no suitable way to integrate at the backend. The existing frontend would have had to pass data from the old system to the new one, preserving exactly the sort of dependency we were trying to remove.
That gave us a prerequisite for using SCS in this particular system. A strategic overhaul of the backend and the security design was already planned. With that prospect, it still made sense to consider building independent systems alongside the application. The audit and our comparison of strategies had given us a possible way forward. Taking it depended on decisions beyond the technical plan.
A technical plan is still a proposal
Section titled “A technical plan is still a proposal”In the end, I saw the main obstacles to modernization as more social and organizational than technical or economic. We had investigated the problems, found possible approaches, and identified the prerequisites for an incremental modernization. People continued to defend existing decisions even when we could show specific problems those decisions had caused.
By then the merits of a technical argument were only part of the picture. Years of established responsibilities, convictions, and internal power relationships shaped what could change. Questioning an architectural decision could also call earlier decisions and established responsibilities into question. An audit could document the technical costs. It could do little to resolve that conflict by itself.
I saw a precedent in the earlier migration from AngularJS to Angular. Developers accustomed to working with Promises had to learn a different, reactive programming model. As far as I knew, they had been given too little time and support for that. They carried familiar patterns into the new technology and devised workarounds when those patterns didn’t fit. Over time, the workarounds spread through the system.
Changing the application had become hard, and the main response was to ask developers to deliver faster. After the lead developer left the company, I was asked to move the new architecture forward with junior developers. They needed time, sustained technical guidance, and chances to build the skills for the work. Instead, I saw the same organizational pattern that, in my view, had already contributed to the Big Ball of Mud.
As complexity grew, development slowed. The pressure to deliver faster left people less time to address the reasons they were slow. The organization reproduced the very conditions it wanted to escape. To me, it looked like a self-fulfilling prophecy. The application stayed in operation, and the organization kept in place a way of working that was hurting it. In the Big Ball of Mud series I describe how such conditions become stable. Stable Failure is a fitting name for this case.
Looking back, I see a parallel with the introduction of AI without training or a method for using it. Giving a team a tool is relatively easy. Giving it time and support to learn to use the tool well is a different job.
I wanted to break that cycle. I still think we’d have had a realistic chance with the right resources, skill development, and an organizational mandate. We never got to find out. Working with AI had expanded what I could do technically and analytically. My room to act within the organization had barely changed. AI could help me understand the system, check arguments, and work out a possible way forward. The mandate and the willingness to go that way together had to come from the organization. I’d say the same about more capable models today.
When the architect gets it wrong
Section titled “When the architect gets it wrong”As the modernization stalled, I was changing how I used AI. I don’t remember quite when I began asking it to disagree with me. I do remember getting tired of the friendly affirmation. In strategic Domain-Driven Design, for instance, I was working through questions about domain boundaries, responsibilities, and dependencies. “Yes, you did a great job” wasn’t much use.
When you keep running into the same troublesome patterns and have to defend using established engineering principles, you eventually start doubting your own judgment. Maybe my ideas really were too academic. Maybe I was missing something fundamental.
The conversation gave me a chance to test my convictions again against documentation, architecture principles, and arguments I could examine. Many of my ideas held up, and I was beginning to trust my judgment a little more.
Then came httpResource.
This Angular API brings HTTP requests into the framework’s reactive programming model. I’d passed the resource through my architecture layers and accessed its properties directly in the template. I was convinced I could defend the approach. The AI disagreed.
I asked it to explain. It pointed to the Angular documentation, which describes httpResource as a reactive abstraction over the HTTP client, and connected that role with the principles of my own architecture. By passing the resource through the layers, I’d taken a detail of the application’s communication with the backend all the way into the presentation layer. That violated the division of domain and technical responsibilities I’d chosen.
The documentation describes what the API does. My own architecture determined where the resource belonged in my application. The very rules I regularly explained to other developers made the case against my implementation.
I’d asked for someone who could give me a good reason to disagree with me. I’d found one. It was less pleasant than I’d imagined.
I used to suggest that other developers take another look at a decision now and then. A different perspective is often enough. You find out how hard it can be when the decision is yours. In this case, the AI helped me spot the contradiction in my argument and see what it meant for the presentation layer.
I want a sparring partner to help me see weaknesses in my assumptions, risks I’ve underestimated, and perspectives I’ve overlooked. After that project, it would have been easy to use AI to defend my architecture ideas against everyone else. I’d have ended up with a very eloquent amplifier for my own convictions.
The value of an objection depends on the reasoning behind it. I have to check the evidence myself and change my decision when the argument holds up. That applies to agreement, too. Since the httpResource discussion, I’ve known that this kind of collaboration can cost you the occasional admission that you got something wrong. That’s still considerably cheaper than living with a bad architecture decision for years.
Over those months, even the tone of the conversations seemed to change. I have a dry and occasionally rather mean sense of humor. Some of the answers picked up the tone I’d brought to the conversation. A few comments on the audit findings were things I could have written myself.
Looking back, I couldn’t say whether I taught it more about software architecture or about cynicism.
By then I expected something quite different from AI than I had a year earlier. Besides getting help expressing a thought, I could use it to develop that thought and see how it stood up. I could still save time, and I could think more thoroughly about my decisions.
A defeat that broadened my horizons
Section titled “A defeat that broadened my horizons”I still think of this project as my biggest professional defeat. With all the analysis, evidence, and strategy work, I couldn’t get the transformation under way. Yet few projects have done as much to change how I work with AI.
My experience alone hadn’t given me a way into the system. With AI I learned to design investigations, test hypotheses, and prepare architecture decisions more thoroughly. That was the part of the work I could take with me.
It also changed what I thought I could do outside the project. If I could find a way into a system beyond the limits of my experience, what else could I get to grips with that way? I began exploring more topics outside my specialty. I could get my bearings, understand how things fit together, and build up what I needed to know. I could also delegate work where I lacked experience or enthusiasm.
Configuration files, for example, have never been among my great passions.
At the start of 2025, I’d have described myself primarily as a frontend architect. As I write this in late 2026, I run a platform on my own server, with central authentication, databases, messaging, monitoring, and automated development and delivery processes. A few years earlier, I wouldn’t have taken on much of that as a personal project. I was interested. The amount I’d have had to learn and implement felt too large.
I still have limits. I have to learn, judge the results, and take responsibility for what I decide. But I no longer felt that what I already knew how to do had to dictate which ideas I could pursue. My options widened, and so did my curiosity.
While I was still working through the problems of an architecture that had grown over many years, I began to wonder what I could build with AI if I got to design the architecture from the start.
I had an idea. Fortunately, I didn’t have to write all the configuration files myself.