Disclosure: I work on VibUI, a website prompt library. It gets one short mention near the end. The workflow works with prompts you write yourself.
Short answer: when you add a landing page to an existing codebase with an AI agent, don't ask for the whole page in one go. Commit a small design-token file first, then prompt one section per request, each into its own component file, and review each diff before moving on. You get smaller diffs, fewer broken imports, and a page that matches the rest of your app. The pattern works the same way in Cursor, Claude Code, Windsurf, OpenAI Codex and GitHub Copilot agent mode.
What goes wrong when you ask an agent for the whole page?
If you have ever typed "build a marketing homepage" into an agent inside a real repo, you have probably seen some of this:
- It installs a new animation or icon library you didn't ask for.
- It hardcodes twenty hex values that don't exist anywhere else in your app.
- It writes a 600-line
page.tsxthat is painful to review. - It "fixes" something unrelated in your layout while it's there.
- The second request ("make the pricing look better") rewrites the hero too.
None of this is the model being bad. A single huge request gives it too much freedom and you too little control. Agents do their best work on narrow, checkable tasks, so give them narrow, checkable tasks.
What should I set up before the first prompt?
Spend ten minutes on three things.
1. A token file the agent must use. For Tailwind v4 this can be a @theme block; for older setups, tailwind.config plus a few CSS variables. Keep it short:
/* app/marketing/tokens.css */
@theme {
--color-ink: #111214;
--color-paper: #f7f6f2;
--color-accent: #2f6bff;
--color-muted: #6b6f76;
--radius-card: 14px;
--font-display: "Instrument Serif", serif;
--font-body: "Inter", sans-serif;
}
2. A rules file. Cursor reads .cursor/rules, Claude Code reads CLAUDE.md, Codex reads AGENTS.md, Copilot reads .github/copilot-instructions.md. Add a short "marketing pages" section to whichever you use:
Marketing pages live in app/(marketing)/. One component per section in components/marketing/.
Use only tokens from app/marketing/tokens.css. Never add new colours or fonts.
Do not install packages without asking. Do not edit files outside the paths named in the request.
Copy goes in [BRACKETS] unless I provide it. Never invent customers, logos or numbers.
3. An empty page that imports placeholders. Create page.tsx with the section components imported but stubbed. Now every later request has an obvious place to land.
How do I prompt one section at a time?
Each request names the file, the job of the section, its layout, and what it must not touch. Here's the hero:
Edit only components/marketing/Hero.tsx.
Purpose: explain in one line what the product does for a busy engineering manager.
Layout: two columns on desktop, stacked under 768px. Left: eyebrow label, headline
(max 9 words, font-display, 56px desktop / 38px mobile), one supporting sentence
(max 22 words, color-muted), primary button + text link. Right: a static screenshot
frame (rounded radius-card, 1px border ink/10%) with a [SCREENSHOT] placeholder.
Use tokens only. No new dependencies. No animation in this step.
Then the next one, in a fresh request:
Edit only components/marketing/Pricing.tsx.
Three plans in a row on desktop, stacked on mobile. Middle plan visually emphasised with
a 2px accent border, not a different background. Each card: name, price, one-line
description, 4 bullet points, button. Prices and bullets as [PLACEHOLDERS].
Add a monthly/yearly toggle as a controlled component; no external toggle library.
Notice what's missing: no adjectives like "modern", "sleek" or "premium". Those words give the model permission to guess. Measurements and constraints don't.
Which section order should I build in?
Build in order of risk, not in page order:
| Order | Section | Why this order |
|---|---|---|
| 1 | Hero | Sets type scale and spacing that everything else copies |
| 2 | Pricing | Most logic (toggle, plan data), so catch problems early |
| 3 | Features | Mostly layout, quick once the hero is right |
| 4 | Social proof | Placeholders only until you have real quotes |
| 5 | FAQ | Accessible accordion is a good isolated test |
| 6 | Footer + nav | Touches shared layout, so do it last and review carefully |
| 7 | Motion pass | One request that adds entrance motion to all sections at once |
The motion pass goes last on purpose. If motion is added section by section, each one tends to get its own easing and duration, and the page feels stitched together.
How do I review each diff quickly?
A short checklist per section keeps reviews under five minutes:
- Files touched: only the one named? If not, reject and re-prompt.
-
New imports: anything from a package not already in
package.json? -
Raw values: search the diff for
#andpx. Anything not from the token file is a bug. - Copy: any invented names, logos, percentages or "trusted by 10,000 teams" lines?
- Mobile: open devtools at 375px before accepting.
- Keyboard: tab through buttons and the FAQ. Focus rings visible?
If you use Claude Code or Codex in the terminal, ask for a summary of changed files at the end of each task. In Cursor and Windsurf, the diff view does this for you.
Does this work outside agent IDEs?
Yes. The same "one section per request" habit works in browser builders:
| Tool | How to apply it |
|---|---|
| Cursor, Windsurf | Agent chat, one section per message, review the diff |
| Claude Code, OpenAI Codex | Terminal task per section; rules in CLAUDE.md / AGENTS.md |
| GitHub Copilot | Agent mode in VS Code, rules in copilot-instructions.md |
| v0, Lovable, Bolt, Replit | Ask for one section per message; pin tokens in the first message |
| ChatGPT, Claude, Gemini | Generate a component per message, paste into your repo yourself |
| Framer AI, Google Stitch, Readdy, Aura.build | Generate a section, then adjust visually before exporting |
Where do section prompts come from if I don't want to write them?
Writing the first few is the best way to learn the pattern. After that, it's mostly repetition: pricing tables, FAQs, feature grids and footers have the same handful of good layouts.
That's the part VibUI covers. It's a library of 2,852 copy-paste website prompts, including 1,100 section prompts and 817 component prompts, plus 775 full-page prompts and 160 animated backgrounds. About 1,000 of them also include source code. Paid plans are one-time payments with no auto-renewal: $48 for a quarter, $99 for a year, or $179 lifetime. There are 60 free samples, and a free account can copy 2 prompts, at vibui.dev. If you'd rather keep everything in-house, the rules file plus a folder of your own section prompts gets you most of the way.
FAQ
Should I let the agent create the token file too?
You can, but review it line by line. Every later section inherits its decisions, so it's the one file worth writing by hand.
What if the agent edits files I didn't name?
Undo, then repeat the request with "Edit only X. If another file needs changing, stop and tell me instead."
Is one section per request slower?
The first draft takes a little longer. Fixing a 600-line generated page usually takes much longer than that.
Does this work with plain HTML instead of React?
Yes. Use one partial per section, or one <section> per request with a comment marker, and keep the tokens as CSS variables.
Which model should I pick?
Any current coding model handles a single section well. Narrow requests matter more than which model you pick.
Top comments (0)