Build a checkout for a small online store as a real full-stack Next.js app. The page renders a cart of line items, each showing a product name, a unit price, and a quantity the shopper can edit. Alongside the cart, an order summary panel breaks the charge down into subtotal, shipping, tax, any applied discount, and a final total. A promo code field lets the shopper enter a code and apply it, and a confirm-order button completes the purchase and moves the page into a clear order-confirmation state.
This time the agent does not emit one self-contained file. It works inside a scaffolded Next.js workspace through a bounded tool loop: writing source files, installing dependencies, starting the dev server, and verifying the app is healthy before it finishes. The pricing, promo, and order rules belong in server API routes; the page is a thin client that stays consistent with the server's answers as quantities change and codes are applied.
Treat the example below as illustrative of the happy path only. Your spec should describe the full checkout behavior precisely enough that an agent can build a correct, usable store across that client/server boundary, including the pricing rules, how the summary stays in sync as inputs change, and how the app behaves when shoppers do the unexpected.
Example
A cart with one item priced at 12.00 at quantity 2 has a subtotal of 24.00. With shipping of 6.00, 10% tax of 2.40, and no discount, the displayed total is 32.40.