workflow · 4 min read · 한국어 · Français

Codex design guide: how to get good-looking sites from Codex

A Codex design guide is about the look of the site, not the steps for launching it. To get good-looking pages from Codex, put durable design rules in AGENTS.md, give Codex a real reference and a token file, and review the rendered UI with screenshots. Build and deploy are a separate article: how to build a website with Codex. The same design workflow for Claude Code, with CLAUDE.md instead of AGENTS.md, is in the Claude Code design guide.

Codex design guide: the AGENTS.md file

The rules belong in a file Codex reads before it starts work, not only in the first prompt.

Put design rules in AGENTS.md

Codex reads AGENTS.md files before doing any work. OpenAI's docs describe a chain of files: a global file in your Codex home directory (defaults to ~/.codex/AGENTS.md), then project files from the repository root down to the current directory. Files closer to the current directory override earlier guidance. Official source: Custom instructions with AGENTS.md (checked 25 Nov 2026).

Use the project-root AGENTS.md for design rules the whole repo should follow. OpenAI's prompting and customisation docs say to keep this file small and to put in it the rules you want applied every time, such as conventions and review expectations (Customization, checked 25 Nov 2026). Combined project guidance is capped at 32 KiB by default (project_doc_max_bytes); raise the limit or split files if you hit it, as the AGENTS.md page describes.

A short example of design rules in that format (this is an example, not an OpenAI quote):

# AGENTS.md

## Design rules

- Follow the reference in /docs/design and the tokens in /src/styles/tokens.css. Don't invent fonts, colours or motion.
- Use only the typefaces and sizes in the token file.
- Palette: background, text, one accent, neutrals, all from tokens.
- Spacing comes from the token scale. No one-off values in components.
- Motion only as described in the reference. Honour prefers-reduced-motion.
- When a change is requested, edit one section and leave the rest alone.

OpenAI also suggests you add a rule when the agent makes the same mistake more than once, and that you can ask Codex to update AGENTS.md so the fix persists. The /init command can generate an AGENTS.md from the repository; treat that as a starting point and then write the design rules in yourself (Iterating development workflows with Codex, checked 25 Nov 2026).

To confirm Codex has loaded the file, the official docs show:

codex --ask-for-approval never "Summarize the current instructions."

Give Codex a real reference

AGENTS.md tells Codex what not to invent. It still needs one finished design to follow: a template, a Figma file, or screenshots of the approved page. Point at that reference in the first message of the session, and keep the token file in the repo so the rules have values to bind to.

If you start from one of our templates, copy the prompt written from that design into Codex once, then let AGENTS.md carry the rules into later sessions. For how Codex and Claude Code compare on website work, see Codex vs. Claude Code for building websites.

A design-system file Codex can follow is the same idea as in the Claude Code guide: named tokens for colour, type, spacing, radii and motion, in a file such as src/styles/tokens.css, with AGENTS.md pointing at it. When a review introduces a one-off value, either promote it into the token file or take it out.

Review the UI with image inputs

Codex can take screenshots as image inputs. Official options, from Image inputs (checked 25 Nov 2026):

  • In the CLI, pass one or more files:
codex -i screenshot.png "Explain this error and suggest the smallest fix"
codex --image before.png,after.png "Compare these states and list the regressions"
  • Codex accepts common formats including PNG and JPEG. For several images, separate paths with commas or repeat --image.
  • In the ChatGPT desktop app or the IDE extension, attach, paste or drag an image into the prompt composer (Shift-drag in the extension, so the drop is accepted as context).

OpenAI's guidance is to name what the image shows, point to the area that matters, and state the outcome and the constraints. Their own example is in that vein: compare a screen with the design, fix spacing and typography only, don't change behaviour, and verify with a new screenshot.

A design review loop against that guidance:

  1. Open the page at the width you're checking and capture one section, or that section next to the reference.
  2. Attach the image (or two images, before and after).
  3. Say what to inspect, what to change, and what must stay the same.
  4. Check the new screenshot before you move to the next issue.

For the wider habit of stating a goal, useful context and boundaries in a Codex prompt, see OpenAI's Prompting guide (checked 25 Nov 2026). The /review command in the CLI is for reviewing code in the working tree, not a substitute for looking at the UI.

Each of our templates comes with a prompt for Claude, Codex or Cursor written from the finished design. A free account lets you copy prompts from up to three different free templates in any 24 hours, for personal projects. Monthly and yearly plans add the Vite + React project, the exact site from the preview, and a Figma file where the template has one, for commercial and client work, and prices depend on the country you pay from (pricing).

Start from a template with the design decided →

FAQ

Where do I put design rules for Codex?

In a project AGENTS.md, which Codex reads before it starts work. Global defaults can live in ~/.codex/AGENTS.md. Official discovery order and limits are in Custom instructions with AGENTS.md.

Can Codex check a website against a design screenshot?

Yes. Attach or pass the screenshot with -i / --image, name the section, and say what to fix and what not to change. Official steps are in Image inputs.

Is this the same as how to build a website with Codex?

No. This guide is the design-rules and review workflow. The steps for launching are in how to build a website with Codex.

Do I need a different prompt style for Codex than for Claude?

The official Codex advice is still a clear goal, useful context and boundaries, in ordinary language. For the look of a site, the difference that matters is the reference and the rules you give it, not a special formula of adjectives.