Build From Decisions, Not From a Blank Chat
An empty repository is not an empty brief. The site's job, audience, routes, content, brand, languages and minimum functionality are settled in the Spec stage. The agent's job here is to implement them, not to decide them.
Next.js is a sound default when a website needs crawlable pages, a blog, page metadata, Open Graph images and simple form handling. Recent versions also ship documentation matched to the installed version, so the agent reads the rules for the framework you actually have. It gives SEO, AEO and GEO work a solid technical base; it does not make a page visible by itself.
Build in passes. The first pass makes the website real and coherent. The second pass improves images, sharing, links, tracking links, mobile speed and motion after the basic experience works.
Steps
Guide
- 1
Check the Design Evidence Before Any Code
Read GuideThe agent builds better from evidence than from taste. Before the first prompt, confirm three inputs exist:
- Screenshots of about ten relevant sites, on desktop and mobile. A desktop capture alone hides collapsed menus, reordered sections and mobile-only problems.
- A section plan with a locked order for both layouts, following the visitor's questions: what is this, is it for me, why trust it, what do I do next.
- A rough mock-up - an AI-generated image is enough to set hierarchy and rhythm; use Figma when screens, states or approvals need exact detail.
From the screenshots, note which sections most sites share, which only a few have, and what nobody explains well. The shared ones are what visitors expect; the gaps are where your site can be clearer. This is evidence, not a copying exercise.
Write down what in the mock-up is intentional. The agent cannot tell a firm spacing rule from an accident of the image generator.
Create the Next.js Foundation the Agent Can Read
An empty repository still starts from a template: the official
create-next-appstarter or your own approved one. Commit that clean baseline before the agent changes anything. Confirm the package manager, TypeScript, linting, App Router, folder structure, environment variable rules, and the commands that prove the project works.Keep an
AGENTS.mdfile at the repository root. Current Next.js releases point coding agents to the documentation bundled with the installed version. Add your own source-of-truth order, commands, design rules, stop conditions and acceptance checks outside any block the framework manages.Ask the agent to run the site and look at the rendered page after every meaningful edit. Code that compiles is not enough when the browser shows a broken route, a console warning, an overflow or a missing state.
- 4
Build Sections in Order and Reuse What Already Works
Read GuideBuild one section at a time, in the approved order. For each, give the agent the content, the reference screenshot, the required behaviour, responsive notes and acceptance checks.
Reuse Skills and components from earlier builds when they genuinely fit, instead of pasting copies between projects. A reusable section takes content and style as inputs and keeps its accessibility and responsive rules intact.
Review each section inside the page, not only on its own. The next section often exposes weak spacing, a repeated message or an abrupt visual change that a component preview hid.
Connect the Language Selector to Real Content
A language selector is not finished when its menu opens. Each option must lead to the right route and render that language's content. Navigation labels, buttons, forms, metadata, error messages and the page's
langattribute must all agree.Keep translations in one content source or dictionary, not scattered through components. In the App Router, locale routing is yours to set up: a
[lang]route segment plus a Proxy that sends visitors to the right sub-path or domain. The framework gives you the mechanism; the locale model and the translated content are still your job.Test switching from more than the homepage. Refresh, follow internal links, submit a form and open a missing route. The visitor should never land silently in the wrong language.
Add Forms First and a Database Only When Needed
A contact or lead form does not justify a database on its own. First decide where a submission goes, what validation it needs, what the visitor sees after sending, and who answers it.
Next.js handles form submissions with Server Actions. Validate input on the server, and treat authentication and authorisation as server-side checks, never as properties of the visible form.
Add a database when the site must keep structured data, support accounts, run a content workflow or query stored records. n-g.be uses Supabase where it needs stored data; that is a project choice, not a requirement for every Next.js website.
Finish the First Pass With Alt Text and Brand Colours
Run two focused reviews before calling the first pass done. First, check every meaningful image and write alt text that says what it is for in context. Decorative images get empty alt text so screen readers skip them.
Second, compare the whole interface with the approved colour tokens. Replace near matches, one-off shades and framework defaults. Check text, links, focus states, buttons, form feedback, icons and the mobile menu.
Both passes work better once the page exists. The agent compares one finished interface instead of trying to hold a rule across many separate section prompts.
Write the Second Pass Before Starting It
Create a named second-pass queue, and keep these tasks out of the first build until routes, content, languages and core actions work:
- final images and responsive crops
- page-specific Open Graph images and metadata
- internal links and campaign tracking links
- mobile speed and image loading
- animations that improve understanding or feedback
Next.js has file conventions for metadata and Open Graph images, plus built-in image and font optimisation. They make the work faster; each page still needs correct content and a human check.
- 10
Close the Gaps Before You Hand the Site Over
Read GuideRun lint and a production build, then review the real site on desktop and mobile. Click every important route, switch every language, submit each form safely, inspect metadata, and check that no content hides behind the navigation or overflows its container.
MagicBetting.BE was built solo this way: from an empty repository, section by section, from design to CI/CD. The lesson is the method, not the site: keep decisions in files, keep each change reviewable, and verify the connected website before launch.
Record what passed, what is left for the second pass, and which external settings still need a person. That note is the next agent's starting point.
Be Aware
The agent starts coding before the site decisions are settled.
Stop and return to the input pack. Mark missing content, brand, route, legal or language decisions as unknown before implementation continues.
The mock-up looks good, but the mobile section order was never decided.
Compare every reference on desktop and mobile, then approve both layouts before building sections.
The language selector changes a label but not the page content or route.
Use one locale model for routes, dictionaries, navigation, forms, metadata and fallbacks, then test it beyond the homepage.
Several tools become separate repositories with copied components.
Move related tools into one repository with shared packages and separate deployment roots where needed.
Polish work keeps delaying a usable first version.
Finish core routes, content, actions, languages, alt text and brand colours first. Move images, Open Graph, tracking links, speed and animation into the named second pass.
Return to the Main Guide?
Main guide
Build: Produce the Site From the Spec
Empty Repository Build Brief
Copy / paste
Build the first working version of this Next.js website from the approved project files.
Before writing code, read:
- the website goal, audience, and MVP scope
- the desktop and mobile competitor screenshot analysis
- the approved page and section order, and the mock-up notes
- brand, content, route, language, legal, and SEO/AEO/GEO inputs
- AGENTS.md and every referenced reusable Skill
Stop and ask if a required business, content, brand, legal, route, language, integration, or tracking decision is missing. Do not invent it.
Build in this order:
1. Initialise or verify the Next.js foundation from the approved template, commit the baseline, and confirm the local commands.
2. Build the header and footer from their reusable Skills.
3. Build page sections one at a time in the approved order, reusing suitable Skills and components. Check each section in the rendered page.
4. Connect the language selector to real routes and translated page content.
5. Add the approved forms and integrations, with server-side validation. Add a database only if stored data is required.
6. Run focused alt-text and brand-colour passes.
7. Verify desktop, mobile, routes, languages, forms, lint, and production build.
Do not start the second pass until the first pass works. Create a separate queue for final images, Open Graph, links, tracking links, mobile speed, and animations.
Finish with delivery notes that state what changed, what passed, what remains, and which external settings still need a person.
