AI-generated code can pass every check and still be architecturally wrong. It compiles, the tests are green, the feature works, a human approves it, and it still shouldn't be merged. The agent did exactly what the ticket said. It just never questioned where the logic should live.
This is the problem Fanis Prodromou, a Google Developer Expert in Angular, broke down in our webinar "AI Agents vs. Architecture: How to Stay in Control When Rules Aren't Enough", which I hosted as CTO of House of Angular.
I've seen this problem in many client projects. To help you avoid it, I'm sharing the most important takeaways from the webinar here, including:
- Why AI didn't create this problem, but removed the brake
- What agents catch and what they miss
- A live example: a business rule hidden in a UI component that the linter, tests, and AI review all missed
- 3 steps to fix it
- Some helpful answers from the Q&A
Key Takeaways:
- An agent can follow every rule you wrote down and still produce the wrong architecture. The problem isn't a broken agent, but a decision nobody wrote down.
- AI didn't create this problem. It removed the brake, which was the speed of human typing. Reviewers now face far more PRs, and all of them look reasonable and green.
- Rules you can write down (naming, tags, data flow) are handled well by agents. Questions like "does this belong here?" or "is this a product decision or a technical one?" still need a human.
- A skill can only hold a question you have already asked.
- The fix is 3 steps: put the decision in the right place, check what the move costs, and write the decision down in a skill.
- Agents run the stages, and humans approve the gates.
This isn't a new problem, AI just speeds it up
An architecturally wrong PR that passes every check isn't something agents invented. Fanis said it himself: a junior developer can send you the same thing, and most of us made that mistake at some point.
The difference is how many of those PRs reach you now. A junior might send one a week. You read it, find the problem, talk it through, and the next one is better.
An agent sends far more, and every one of them looks reasonable and green. The mistake is the same, but the volume changes everything.
What protected us before wasn't only the review process, but also time. People write code more slowly than an agent, so not much arrived each day, and one reviewer could read it all properly. AI removed that brake.
Scaling an Angular project? Don't just clean your code, structure your system. Read Fanis Prodromou's article "Beyond Clean Code. Building a Scalable Angular Frontend Architecture with Nx Monorepos."
A real example: the rule that nobody had written down
To show the problem, Fanis demonstrated an agent working on an Angular 21 monorepo. The task was to create a review list component in a UI library. It had to select reviews from the store, calculate the average rating, count reviews marked as verified purchases 1.2 times more than unverified ones, and include unit tests.
For the first run, he switched off his CLAUDE.md and skills. The agent asked two questions about installing a state library and extending an existing interface, and then delivered what was asked. The code compiled, the tests passed, the feature worked, and the code was modern.
Yet two things were wrong:
- The component pulled the reviews from the store itself, but a UI component in this workspace should get them through an input, and the feature layer should connect it to the data.
- The "1.2 rule" sat inside the same component, but a rule the business can change is better placed in a selector in the data layer, so every place that needs the average can use it.
The ticket didn't say any of this, and the agent didn't ask.
Then, Fanis turned everything on: CLAUDE.md, an Angular developer skill, and a custom skill describing the workspace conventions. He asked for a review focused on architectural compliance.
It caught the first problem and flagged it as critical. The Nx linter had been reporting the same violation within seconds, without any AI setup. So that rule was now covered twice. The agent gave Fanis a recommended fix, too.
Yet nothing flagged the 1.2 rule. The review didn't mention it, the tests and linter were silent. Even after Fanis applied the fixes the review proposed and re-ran it, the agent still found no architectural violations. But it did notice something important: no rule in its configuration prohibited business logic from living in a presentational component. So instead of making that architectural decision itself, it flagged the issue and gave the decision back to Fanis.
After that, Fanis also ran a separate review using the Agent Skills plugin on the same commit. That review found additional problems, including missing wiring between the component and the application, and recommended not merging the code.
The reviews had different scopes, which explains why they produced different results.
Two kinds of rules
That's the whole point of the example, and Fanis framed it clearly. Some rules can be written down: tags, naming, data flow, how a selector is written. Agents can follow and check these rules, and that's a real win. Others are questions.
For example:
- Does this belong here?
- Is this a product decision or a technical one?
- Why does this exist at all?
You can write some of them down too, e.g., "ask me before any architectural change", and it can work in some cases. But to write that line, you already had to know that this kind of confusion was possible.
That's why a skill can only hold a question you have already asked.
How to fix it: 3 steps from Fanis
1. Put the decision where it belongs.
Fanis moved the 1.2 rule into a selector in the data-access library, and the component now takes a single input. The product card needs the same number? It asks the same selector. The human decided where the rule belongs, and the agent did the refactoring.
2. Look at what the move costs.
Nine tests broke. They weren't testing the business rule, but testing where it happened to live instead. When the logic moved, the tests had to change too. The agent rewrote them in minutes, but you still have to read them and decide whether they're correct.
3. Write the decision down in a skill.
Once you've made an architectural decision, you can turn it into instructions the agent follows. Fanis showed how a few lines of plain text can describe conventions, such as UI components receiving data through inputs and selectors living in a specific place. You decide once, then the agent has a rule to follow the next time.
A skill can only hold a question you've already asked, so it's worth getting good at writing your decisions down. Join Fanis's Angular Agentic Engineering workshop, where you'll learn how to turn conventions into reusable Skills.
The 6 stages of agentic development
Fanis also introduced a six-stage workflow for building software with AI agents:
- Define (What are we building?)
- Plan (In what order should we build it?)
- Build (Write the code)
- Verify (Does it work?)
- Review (Is it right?)
- Ship (Send it out.)
None of these stages is new. Many developers already follow them. What's changed is that an AI agent can now run all six.
However, that doesn't mean it should make every decision.
As Fanis put it, "The agent runs the stages, but you, the human, approve the gates." The agent can write code, run tests, review changes, and even recommend whether something is ready to ship. But the final responsibility stays with you. If something breaks in production, your boss calls you, not the agent.
Q&A: some questions we answered
How do you balance security and token spend?
It depends on your company and the task. But at a conference two weeks before the webinar, someone from OpenAI said you should never use a weaker model for review than the one that wrote the code. I compare it to a junior reviewing a senior developer's code. Spend less on tokens during development if you have to, but don't go cheap on security reviews. I'd use a model that's at least as capable as the one that wrote the code. And since it's reviewing rather than implementing, the effort shouldn't be too high.
Is it safe to let agents run on a personal machine?
A CEO I know told me about an employee who left a company and changed all the server passwords. The company still had his PC and could recover the passwords and private keys from locally stored Claude Code session history. That made me think: what if someone reads my own Claude Code session history stored on my hard drive? It's something to pay attention to. You shouldn't put passwords into agent sessions, because someone could recover them from your local session history. It's similar to typing your password into the username field of an SSH login and having it appear in the logs.
Which tool should you bet on?
Fanis uses Claude Code, and so does most of our team at House of Angular. But I'd stay model- and harness-agnostic. The tools change. What's best today might not be the best choice in the future. At that same conference, I heard smart people recommend opposite approaches: build your own model because it's cheaper, don't constrain the model, or constrain it with deterministic code. My conclusion is that the market still isn't fully mature. So don't tie yourself too closely to one tool. Your engineering approach, how you learn, and how you check what's good and bad should remain consistent. I'd also keep an eye on OpenCode. It's open source, and while I think it's still a bit behind, it's worth watching.
Should high-security modules be written by hand?
Fanis would use an agentic workflow for both regular and high-security modules, paying more attention to the critical ones and keeping humans involved. From my side, it depends on the application's size and what security means in your case. I often delegate work to experienced developers and look at the results rather than the code. The same approach can work with agents, but you need to know where to look, how to recognize good output, and how often to check.
What about Claude Design?
Fanis said Claude Design seems designed more for agents than developers. Unlike Figma, it doesn't let you inspect details like padding, spacing, and design variables the same way. In my opinion, it works particularly well for greenfield projects using spec-driven development. You start with a specification, let Claude Design generate the design, and then make changes. It's harder with existing projects where you need to follow an established design system. And using Figma through its MCP server can consume a lot of tokens.
Two more answers from Fanis
Is this problem specific to Angular? No. The workflow applies to other frontend frameworks and models, although some Claude Code features might not be available in other tools.
Are developers becoming product engineers? Fanis doesn't think so. Coding isn't always the bottleneck, especially in large companies. He believes developers need to focus more on architectural decisions, understanding the business, and connecting different parts of an application.
Summary
Fanis's demo showed something worth remembering: an agent can follow every rule you give it, but that doesn't mean you've given it every rule it needs.
That's where your architectural judgment comes in. You decide where the logic belongs, which decisions shouldn't be delegated, and what the agent needs to know next time. But how do you turn those decisions into a workflow your agents can actually follow?
That's what Fanis goes through in his hands-on workshop:
Angular Agentic Engineering: From Spec to Ship workshop.
Learn how to make AI agents work within your architecture, not against it. You'll practice turning conventions into reusable Skills, catching subtle agent mistakes before review, and building workflows that take features from spec to ship faster.
Join the workshop yourself or send your developers to learn how to put these practices to work in your codebase.
And if you want to watch the whole webinar, click here.
