Logo van For The Dream
AI & StrategyEnglish

One prompt is not an engineering process: how four specialists review our AI-written code

One prompt is not an engineering process. After building, we have larger changes reviewed at the same time by four specialists for security, mobile, data and QA, with a limited repair loop and a person who decides when in doubt.

Kutlu Taskin Tuna
Kutlu Taskin Tuna
Founder For the Dream
8 min read
Building leads to four parallel reviews for security, mobile and frontend, backend and data, QA and runtime, which come together at a gatekeeper
Volledig scherm
Only when all four give the green light does the code move towards production.

Anyone using AI to build software today usually works in one linear conversation: write a prompt, get code back, paste it in and hope nothing breaks in production. For a typo in a footer, that is more than enough.

For work where brand, security, mobile usability and data come together, it is a risk. A single generalist agent focused on the visual design easily misses something: an input field that makes the page zoom in on an iPhone, HTML that is not sanitised safely, or a database table without access rules.

One conversation, one agent, blind spots

Volledig scherm
One conversation, one agent, blind spots, A linear conversation is fine for a typo. Once brand, security, mobile and data come together, a single generalist easily misses something.

That is why at For the Dream we do not rely on one agent that has to guard everything at once. Larger changes follow a fixed route: plan, build, and then a review by four specialists who each guard only one domain. Only when all four give the green light does the code move towards production.

In this article we explain how that route works, who does what and where its limits are. We illustrate it with a made-up but realistic scenario: a law and insurance firm, which we call Vanguard Legal & Indemnity here, asks for a new online intake for claims and mandates.

Plan, build, four specialists

Volledig scherm
Plan, build, four specialists, Larger changes follow a fixed route. Only when the four specialists give the green light does the code move towards production.

1. Not every task needs a committee

The route starts with a simple question: how big is this change? A small adjustment goes straight through, a larger one gets the full review.

First the question: how big is the change?

Volledig scherm
First the question: how big is the change?, Small or exploratory tasks go direct. Broad or structural changes get the full route with specialists.

If a partner at our example firm asks to change a phone number in the footer, it goes direct and is done within minutes.

If the same firm asks for a new intake, with photography per practice area, readable text over those photos, a confidential form to submit a claim and documents, and automatic onboarding of new clients, that touches several pages, forms, storage and security. That request enters the full route, and a status file is created that tracks where the task stands throughout.

A phone number or an intake

Volledig scherm
A phone number or an intake, The same firm, two requests. One is done within minutes, the other touches four domains and enters the full route.

2. The route in five steps

The full route has five fixed steps. After building, it splits into four parallel reviews, which then come together at a single gatekeeper.

If a review fails, the task goes back to a targeted repair step and then through the reviews again. That loop is deliberately limited: after two repair rounds the system stops and a person takes over. The order and the rules are fixed. What the agents write within a step remains the work of a language model and is therefore not predictable to the letter. That is exactly why there is a review behind it.

The route in five steps

Volledig scherm
The route in five steps, Order and rules are fixed, with a repair loop of at most two rounds. What the language model writes within a step is not fixed: hence the reviews.

3. What happens in each step

Step 1: mapping the existing code

Before any code is written, the first step maps the existing code with a code graph: an index that knows which function uses which other function. That is more reliable than searching for text. For our example, this step finds where the colours and typefaces of the design system live, where the cards per practice area are built, which server functions process the form, and which parts depend on them.

Step 2: the plan, and a person who approves it

The second step produces the technical plan. For our example it has three parts. The photography for Litigation, Cyber Insurance and Mergers and Acquisitions gets a fixed focal point, so faces never disappear behind text or get cropped. Over those photos come gradients that guarantee a contrast of at least 4.5:1, the WCAG standard for normal text. And the form and the database schema are designed.

Map first, then a plan

Volledig scherm
Map first, then a plan, A code graph shows where everything lives and what depends on it. The plan sets out what the example firm needs.

For major structural choices, the route pauses here. A person approves the plan or sends it back, and only then does building start.

Step 3: building

The third step writes the TypeScript, the React and Next.js components, the CSS and the server functions. In a typical AI workflow the process stops here. For us this is only halfway: as soon as the code is done, the four reviews begin.

A person approves, building is only halfway

Volledig scherm
A person approves, building is only halfway, For major choices a person decides on the plan. Where a typical AI workflow stops after building, the reviews start here.

4. The four specialists

After building, four specialists examine the change at the same time. Each guards one domain, works from a fixed list of rules and has no interest in sparing the builder.

Specialist 1: security

On a legal or insurance platform, one leak can expose legal privilege or a policyholder's data. This specialist checks every changed file on three points.

  • Sanitising HTML with an allowlist, not with regular expressions. Free text in a claim description is sanitised with a library such as DOMPurify, which only lets permitted tags through and removes <script>, <iframe>, <object> and inline event handlers.
  • Bot checks that do not block real clients. A form filled in too quickly often points to a bot. If a visitor's clock runs ahead of the server's, the measured time can come out negative. The specialist checks that such a measurement is not treated as a bot.
  • No personal data in logs. The server logs keep only the outcome and the reason, never names, policy numbers or case content.

Four specialists, one domain each

Volledig scherm
Four specialists, one domain each, The four reviews run at the same time, each with a fixed list of rules. Security looks at sanitising, bot checks and logs.

Specialist 2: mobile and frontend

A lawyer or in-house counsel reviewing an urgent claim on an iPhone has no use for a shifted layout or a page that suddenly zooms in.

  • At least 16 pixels in form fields. Every <input>, <select> and <textarea> has a font size of at least 16 pixels on screens narrower than 768 pixels. Any smaller, and Safari on iOS zooms in as soon as someone taps a field.
  • A sticky header that stays put. overflow-x: hidden on a parent element turns it into a scroll container, so a sticky header no longer sticks. The specialist requires overflow-x: clip, which cuts off horizontal overflow without that side effect.
  • A compact header and responsive buttons. The mobile header stays one row high, and buttons get touch-action: manipulation, so a quick double tap is not read as a zoom gesture.
  • Readable text over photos on every screen. The contrast of at least 4.5:1 is measured again at 320, 390, 768, 1024 and 1440 pixels wide, with no horizontal overflow.

Specialist 3: backend and data

When a policyholder reports a claim or in-house counsel requests a conflict check, the data has to be correct and shielded.

  • Keys and relations. Records get UUIDs as keys, and strict foreign keys apply between claims, mandates and policyholders.
  • Access per row. Row-Level Security in PostgreSQL ensures each record is visible only to the organisation and the role entitled to it.
  • Login links that survive a virus scanner. Corporate mail filters often open links automatically to scan them. A login link that is used up on that first opening no longer works for the real recipient. The specialist checks that the link first shows a page where the user confirms themselves.

What mobile and data check

Volledig scherm
What mobile and data check, Mobile guards what a user notices on an iPhone. Data guards whether the data is correct and shielded.

Specialist 4: QA and runtime

Reading code is not enough; it also has to run. This specialist actually builds the project and tests it in a browser.

  • It runs the type check, the linter and a full Next.js production build.
  • It has an automated browser (Playwright) open the pages on mobile, tablet, laptop and desktop, and checks contrast, keyboard tab order, the calmer variant for people who prefer less motion (prefers-reduced-motion) and the absence of errors in the console and the network.

Reading code is not enough: it has to run

Volledig scherm
Reading code is not enough: it has to run, The QA specialist actually builds the project and has a browser open the pages in four formats.

5. Repairing without an endless loop

What happens when a specialist finds something? Suppose that in our example security and data give the green light, but the mobile specialist reports two problems: the policy number field is set to 14 pixels on mobile, so iOS zooms in, and on the Cyber Insurance card the contrast drops to 3.6:1 on a 390-pixel screen.

The gatekeeper collects only what failed, with the exact file and line, for example ClaimForm.tsx line 42 and practice-card.module.css line 18.

One specialist finds two problems

Volledig scherm
One specialist finds two problems, In the made-up example, security and data give the green light. The gatekeeper passes on only the two mobile findings, with file and line.

The repair step changes exactly those two points: the field's font size goes to 16 pixels, and the gradient on the card gets darker at the bottom.

Then only the reviews that failed run again, plus the QA specialist, which always runs. Security and data keep their green status, unless the repair touched their files.

Targeted repair, targeted re-review

Volledig scherm
Targeted repair, targeted re-review, The repair step changes only what failed. Then only the mobile review and QA run again.

After at most two repair rounds it is done or the system stops. If a problem persists after the second round, the responsible developer takes over with a report that states per file and per line what is still wrong. That way an agent does not keep trying endlessly and burning tokens.

At most two rounds, then a person

Volledig scherm
At most two rounds, then a person, The loop is limited. If something is still red after the second round, the developer takes over with a report per file and per line.

6. Always visible where the task stands

Throughout the route, the system keeps a status file. At any moment a developer can see which step is running, which reviews are green and what is still open. For our made-up example, the final state after one repair round would look like this:

The status file after one repair round

Volledig scherm
The status file after one repair round, Visible at any moment which step is running and which reviews are green. This is the final state of the made-up example.

What this does and does not deliver

This way of working does not make software flawless. It does reduce the chance that an entire domain is overlooked because one agent was focused on something else. Each specialist looks only at its own list, the repair loop is limited and when in doubt a person decides.

The difference between a prototype and a platform an organisation can build on lies in the rules you do not deviate from. By writing those rules down and having four specialists test every change against them at the same time, we make them enforceable rather than dependent on whoever worked on it that day.

What this does and does not deliver

Volledig scherm
What this does and does not deliver, The approach makes rules enforceable, not software flawless. The difference lies in the rules you do not deviate from.
Book a call