In recent years, software development has changed. We've shifted from sleepless nights and heavy brainstorming into an era of architecture and risk assessment.
The way we define requirements, design the architecture, assess the risks of AI development and orchestrate agents matters more than anything nowadays. Some of you might even argue that it's not about software knowledge anymore, but about how well you've adapted to the new reality... and how fast.
The truth is that adapting takes time. The sheer amount of information is hard to keep track of, and defining the right infrastructure around AI agents is even harder.
In the last couple of months, I have assessed dozens of different frameworks for making AI productive, accurate and able to meet the expectations I have when working in such environments. It all started with a single AI agent window that kept track of everything I did, and grew into a complete infrastructure of agents, each responsible for something different, communicating through the orchestration window and criticizing their own ideas and narratives for the sole purpose of delivering something worthwhile.
In all of that, one setup proved to be particularly effective. Its structure revolves around the specifics of each model, understanding how LLMs work and where they make their most crucial mistakes.
And it all comes down to a single lesson.
Why one chat gets worse the longer it runs
There's a paper from Microsoft Research and Salesforce Research, LLMs Get Lost in Multi-Turn Conversation, that tested fifteen models across more than two hundred thousand conversations. When they gave a model the same task spread across several turns instead of in one clean message, performance dropped by 39% on average, and coding was one of the tasks they measured.
Most of that drop wasn't the model getting dumber, it was the model getting unreliable: once it takes a wrong decision early on, it keeps building on it. In their words: "when LLMs take a wrong turn in a conversation, they get lost and do not recover".
If you've used AI for more than a week, you've felt this. You correct it once, you correct it twice, and by the third time you start losing your mind. That's not a you problem and it's not a model problem. It's the chat.
So the whole idea is to stop working in one long chat. Every job gets its own agent, and every agent starts with a clean context that holds only its task, nothing else.
What the agents rely on: MCP servers & skills
To get an agent started, it needs two things: a way to reach your systems, and the knowledge of how your team builds.
The reach is what MCP servers are for. They act as a bridge between your LLMs and external data sources, files and tools, allowing AI agents to retrieve information that isn't publicly available and act on it.
There are dozens of MCP servers, each giving your LLMs a specific kind of knowledge and letting them reach places they couldn't otherwise, to retrieve information they didn't have to begin with.
For example, GitHub's MCP server lets the agent read the issues and open the pull request for you, and Atlassian's MCP server connects it to Jira and Confluence, so it reads the actual story and the specifics of your organization.
claude mcp add-json github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer YOUR_GITHUB_PAT"}}'claude mcp add --transport http atlassian https://mcp.atlassian.com/v2/mcpThis is a good start for your AI agents to understand how you operate and what you do, and it most certainly matters.
Taking this a little further, in most cases your AI agents will need access to the browser, so they can verify what they've built, make adjustments and make sure the UI/UX looks the way it should. Adding branding instructions (a separate .md file or image references) takes it even further.
Speaking of which, Playwright MCP works as automation that lets an agent open the browser, click through it and read the console and the network calls, while the Chrome DevTools MCP goes further with performance traces and deeper debugging.
Additionally, Salesforce engineers can use a new Claude Code plugin called salesforce-development which ships skills and tools for the Salesforce ecosystem you need.
/plugin install salesforce-development@claude-plugins-official
Then comes the knowledge, and that's what skills are for. The library I'd install first is Superpowers, with skills for brainstorming, writing plans, test-driven development and running work through subagents.
/plugin install superpowers@claude-plugins-official
On top of it go your own coding standards. The best place for them is the repository itself, as the AI agent needs to keep a set of skills up to date as the codebase changes and grows.
And to create them, you don't even need to sit in front of the screen the entire day: take your Confluence MCP and your own knowledge, and ask the AI agent to create the skills for you. Split them by what they're about (for example, different functionalities or technical layers, like selectors, domains and services), and make sure you add a clause telling the agent to keep them updated whenever something changes.
Skills work like a gateway. At the start the agent only sees each skill's name and description, and the full text loads only when the task actually needs it. That matters more than it sounds: the more an agent has to read upfront, the less room it has left to think, and at some point it just ignores whatever sits at the bottom.
That's precisely the reason your standards shouldn't be one giant file. They should start with a short gateway that points the agent at the right place.
The orchestrator: it plans, it checks, it never writes code
The window I work with is the orchestrator, and it has three jobs: planning, delegation and control. It does not write a single line of code, and that is deliberate.
The first reason is context. The file contents, the test runs and the logs all stay with the subagents, and only their results come back, so even on a long feature the orchestrator still remembers the plan it made at the start. The second reason is control. It checks every result that comes back, and that only works if it isn't checking its own work, because an agent that wrote the code has the same blind spots it had while writing it.
So the orchestrator can only call the agents I allow, and each of them starts with a fresh context. It doesn't see our conversation, only its task and the plan.
---
name: orchestrator
description: Plans features, delegates every step to subagents and checks their results. Never edits code.
tools: Read, Grep, Glob, Skill, AskUserQuestion, ExitPlanMode, Agent(test-writer, implementer, requirements-reviewer, ui-tester, security-reviewer), mcp__claude_ai_github__issue_read, mcp__claude_ai_github__create_pull_request
---
Read the story, the codebase and our skills, write the plan and wait for my approval.
Decide how much of this the task needs: a small bug fix gets a short plan, a new feature gets every step.
Then run test-writer, implementer and requirements-reviewer in order, giving each one only its task and the approved plan.
Run ui-tester (at least twice) and security-reviewer (a few times) together as the final check, each run with a fresh context.
Check every result. Bring me the combined findings before anything gets fixed, then send the approved fixes to a fresh implementer.
Stop after three rounds, or when the same findings come back twice, and ask me.
At the end, look at why each mistake happened and propose changes to the skills, hooks or plan template.
Project rules for this codebase:
- References to your specific files, your organization skills, business rules, conditions like "never guess & ask instead" and so on.Look at the orchestrator's tools: Read, Grep, Glob and the agents it's allowed to call. No Edit, no Write. And this isn't a request in a prompt: Claude Code enforces the tool list itself, so the orchestrator can't decide to skip it whenever it wants, no matter where the implementation takes us.
The plan: this is the part that's actually your job
The orchestrator starts in plan mode. It reads the story, the codebase, the organization's knowledge and the standards, and writes the plan: which classes go in which layer, what they cover, where the business logic lives and what it looks like, which users run this code and with how much data, what each of them sees and which tests prove it works.
This is the most technical part of the whole thing, and it's the part that is actually yours. You ask the right questions, and you make the agent criticize its own plan, because asking AI to prove that it's wrong is usually the best way to go.
Whatever is unclear, you must make sure the AI agents understand they need to ask questions instead of guessing. This is one of the benefits of the orchestration agent: the information it handles is limited to what the subagents return to it, so it's much more reliable at keeping your instructions (like asking questions) in mind.
Plan story #0000 from Jira. Ask me about anything unclear, then criticize your own plan before you show it to me.
There are two things in that plan you shall look for, and both come back later.
The first is who runs this code and how much data it gets, stated plainly: called from an Experience Cloud site by a read-only user, or 200 records at once from a trigger. If the plan doesn't say it, the agent writes tests for one record as an admin, and of course everything works for an admin.
The second is every entry point: every @AuraEnabled method, every invocable, every REST endpoint, and who can call it.
Tests before code: the test writer
The first subagent writes the tests, before any implementation exists, from the plan and the acceptance criteria only. That way the tests check what was asked, not what got built.
In Salesforce, the test writer creates stubs with the planned signatures that compile but don't do anything yet, and the tests describe the outcome those methods should produce. That gives the implementer a clear finish line, and it stops the most common quiet failure in AI development, where the AI writes tests that simply confirm whatever the code already does.
---
name: test-writer
description: Writes the test classes from the approved plan before any implementation exists. Use first for every new feature.
tools: Read, Grep, Glob, Write, Edit, Bash, Skill
skills:
- coding-practices
---
Write tests only from the plan and its acceptance criteria.
If a planned class doesn't exist yet, create a stub with the planned signatures that compiles (return null or throw a not-implemented exception), so the tests deploy and fail for the right reason. Never implement the logic.There's a good reason to be strict about this. A benchmark called ImpossibleBench gave models tests that contradicted the spec, and the models cheated to make them pass about half the time, GPT-5 at 54% and Claude Opus 4.1 at 50%.
The same study found that giving the model a clear way to stop and say "this test looks wrong" instead of forcing a green run dropped GPT-5's cheating from 54% to 9%, though for Claude the effect was much smaller. So the tests have to be protected, and the implementer still needs a way out that isn't quietly rewriting them. That's the next stage.
The implementer, and the checks it can't skip
The second subagent writes the code, and its only goal is to deliver the functionality and make the tests pass. It cannot change them. A hook in its file blocks edits to the test files and sends the reason back, so instead of adjusting the test, it fixes the code or tells me something is wrong.
---
name: implementer
description: Implements the approved plan until the test writer's tests pass. Never changes tests.
tools: Read, Grep, Glob, Write, Edit, Bash, Skill
skills:
- coding-practices
hooks:
PreToolUse:
- matcher: "Edit|Write|Bash"
hooks:
- type: command
command: '"$CLAUDE_PROJECT_DIR"/.claude/hooks/block-test-edits.sh'
---
Implement the approved plan. You are done only when every test from the test writer passes.
If a test looks wrong, stop and tell me instead of working around it.Just like the orchestrator's tool list, hooks are enforced, not requested: they're scripts, not instructions, so the AI can't forget them or decide to skip them. If you've left the same feedback in a review more than twice - it should be a hook.
The requirements reviewer: a clean pair of eyes
When the work is done, a third subagent checks it against the requirements. It starts with a clean context and runs on a different model.
Both of those are there for a reason: models go easy on their own work. A study from this year, with Anthropic researchers among the authors, asked a model to judge code changes. When a change was shown to it fresh, in a new message, its judgment was almost perfect. When the same change appeared as something it had written earlier in its own conversation, its judgment got noticeably worse. So the reviewer must start with a clean context, without ever seeing the code being written, and running it on a different model makes it even more independent.
---
name: requirements-reviewer
description: Checks the finished work against every acceptance criterion and lists gaps and open questions. Never fixes anything.
tools: Read, Grep, Glob, Skill, mcp__atlassian__*
model: sonnet
---
You get the story and the list of changed files from the orchestrator.
For every acceptance criterion, say whether it is implemented and tested.
Point every finding to a line in the plan or the standards, with the file, the line and how to reproduce it.
List anything that is still unclear as a question for me.
Every finding has to point to a line in the plan or the standards, and every finding comes with proof: the file, the line, how to reproduce it. Without those two rules a reviewer invents problems to look busy, and the loop never ends. There's even research showing a reviewer asked to find gaps will usually report some, even when the work is sound, so you have to hold it to proof.
Testing in a real browser, more than once
Then comes testing, and I don't mean Apex tests. Apex tests tell you the backend works and nothing about what the user actually sees. That's where the browser MCPs we covered earlier come into play.
This agent uses the browser MCP to open the org, log in as each user from the plan, click through the feature the way that user would, and read the console and the network calls after every step, so it catches the error your component swallowed or the Apex method called over and over on a single click. Then it logs in as a user who shouldn't see the data and confirms they can't. The orchestrator gives it a test user for each persona in a sandbox, so it never has to guess how to get in.
It's important that it never sees the code. The moment it reads the code, it starts testing what was built instead of what was asked for.
---
name: ui-tester
description: Tests the feature in a real browser as each user from the plan. Never reads the code.
tools: mcp__playwright__*
mcpServers:
- playwright:
type: stdio
command: npx
args: ["-y", "@playwright/mcp@latest", "--isolated"]
---
You get the acceptance criteria and the users from the orchestrator.
Log in as each user, go through every criterion and check the console and network calls after every step.
Then log in as a user who shouldn't see the data and confirm they can't.
Report every step with a screenshot.
One of the biggest lessons of this approach is that... it's not always reliable on the first try. A study on UI-testing agents called GUITester ran the same tests three times. A single run found about 28% of the defects. Three runs together found about 48%. Same agent, same app, nearly double the defects just from running it again.
So ask the orchestrator to run it twice or even more, and make sure each run gets its own fresh context instead of reusing the same one.
The security agent: one job, which is to break it
Alongside the UI tester, and at the same time, a separate agent gets a single job: break the feature. It doesn't care whether it works. It reads the code looking for a class running without sharing, a query built from user input, a method that trusts a record ID from the UI instead of checking whether the user has access to that record. It runs in parallel with the UI tester because neither of them writes code, so there's nothing for them to collide over.
---
name: security-reviewer
description: Reviews the finished feature for vulnerabilities, starting from the entry points in the plan. Never fixes anything.
tools: Read, Grep, Glob, Skill
model: claude-opus-4-8
---
Start from the entry points and users in the plan.
For every @AuraEnabled method, invocable and endpoint, assume someone can call it with any parameter.
Report each finding with its severity, the line in the plan or standards, and how to reproduce it.
I pin it to Opus 4.8 on purpose: the current Opus hands most security work over to Opus 4.8 anyway, and I'd rather the agent doesn't switch models halfway through a review.
It starts from the list of entry points in the plan, which now becomes the attack plan. Every @AuraEnabled method should be treated as a webservice interface, and we shall assume that an attacker can call this method with any parameter, no matter which buttons your component shows.
Why bother, if you already review code yourself? Because the numbers on AI-written code aren't comforting. In Veracode's latest run, AI-generated code passed security checks 62% of the time on average, and without security-specific guidance the models introduced a vulnerability in roughly four out of ten tasks. Java, the closest language to Apex they test, passed about 31%.
And like the UI tester, the security agent earns its keep by running more than once.
My decision, the fix, and running it all again
Everything the UI tester and the security agent find comes back to me as one report. I don't let the pipeline act on it on its own, because a good share of AI security findings turn out to be false alarms: I read the report, and I accept, reject or adjust each finding.
Then the fixes go to a fresh implementer. Not the orchestrator, which has no edit tools anyway, and not the agent that found the problem. A fresh context, writing one thing at a time, is what the whole setup is built on, and it's why the finder stays independent enough to check its own finding again afterwards.
And then everything runs again, from scratch. This is, again, an important part of delivering a reliable product. Large projects need several rounds of scanning and fixing to catch the bugs that stay hidden after the first pass, and every fix should get an adversarial review, because first fixes tend to add too much code, drift from the conventions or miss the same bug somewhere else.
Two things keep this loop from running forever: a round limit, and a rule that if the same findings come back twice - it stops and asks me.
The part I like most: it gets better after every feature
Once everything passes, the orchestrator does one more thing. It looks at why each mistake happened in the first place, and the answer decides the fix.
If a rule didn't exist - it goes into the standards. If the rule existed and the agent ignored it - repeating it in a file won't help, so it becomes a hook. And if the plan never asked the right question - the plan template gets that question for next time.
# Plan template
- Which users run this code, and with how much data?
- Which classes go in which layer?
- What does each user see?
- Which tests prove it works?
On top of that, every new piece of functionality gets a skill of its own, describing how it works, so the next agent doesn't have to rediscover it by opening every file.
Sources
- LLMs Get Lost in Multi-Turn Conversation
- ImpossibleBench
- Self-Attribution Bias: When AI Monitors Go Easy on Themselves
- LLM Evaluators Recognize and Favor Their Own Generations
- GUITester
- Veracode Fall 2026 GenAI Code Security update
- Semgrep: Finding vulnerabilities with Claude Code and OpenAI Codex
- Cloudflare: Build your own vulnerability harness
- OpenAI: A thousand fewer paths to root
Comments
This is where you disagree
Comments are for subscribers, mostly to keep the noise down. It’s free to join and takes about a minute.