一键导入
codex
Use when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Create project-owned agent files (`.claude/agents/<name>.md`). Use when the user explicitly asks to create, add, scaffold, draft, or design a new agent, or when repeated conversation patterns or `git log` activity suggest the same workflow keeps being handled manually and should become an agent.
Audit and improve agent files (`.claude/agents/*.md`). Use when the user asks to check, audit, review, score, or improve agents, mentions "agent maintenance" or "agent quality", wonders which agents are missing or duplicated, wants to tighten tool allowlists, or wants to know if their agent descriptions trigger reliably.
Use when onboarding a repository to the AI workflow, when .ai/project.yaml has project_name: unknown, or when project metadata is incomplete or stale.
Maintain project-specific workflow metadata (project.yaml, memory.md, decisions.md) after bootstrap, CI changes, restructuring, or refresh requests—never alter the immutable core; also use when asked to consolidate, compact, or tighten memory/tokens.
Use when a development task has testable behavior and should be built test-first with independently verified failing-then-passing gates. Default route for medium/large TDD-able code tasks; non-testable tasks belong to the orchestrate skill.
Use when a coding request needs breaking into phases before implementation — any task larger than a tiny local edit (trivial is ~1 file, under 10 lines). Produces a minimal, executable plan with narrow execution packets. Normally dispatched by the orchestrator; invoke directly only when the user wants a plan without execution.
基于 SOC 职业分类
| name | codex |
| description | Use when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing |
| tools | Read, Bash, AskUserQuestion |
The exact invocation — command, flags, timeout <T>s wrapper, stderr redirect, and resume — lives in .ai/workflow/dispatch.md "Target = codex". Follow it verbatim; do not paraphrase it (paraphrase drift is a defect source). Skill-specific deltas:
2>/tmp/phase-<phase>-stderr.log, which the controller parses for tokens used). Never 2>/dev/null in controller mode — it breaks token-metrics capture.timeout <T>s per dispatch.md's Timeout convention — never launch without it.execute, rescue, maintenance, bootstrap) append --dangerously-bypass-approvals-and-sandbox; read-only plan/review omit it. When the controller (Claude Code) is sandboxed, the dispatch must also run outside the controller's sandbox — see dispatch.md "Controller sandbox bypass".codex exec resume --last, no config flags). A review send-back never resumes — it is a fresh write-capable execute dispatch.## Escalation block and exit non-zero (shape in .ai/packets/README.md). On success emit the work followed by a complete ## Handoff per .ai/packets/execute.md (validation evidence = one $ cmd / exit: / tail: <last 5 lines> block per validation command).Use AskUserQuestion once to ask for model (offer the codex models from the .ai/models.yaml catalog) and reasoning effort (xhigh, high, medium, or low). Use --skip-git-repo-check, -C <dir> when needed, and append 2>/dev/null unless debugging requires stderr.
For write-capable runs on Windows, prefer --dangerously-bypass-approvals-and-sandbox; ask permission first in direct mode. Pass the prompt via stdin from a temp file when quoting may be fragile.
After every direct codex command, use AskUserQuestion to confirm next steps, collect clarifications, or decide whether to resume. Restate the chosen model, reasoning effort, and sandbox mode when proposing follow-up actions.
Resume with a temp file: cat /tmp/codex-resume.md | codex exec resume --last 2>/dev/null && rm -f /tmp/codex-resume.md (no config flags on resume, per dispatch.md's Resume rule). The resumed session inherits the original model, reasoning effort, and sandbox mode unless the user explicitly changes them.
Treat Codex as a colleague, not an authority. Push back when output conflicts with known facts; verify recent APIs, model names, library behavior, and best practices against current docs or web research when needed.
When resuming to discuss a disagreement, identify yourself as Claude and include the evidence. Frame the disagreement as a peer review, then let the user decide when ambiguity remains.
Stop and report failures whenever codex --version or codex exec exits non-zero. In direct mode, summarize stderr or partial output and use AskUserQuestion before retrying or changing flags.
Before high-impact flags such as --full-auto, --sandbox danger-full-access, or --skip-git-repo-check, ask permission unless the user already granted it. Warn clearly when Codex output is partial or uncertain.