Reference knowledge for OpenAI Codex CLI compatibility. Describes how Codex discovers agents and skills so Forge can interoperate. DO NOT create files from this skill — it is reference material only.
REFERENCE ONLY. Do NOT create
AGENTS.md,AGENTS.override.md,SKILLS.md, or.agents/on your own initiative. NXTG-Forge delivers agents and skills through the Claude Code plugin system, not Codex-style files. Only scaffold Codex files when the user explicitly asks to add Codex support (see the worked example below).
Codex builds one instruction chain per run by concatenating files from two layers, joined by blank lines — it does NOT pick a single "winning" file:
~/.codex, or $CODEX_HOME): reads AGENTS.override.md if present, else
AGENTS.md. First non-empty file at this level only.AGENTS.override.md, then
AGENTS.md, then any name in project_doc_fallback_filenames (config-driven). All matched files
are concatenated root-first.A nested AGENTS.md in a subdirectory adds to (does not replace) the root one — closer files
come later in the concatenation, so they refine rather than override.
Rough Claude Code analogues (not 1:1 — see Gotchas):
CLAUDE.md ↔ AGENTS.md (repo-wide instruction file).claude/agents/*.md ↔ persona/role blocks written inline in AGENTS.md.claude/skills/*/SKILL.md ↔ .agents/skills/*/SKILL.mdCodex reads skills from repository, user, admin, and system locations. For a repo, it scans
.agents/skills in every directory from the current working directory up to the repo root.
Each skill is a folder with a SKILL.md:
.agents/skills/
skill-name/
SKILL.md # YAML frontmatter (name, description) + instructions
Codex uses the same progressive-disclosure model as Claude Code: it loads each skill's name,
description, and file path up front, and only reads the full SKILL.md body when it decides to
use that skill. So a good Codex description is a routing rule, exactly as in this plugin.
When a project must support BOTH Claude Code (via Forge) and Codex CLI:
AGENTS.md, .agents/skills/..claude/governance.json (the governance-mcp state file) for
project context. This is the safe common denominator; no cross-tool code coupling.AGENTS.md. The two runtimes have
different capabilities; a copied agent misleads more than it helps.Input: user says "make this repo work with Codex CLI too."
Action:
CLAUDE.md / .claude/governance.json for existing project context.AGENTS.md at repo root — role, prime directive, stack assumptions,
output contract, quality gates. Point it at .claude/governance.json for shared state. Do NOT
paste Forge agent definitions into it..agents/skills/<name>/SKILL.md with name +
description frontmatter. Keep them separate from Forge's skills/ — different runtime.Output: a Codex-native AGENTS.md (+ optional .agents/skills/) that coexists with, and does not
duplicate, the Forge plugin.
| Aspect | Claude Code (Forge) | Codex CLI |
|--------|---------------------|-----------|
| Instruction file | CLAUDE.md (imports, memory) | AGENTS.md (concatenated home + project chain) |
| Agent definitions | Plugin agents/*.md | Inline persona blocks in AGENTS.md |
| Skills | Plugin skills/*/SKILL.md | .agents/skills/*/SKILL.md (scanned up-tree) |
| Skill loading | Progressive (name/desc first) | Progressive (name/desc/path first) |
| Project config | CLAUDE.md + governance.json | AGENTS.md + config.toml |
| Plugin/marketplace | Yes | No (repo/user/admin/system dirs) |
| Multi-agent | Agent Teams (Task tool) | Sequential |
AGENTS.md refines the root file; both
are included. Don't assume the deepest file "wins" — write nested files as additive refinements.
The only true override is AGENTS.override.md (or config project_doc_fallback_filenames).AGENT.md (singular) is NOT a Codex default. The Codex override file is AGENTS.override.md;
singular AGENT.md only works if added to project_doc_fallback_filenames. Prior versions of this
skill listed AGENT.md as a first-class location — that was wrong.AGENTS.md maps to CLAUDE.md in role only. Claude's
.claude/agents/*.md are separately-dispatchable subagents; Codex has no equivalent — its
"agents" are prose personas inside one instruction chain. Don't promise Task-style parallelism.AGENTS.md. Only do so on an explicit request..agents/skills/*/SKILL.md you author.Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer