OpenAI Codex
OpenAI Codex は CLI タスクでもクラウドタスクでも AGENTS.md を自動的に読み込みます。AGENTS.md から DESIGN.md を参照することで、UI 編集のルールをエンジニアリング指示やビルドコマンドから分離して管理できます。
DESIGN.md の配置場所
my-app/
├── DESIGN.md
├── AGENTS.md
└── src/AGENTS.md に DESIGN.md を接続する
AGENTS.md はアーキテクチャ、テスト、タスクルーティングに集中させ、ビジュアル上の意思決定は 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.ビジュアルルールを AGENTS.md から分離することで Lint とプロンプト効率の双方が向上する理由については、DESIGN.md vs AGENTS.md vs CLAUDE.md を参照してください。
DesignMD Pro MCP サーバーを接続する
Codex CLI では、~/.codex/config.toml で Streamable HTTP MCP サーバーを構成します。
# Public read-only access (30 requests/minute per IP)
[mcp_servers.designmdpro]
url = "https://designmdpro.app/mcp"アカウント → API キー で発行した Pro API キー(dmdp_…)を使用する場合は、シェル環境に DESIGNMDPRO_API_KEY をエクスポートし、bearer_token_env_var で渡すことで設定ファイルに平文シークレットを残さないようにします。
[mcp_servers.designmdpro]
url = "https://designmdpro.app/mcp"
bearer_token_env_var = "DESIGNMDPRO_API_KEY"シェルタスクで生 Markdown 経由で仕様を取得する
MCP が未構成でも外部 HTTP アクセスが可能な環境で Codex を実行する場合は、生 .md エンドポイントを直接取得します。
curl -fsSL https://designmdpro.app/websites/linear.md -o DESIGN.md
npx --yes @google/design.md lint DESIGN.mdプロンプトテンプレート
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.よくある落とし穴
- デザイン トークンを
AGENTS.mdに直接混ぜる:AGENTS.mdにインライン記述した文章は@google/design.md lintで検証できず、コードジェネレーターからもエクスポートできません。 - スコープ未指定の指示で非 UI タスクが重くなる:バックエンドマイグレーションやスクリプト作業ではなく UI パス限定で
DESIGN.mdを読み込むよう、AGENTS.mdのポインター表現を明確にしてください。
次のステップ
- MCP Server リファレンス — 全 4 ツールとレート制限ティア
- REST API & Markdown —
/websites/<slug>.mdを直接取得する - AI エージェント向けの記述 — 複数ファイル編集でも維持されるルールの書き方
Last updated on