OpenAI Codex

Codex reads AGENTS.md, an open standard context file supported by Codex, Cursor, Google Jules, Factory, Amp, and other agents that follow the agents.md spec. Set it up once and it works across all compatible tools.

Fastest path: the CLI

The CLI does the whole Codex setup in one command:

bash
npx @layoutdesign/context install --target codex

This registers the Layout MCP server in your Codex config and creates AGENTS.md when it does not exist yet, populated from your loaded kit. You can also emit the file on its own at any time:

bash
npx @layoutdesign/context export --format agents-md

Manual setup

Step 1: Copy AGENTS.md to your project root

Copy AGENTS.md from your export bundle to the root of your project:

bash
cp path/to/export/AGENTS.md AGENTS.md

Step 2: Commit to your repo

Commit the file. Codex reads it automatically on every task, with no further configuration required.

That's it. Codex will follow the design system rules in every UI component it generates. The same file is also read by Cursor, Google Jules, Factory, and Amp. One file covers all of them.

Advanced: subdirectory overrides

In a monorepo or multi-package project, you can add more specific rules closer to the code. Any AGENTS.override.md file takes precedence over AGENTS.md at the same directory level:

text
AGENTS.md                     # global project rules (design system)
packages/
  web/
    AGENTS.override.md        # web-specific rules (override the root)
  mobile/
    AGENTS.override.md        # mobile-specific rules

This lets you set global design system rules at the root while overriding specific behaviour for packages that have different conventions. For example, a mobile package using React Native styling instead of CSS custom properties.

Codex skill

For deeper integration, export your design system as a Codex Agent Skill: a .codex/skills/<kit-name>/SKILL.md folder with the token summary and component pointers Codex loads on demand. Generate it from the CLI or tick Codex skill in the Studio export modal:

bash
npx @layoutdesign/context export --format codex-skill
AGENTS.md gives Codex your rules on every task; the skill adds a structured reference it can pull in when it is actually building UI. Ship both for best results.

Global instructions

To apply your design system across all Codex sessions regardless of which project you are working in, copy AGENTS.md to the global Codex config directory:

bash
mkdir -p ~/.codex
cp path/to/export/AGENTS.md ~/.codex/AGENTS.md
Global instructions in ~/.codex/AGENTS.md are merged with project-level AGENTS.md files. Project rules take precedence when there is a conflict.