All posts
Vibe codingUI design

UI Design Workflows with OpenAI Codex for Vibe Coders

Practical UI design workflows with OpenAI Codex for vibe coders — specs, prompts, repo-native iteration, and pairing Codex with agent-ready design resources.

AD
Agent's Design

UI design workflows with OpenAI Codex work best when you treat the agent as a repo-native builder, not a blank-page generator. Add a DESIGN.md spec to your project, reference it in every UI task, build one page or component at a time, and pair Codex with agent-ready templates from a design input layer. Without specs, Codex ships working React — with the same generic slop as every other coding agent.

Codex sits in a different category than Lovable or Bolt.new. It does not scaffold full apps in a visual editor. It works inside your codebase — generating components, refactoring layouts, and applying styles across files with project context. That makes it powerful for production UI and dangerous for unconstrained aesthetics.

This guide covers Codex-specific UI workflows: specs, prompts, iteration patterns, and how to pair Codex with design resources so your interface looks intentional.

Where Codex fits in the vibe coding stack

Vibe coding tools fall into two groups:

TypeExamplesUI workflow
Full-app buildersLovable, Bolt.newChat → preview → iterate in browser
Repo-native agentsCursor, Claude Code, CodexChat/CLI → diff → review in browser

Codex belongs to the second group. It reads your project structure, existing components, and style conventions — then writes code that lands in the right files.

For UI design, that means:

  • Components match your stack — imports, paths, and patterns align with what you already have
  • Design specs persist — DESIGN.md in the repo is available every session
  • Refactors span files — update a token and propagate across components
  • Production path is direct — no export step from a builder to your codebase

The tradeoff: no visual WYSIWYG. You review in the browser, Storybook, or dev server. Design quality depends entirely on what you put in the repo before asking Codex to build UI.

Why Codex UI still looks templated

Codex has the same slop problem as Cursor, Claude Code, and every other coding agent. Without constraints, it defaults to:

  • Tailwind utility soup with no token discipline
  • shadcn components with default styling untouched
  • Inter font, purple accents, rounded cards
  • Placeholder copy that sounds confident but says nothing
  • Inconsistent spacing between components built in different sessions

This is not a Codex limitation. It is what happens when the agent has no design brief. It optimizes for "compiles and renders" — not "looks like our product."

The fix is the same across repo-native agents: spec-first workflow with concrete tokens, component rules, and anti-patterns in a file the agent can read.

The spec-first Codex UI workflow

Step 1: Add DESIGN.md to your repo

A DESIGN.md is your agent's design system. It lives in the project root and includes:

  • Typography — font families, scale, weights, line heights
  • Color tokens — CSS custom properties for light and dark mode
  • Spacing — grid base, section padding, component internal spacing
  • Components — button variants, card styles, form patterns
  • Layout — max widths, sidebar dimensions, grid structures
  • Motion — duration, easing, what animates and what does not
  • Anti-patterns — explicit bans on slop defaults
your-project/
├── DESIGN.md
├── src/
│   ├── app/
│   └── components/
└── ...

If you do not have a DESIGN.md yet, copy one from the Agent's Design gallery and customize tokens for your brand. Fifteen minutes of editing saves hours of prompt iteration.

Step 2: Reference the spec in every UI prompt

Every Codex UI task should open with:

Follow the design language in DESIGN.md for all styling decisions. Use only defined tokens. Do not add fonts, colors, or animations not specified in the spec.

Then describe the specific build scope — one component, one section, one page.

Step 3: Build one unit at a time

Codex produces better UI when scoped tightly.

Recommended build order:

  1. Layout shell — navigation, sidebar, page container
  2. Primary view — hero, dashboard home, main landing section
  3. Secondary sections — features, pricing, settings
  4. Edge cases — empty states, loading, errors, mobile nav

Review in the browser after each step. Fix spacing and hierarchy before building the next layer.

Step 4: Review with a taste checklist

Before merging any Codex-generated UI:

  • Typography matches spec, hierarchy is clear
  • Colors come from tokens only
  • Spacing follows the defined grid
  • Icons are one set, one size
  • No unauthorized gradients or animations
  • Copy is specific, not AI filler
  • Responsive layout works on mobile

For the full checklist and capstone workflow, see How to Ship Tasteful UI with AI Coding Agents.

Codex UI prompts that work

Repo-native agents respond to file references and concrete scope. Vague prompts produce vague UI.

Component-level prompt

Follow DESIGN.md.

Build a pricing card component:
- Three tiers: Starter, Pro, Enterprise
- Pro tier highlighted with accent border
- Feature list with check icons (Lucide)
- CTA button per tier, primary on Pro only
- Use existing Card and Button components from src/components/ui
- Place in src/components/pricing-card.tsx

Page section prompt

Follow DESIGN.md.

Build the hero section for the landing page (src/app/page.tsx):
- Split layout: left copy, right product screenshot frame
- Headline: "[your specific value prop]"
- Subhead: one sentence, concrete benefit
- Single primary CTA
- Do not modify other sections on the page

Refactor prompt

Follow DESIGN.md.

Refactor src/components/dashboard/stats-cards.tsx:
- Replace hardcoded colors with token variables from DESIGN.md
- Normalize padding to p-6 on all cards
- Remove shadow-lg, use border only
- Do not change component logic or data fetching

Scoped prompts with file paths produce reviewable diffs. "Make the dashboard look better" produces chaos.

Pairing Codex with design resources

Codex does not browse the web for inspiration during a task. You bring design resources into the repo or paste them into the prompt.

DESIGN.md from templates

The highest-leverage resource is a complete spec. The Agent's Design gallery provides agent-ready UI templates with DESIGN.md files and prompts built for coding agents like Codex.

Workflow:

  1. Pick a template that matches your product type
  2. Copy DESIGN.md into your project root
  3. Customize tokens for your brand
  4. Copy the template prompt into your first Codex UI session
  5. Build one section at a time, referencing @DESIGN.md

Reference components in your repo

If you have existing components that look right, point Codex at them:

Match the visual style of src/components/marketing/hero.tsx when building the features section. Same spacing, typography, and card treatment.

Codex learns from your codebase better than from adjectives.

Codex vs. full-app vibe coding tools for UI

DimensionCodexLovable / Bolt
Starting pointExisting repoBlank project
Design spec locationDESIGN.md in repoPasted in chat
PreviewDev server / browserBuilt-in editor
Full app scaffoldingYou structure the projectAgent scaffolds
Style consistencyStrong with spec in repoStrong with spec in chat
Handoff to productionDirect — already in repoExport required
Best forProduction UI in real codebasesRapid prototypes and MVPs

Many teams prototype in Lovable or Bolt, then rebuild or refine in a repo with Codex and a DESIGN.md spec. The spec transfers — paste the same tokens and component rules.

For tool comparisons across the repo-native category, see Cursor vs Claude Code vs v0 for UI Design.

Avoiding slop in Codex UI sessions

Persist rules across sessions

Add design constraints to your project's agent instructions file (AGENTS.md, CLAUDE.md, or equivalent):

UI rules:
- Always follow DESIGN.md
- No purple gradients
- No emoji icons
- No lorem ipsum
- One animation style per project

Codex reads these on every task. You do not repeat bans in every message.

Reject wide diffs

If Codex changes unrelated files while building one component, revert and rescope:

"Only modify src/components/pricing-card.tsx. Do not touch other files."

Do not skip existing components

If your project uses shadcn, HeroUI, or a custom library, say so:

"Use shadcn Button, Card, and Input from src/components/ui. Do not create new primitive components."

Reinventing primitives produces inconsistent styling.

Review copy, not just layout

Codex writes confident placeholder copy by default. Replace:

  • "Unlock the power of..." → specific benefit
  • "Seamlessly integrate..." → what it actually does
  • "Take your X to the next level" → measurable outcome

Start with a spec in your repo

Codex will build whatever your codebase allows. The question is whether what it builds looks like your product or like default shadcn with purple accents.

Browse the Agent's Design gallery for templates with DESIGN.md files and prompts designed for coding agents — typography, tokens, components, and anti-patterns ready to drop into your project.

Paste the spec once. Reference it every session. Spend your iteration budget on features, not on re-deciding fonts.

Ship the next screen with taste

Browse agent-ready templates, DESIGN.md specs, and prompts in the gallery — then paste into Cursor, Claude Code, or v0.

Keep reading