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:
npx @layoutdesign/context install --target codexThis 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:
npx @layoutdesign/context export --format agents-mdManual setup
Step 1: Copy AGENTS.md to your project root
Copy AGENTS.md from your export bundle to the root of your project:
cp path/to/export/AGENTS.md AGENTS.mdStep 2: Commit to your repo
Commit the file. Codex reads it automatically on every task, with no further configuration required.
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:
AGENTS.md # global project rules (design system)
packages/
web/
AGENTS.override.md # web-specific rules (override the root)
mobile/
AGENTS.override.md # mobile-specific rulesThis 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:
npx @layoutdesign/context export --format codex-skillGlobal 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:
mkdir -p ~/.codex
cp path/to/export/AGENTS.md ~/.codex/AGENTS.md~/.codex/AGENTS.md are merged with project-level AGENTS.md files. Project rules take precedence when there is a conflict.