OpenAI Codex
OpenAI Codex reads AGENTS.md automatically across both CLI and cloud tasks. Point AGENTS.md to DESIGN.md so UI edits stay separated from engineering instructions and build commands.
Where to place DESIGN.md
my-app/
├── DESIGN.md
├── AGENTS.md
└── src/Wire DESIGN.md into AGENTS.md
Keep AGENTS.md focused on architecture, testing, and task routing, and delegate visual decisions to DESIGN.md:
## UI & Styling
Before modifying files under `src/app/` or `src/components/`, read `DESIGN.md`
in the repository root. Follow its YAML tokens and prose rules (`Colors`,
`Typography`, `Layout`, `Components`, `Do's and Don'ts`). Do not introduce
arbitrary hex values or shadow styles outside the specification.See CLAUDE.md vs AGENTS.md vs DESIGN.md for why keeping visual rules out of AGENTS.md improves both linting and prompt efficiency.
Connect the DesignMD Pro MCP server
In Codex CLI, configure Streamable HTTP MCP servers in ~/.codex/config.toml:
# Public read-only access (30 requests/minute per IP)
[mcp_servers.designmdpro]
url = "https://designmdpro.app/mcp"With a Pro API key (dmdp_… from Account → API Keys), export DESIGNMDPRO_API_KEY in your shell environment and pass it via bearer_token_env_var so the secret never lives in plaintext inside config files:
[mcp_servers.designmdpro]
url = "https://designmdpro.app/mcp"
bearer_token_env_var = "DESIGNMDPRO_API_KEY"Fetching specs via raw Markdown in shell tasks
When running Codex in environments with outbound HTTP access but without MCP configured, fetch raw .md endpoints directly:
curl -fsSL https://designmdpro.app/websites/linear.md -o DESIGN.md
npx --yes @google/design.md lint DESIGN.mdPrompt templates
Read DESIGN.md first. Implement the API key management card in src/components/
using the defined surface, border, typography, and button-primary tokens. Run
type-check after editing.Use the designmdpro MCP server to call search_websites and get_design_md
(sections: ["Colors", "Typography", "Do's and Don'ts"]) for a developer-tools
reference, then align our DESIGN.md contrast pairs and validate with the CLI.Common pitfalls
- Mixing design tokens directly into
AGENTS.md: inline prose inAGENTS.mdcannot be validated with@google/design.md lintor exported by code generators. - Unscoped instructions slowing non-UI tasks: phrase the
AGENTS.mdpointer so Codex loadsDESIGN.mdspecifically for UI paths rather than backend migrations or scripts.
Next steps
- MCP Server Reference — all four tools and rate-limit tiers
- REST API & Markdown — fetching
/websites/<slug>.mddirectly - Writing for AI Agents — writing rules that survive multi-file edits