Codex CLI 最佳实践

★ 954Agentic Engineering
GitHub repo
#codex#best-practice#cli

Overview

A 'from vibe coding to agentic engineering' best-practice repo for OpenAI's Codex CLI — the sibling project to claude-code-best-practice by the same author (shanraisshan), porting the entire 'best practice + implementation' system to Codex CLI. Every concept pairs a best-practice doc with runnable config under .codex/, alongside 50 community tips, multiple development workflows and one orchestration workflow example — its slogan is 'practice makes codex perfect'.

Who it's for

Developers already using Codex CLI — or coming over from Claude Code — who want to push terminal AI coding from vibe coding to agentic engineering.

What you'll learn

  1. 01What it is: Codex CLI best practice, sibling of claude-code-best-practice

    Author shanraisshan maintains both claude-code-best-practice (Claude Code) and this repo (Codex CLI) as two vehicles for the same methodology — the repos cross-reference each other and even ship a cross-model (Claude Code + Codex) workflow. Badges mark each capability as best-practice / implemented / orchestration-workflow / codex / community. It is explicit that Codex CLI does not yet support custom commands (.codex/commands/), so the full Command → Agent → Skill pattern from the Claude Code repo cannot be ported verbatim.

  2. 02Concept map: the Commands / Subagents / Skills trio + ecosystem

    Built-in slash commands cover /plan, /fast, /fork, /review, /status, /mcp, /agent, /apps, /model, /permissions and more for session control; Subagents live in .codex/agents/<name>.toml under [agents.<name>] with dedicated role configs, supporting parallel orchestration (globals like max_threads, max_depth); Skills are .agents/skills/<name>/SKILL.md, auto-discovered via name + description frontmatter with progressive disclosure through scripts/, references/ and assets/. Around them: Plugins / Marketplace for distributable bundles, Memories for cross-session memory, MCP Servers, AGENTS.md (project context, 32 KiB cap, AGENTS.override.md for personal overrides), Hooks and /review code review.

  3. 03Every concept comes as 'best practice + implemented' pairs

    This is the learning method inherited directly from claude-code-best-practice: the best-practice/ folder explains 'how and why', while .codex/ provides drop-in config implementations, with badges telling them apart at a glance. The repo also ships one orchestration workflow example: an agent fetches temperature from Open-Meteo and invokes an SVG-creating skill to produce a weather card — demonstrating the full Agent → Skill chain.

  4. 04Development workflows: converging on Research → Plan → Execute → Review → Ship

    The repo decomposes major community workflows onto one spine: Superpowers (brainstorming → writing plans → subagent-driven development → TDD → requesting code review), Spec Kit, gstack (multi-level review then implement), Get Shit Done, oh-my-codex and Compound Engineering — yellow tags mark sub-loops that repeat inside a parent step. A cross-model workflow uses Claude Code for plan and implementation review while Codex executes, playing to each tool's strengths.

  5. 0550 tips: turning experience into daily habits

    Tips span thirteen categories: Prompting, Planning, AGENTS.md, Agents, Skills, Hooks, Memories, Workflows, Git/PR, Debugging, Utilities and Daily. High-frequency lessons include: write AGENTS.md so any developer can launch Codex, say 'run the tests' and have it work first try; the skill description is a trigger, not a summary (write it for the model, not for humans); use multi-agent with separate context windows — one agent can cause bugs and another can find them; use hooks for security scanning and formatting fallback; prefer iTerm/Ghostty/tmux terminals over IDEs; keep PRs small, squash-merge and commit often.

Practice tips

  • Copy the repo's .codex/ directory into your own project and read each best-practice doc + implemented config as a pair — land the implementation first, then revisit the theory.
  • For one multi-step task, use /plan to build a phased, gated plan with tests, execute it step by step, and compare against a one-line prompt.
  • Create a skill with name + description frontmatter (scaffold it with the built-in $skill-creator), solidify recurring work and add a Gotchas section.
  • Work through the AGENTS.md and Skills tips, then rewrite your own AGENTS.md to stay lean (~150 lines as a heuristic, 32 KiB byte cap).

Companion workflows

Related resources