AI Agent-Driven Full-Stack Delivery: From a Single Prompt to a Working System
This article explains why a page generated by an AI agent is not yet a delivered system, and how to check each stage of a full-stack delivery workflow. It covers requirements structuring, design tokens, interaction state coverage, server-side business rules, and storage choices. It also shows a conditional UPDATE pattern that prevents overbooking under concurrent requests, followed by a pre-release QA checklist and the limits that still require human review.
- Why a Generated Page Is Not a Delivered System
A single prompt can produce a page that looks impressive in a demo. Moving from that demo to a system you can deliver involves several more engineering problems. Is the data persisted? Are business rules enforced on the server? Under concurrent requests, can inventory be oversold? Are error paths handled? Agents generate content so quickly that these steps are easy to overlook. When you evaluate an agent’s delivery capability, focus on system completeness rather than visual results.
This article uses a general full-stack delivery task as an example. It breaks down the full workflow and explains what to check at each stage.
Five Stages of a Typical Full-Stack Delivery Task
Requirements structuring
Natural-language requirements often contain implicit conditions. For example, “build a flight booking page” implies several questions: Are seats selectable? Can the same seat be booked twice? What is the capacity limit? Which fields must passengers fill in? Where is the data stored after a booking succeeds? Organizing these conditions into a clear data model and state transition diagram is the foundation for all later work.
Before coding, have the agent output an entity list, a state transition diagram, and an API list. Have a developer confirm them before implementation begins. This step is cheap and prevents much rework.
- Visual and front-end generation
The front end covers layout, typography, animation, and responsive adaptation. Agents are good at generating consistent design variables from style descriptions, such as colors, font hierarchy, and spacing. Convert style descriptions into reusable design tokens instead of hard-coding fixed values across components.
Example:
:root {--color-accent: #7fffd4;--color-warning: #ff8c1a;--font-mono: ui-monospace, monospace;--space-unit: 8px;}
The accent color, warning color, and monospace font are all defined in one place. When you adjust the visual style later, you only change the variables. You do not replace values in each component.
- Interaction state design
A common problem with interactive pages is that they only cover the happy path. Take a seat selection component as an example. It must handle at least five states: available, selected, occupied, unavailable, and loading. Each state needs clear visual feedback, and the related actions must be disabled correctly.
A useful check is exhaustive state enumeration. List every state of the component, confirm that the interface shows each one, and confirm that the component returns to a consistent state after unexpected transitions.
- Back-end logic and data persistence
The back end has two jobs: storing data and enforcing business rules. Business rules must run on the server. Front-end validation improves the user experience, but it cannot be the final authority, because any client code can be bypassed.
A typical approach is to define a clear interface for each write operation. The server performs parameter validation, permission checks, and state checks, and then writes to storage.
Choose storage based on the characteristics of the data. Strongly consistent data such as orders and bookings fits a relational database, where transactions keep multi-table writes atomic. Logs and behavior statistics are large in volume and have lower timeliness requirements. They can go to object storage or a logging service, managed separately from the business database.
- Concurrency and capacity control
Capacity limits are one of the easiest places to make mistakes. Suppose a flight holds at most 6 passengers. If two users submit the last seat at the same time, and the code reads the current booked count, checks it, and then writes, both requests can pass the check and overbook the flight. This is called a race condition.
- Example: Preventing Overbooking with a Conditional Update
Read-then-write logic is unreliable under concurrency. A safer approach combines the check and the update into one conditional statement, then uses the number of affected rows to decide the outcome. The SQL below shows this idea. Exact syntax may vary slightly by database type.
BEGIN;UPDATE flightsSET booked = booked + 1WHERE id = :flight_idAND booked < capacity;-- In the application layer, check the number of affected rows. If it is 0, the flight does not exist or is full. Run ROLLBACK and return an error.INSERT INTO bookings (flight_id, passenger_name)VALUES (:flight_id, :passenger_name);COMMIT;
This code has three key points.
First, the check and the increment happen in the same statement. The database locks the target row, so a concurrent request that arrives later must wait and cannot change the count at the same time.
Second, the application must check the number of affected rows instead of assuming the update succeeded. Zero affected rows means the flight is full or does not exist. In that case, roll back the transaction and return a clear error message.
Third, writing the booking record and updating the count happen in the same transaction. If any step fails, the whole transaction rolls back, so the count and the booking records never diverge.
Pass :flight_id and :passenger_name through parameter binding. Do not concatenate strings into the SQL, because that introduces SQL injection risk.
- Quality Assurance Checklist
Complete at least the following checks before delivery:
- Business rule tests: Each scenario has test cases, including capacity limits, duplicate bookings, and releasing seats after cancellation.
- Concurrency tests: Send multiple concurrent requests for the last remaining seat, and confirm that the number of successful requests does not exceed the limit.
- Error paths: When network timeouts, duplicate submissions, or missing parameters occur, the system returns clear error codes, and the page shows an understandable message.
- Security checks: Validate inputs, escape outputs, and check authorization. Sensitive information must not appear in logs or front-end code.
- Observability: Key operations have logs and metrics, such as the number of successful bookings and the distribution of failure reasons.
- Deployment and rollback: Configuration is injected through environment variables or a secrets management service, and the release process supports rolling back to the previous version.
- Capabilities and Limits
Agents are efficient at generating pages and template-based code. However, the following areas still need human review.
First, business semantics. An agent cannot replace judgment about business rules. Refund rules, change fees, seat hold duration, and similar rules must be defined by the business side before implementation.
Second, security and compliance. Generated code may omit authorization checks or use insecure default settings, so it needs dedicated review before release.
Third, maintainability. Large blocks of code generated in one pass often lack module boundaries and test coverage, which makes later iteration costly. Ask the agent to output code by module and produce tests alongside it.
Fourth, reproducibility. The same prompt may generate code with a different structure at different times. Key logic should be captured as versioned code and tests rather than regenerated each time.
- Recommendations
A team can adopt agents in this workflow. People write requirements and acceptance criteria first. The agent generates an initial implementation. A test suite and code review check the result, and continuous integration handles deployment. This uses the speed of generation while keeping control points for engineering quality.
For individual developers, the most practical habit is to run and test the output immediately after each generation, and to write business rules as executable assertions. Code counts as delivered only when it runs, can be tested, and can be rolled back.
