codex
Skill232 starsChanged 44 days agoMITView on GitHub
当用户明确要求直接操作 Codex CLI 作为后台代理(自选 sandbox、codex review、apply、resume 等原生命令,或用 git worktree 并行布置多个 worker)做代码分析、编辑、审查时使用。普通的“让 Codex 或 GPT-6 写代码、调研、review”派单走 agent-fleet(fleet code);图片生成与网站视觉素材走 imagegen。
135 other projects use a version of this.
Adopted by
Most recently taken up by
- holylight1979/AtomicMemory-ClaudeCodetheir own version, first seen Nov 8, 2026
- mxrsv/agents-skillstheir own version, first seen Nov 8, 2026
- hemal08ce094/DesignSkillsSwiftUItheir own version, first seen Nov 8, 2026
- choughton/feature-design-prompt-templatestheir own version, first seen Nov 8, 2026
- hurleywgly/skillstheir own version, first seen Nov 8, 2026
- puck-muling/peer-agenttheir own version, first seen Nov 8, 2026
Used with
Projects with it also use ios-sync, compare-screenshots and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Saqlain-811Skillios-sync
Regenerate the iOS debug bridge against the latest upstream gstack templates. (gstack)
Also in 6 projects that use this
transitive-bullshitSkillcompare-screenshots
Compare screenshots against the intended design, distinguishing approved references from historical baselines. Use for iterative implementation matching, before/after visual review, objective image telemetry, or checking a lone capture for flat, empty, or badly framed content.
Also in 5 projects that use this
dzhngSkillimplement-spec-with-codex
Run [implement-spec](../implement-spec/SKILL.md) with Codex doing the implementation passes while you orchestrate, integrate, and review. Use when the user asks to implement a spec with Codex, or to run implement-spec with Codex as the implementer.
Also in 4 projects that use this
Saqlain-811Skillios-clean
Remove the DebugBridge SPM package and all #if DEBUG wiring from an iOS app. (gstack)
Also in 5 projects that use this
john-data-chenSkilltouchdesigner-mcp
Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.
Also in 7 projects that use this
math-incSkillminecraft-modpack-server
Set up a modded Minecraft server from a CurseForge/Modrinth server pack zip. Covers NeoForge/Forge install, Java version, JVM tuning, firewall, LAN config, backups, and launch scripts.
Also in 5 projects that use this
- +1 more from Saqlain-811
Other versions135 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 135
- NousResearch/hermes-agent★ 262ksame name
- garrytan/gstack★ 141ksame name
- dzhng/jevgrep★ 3.2ksame name
- ispc/ispc★ 3ksame name
- bergside/awesome-design-skills★ 2.9ksame name
- dataplat/dbatools★ 2.9ksame name
- Lilac-Labs/gini-agent★ 1.9ksame name
- Open-Curiosity/gini-agent★ 1.9ksame name
- dzhng/skills★ 1.5ksame name
- clice-io/clice★ 1.4ksame name
125 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 3 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 111 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Never block the main conversation on a
codex execcall: Always launch via Bash with run_in_background: true. - Distinctive: line 22
Write the prompt to a temp file: when it's non-trivial (multi-line, contains quotes, long context).
- Very specific: line 32
Always pass
--skip-git-repo-check: Put all flags between exec and resume (if resuming). - Very specific: line 36
When the background shell finishes, the harness notifies you.
- Distinctive: line 37
If the user asks for status mid-run, read the current buffer once and summarize progress.
- Very specific: line 39
After completion, tell the user they can resume with: codex resume <tag> → you will run echo "<new prompt>" | codex exec …
- Very specific: line 49
Edit collisions: never run two workspace-write Codex workers against the same files concurrently.
- Distinctive: line 75
If a background worker exits non-zero, read its tail output, summarize the failure, retry at most once after diagnosing, and if it still …
- Very specific: line 103
Check with codex --version.
“Common” is measured: kept by at least 6 in 10 of the 111 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codex 后台代理
用 Codex CLI 承接用户指定的代码分析、编辑、审查或并行代理任务。图片生成的当前流程见 imagegen/SKILL.md;旧版操作与实验记录保存在 references/image-experiments.md。
路由前提:按全局 CLAUDE.md §2,编码、修 bug、调研与 review 默认用 fleet code(gpt-6.1-sol,见 agent-fleet),不手写 codex exec。本 Skill 只在用户明确要求直接操作 Codex CLI(自选 sandbox、codex review/apply/resume 等原生子命令、并行 worker 的 worktree 布置)时使用;简单派单不要先读本文件。
Core Principle
Never block the main conversation on a codex exec call. Always launch via Bash with run_in_background: true. The only exception is a trivial codex --version health check.
Launching a Codex Sub-Agent
- Pick reasoning effort + sandbox from context — do not interrupt the user with
AskUserQuestionunless they explicitly ask to be prompted. Model isgpt-6.1-sol(the default in~/.codex/config.toml; pass-monly when the user names another model in the current request). Defaults:- Reasoning effort:
medium;lowfor single-file edits with clear boundaries. Never escalate tohigh/xhighon your own (global §2); only when the user asks for it explicitly - Sandbox:
read-onlyunless the task clearly needs edits (workspace-write) or network (danger-full-access)
- Reasoning effort:
- Write the prompt to a temp file when it's non-trivial (multi-line, contains quotes, long context). Pipe it via stdin so quoting never breaks:
cat /tmp/codex-prompt-<tag>.md | codex exec --skip-git-repo-check \ --config model_reasoning_effort="medium" \ --sandbox read-only \ -C <workdir> 2>/dev/null - Launch with
run_in_background: true. Record the returned shell id and a short tag (e.g.codex-review,codex-refactor-auth) so you can reference it later. - Report the launch to the user in one line — e.g. "Launched Codex sub-agent
codex-review(medium effort, read-only) in background." Then continue with other work or wait for user input. Do NOT sit and poll. - 默认加
2>/dev/null压低 stderr 噪音;排查启动失败或调试 CLI 时保留错误输出。 - Always pass
--skip-git-repo-check. Put all flags betweenexecandresume(if resuming).
Checking Results
- When the background shell finishes, the harness notifies you. Read its output with
BashOutput(orReadon the captured log file) — do not re-run the command. - If the user asks for status mid-run, read the current buffer once and summarize progress; don't busy-loop.
- Summarize Codex's findings in the main thread in a few sentences. Link file:line references so the user can jump directly.
- After completion, tell the user they can resume with:
codex resume <tag>→ you will runecho "<new prompt>" | codex exec --skip-git-repo-check resume --last 2>/dev/null(no other flags on resume; session inherits model/effort/sandbox).
Agent Teams (Parallel Codex Workers)
Codex sub-agents compose cleanly. To run an agent team:
- Split the task into independent slices (e.g. "review auth layer", "review billing layer", "draft migration", "write tests"). Dependent steps must stay sequential.
- For each slice, write a prompt file and launch a separate background
Bashcall in the same message (parallel tool calls). Give each a distinct tag and, if they write, a distinct-Cworkdir or separate git worktree to avoid edit collisions. - Track the set: tag → shell id → one-line goal. Keep this list short in the user-facing update.
- As workers finish, fold their findings into a single synthesis. If two workers disagree, surface the disagreement explicitly instead of silently picking one.
- Edit collisions: never run two
workspace-writeCodex workers against the same files concurrently. Either serialize them, scope them to disjoint directories, or run each in its owngit worktree.
Team composition guidance
- Reviewer team: multiple
read-onlyworkers, each with a different lens (security, perf, API design). Cheap and fully parallel. - Builder + reviewer: one
workspace-writeworker implements, then aread-onlyworker reviews the diff. Sequential, not parallel. - Independent review: maker and checker must be different executors. Have another read-only
gpt-6.1-solworker (fleet code --review) check the diff against the brief (global §4.3). Do not pair a Codex worker with a Claude sub-agent as the reviewer.
Model Selection
Default model: gpt-6.1-sol, which ~/.codex/config.toml already sets. Only add an explicit -m flag when the user asks for a different model by name in the current request.
Reasoning effort: medium (standard default) · low (single-file, clear boundaries). high and above are never chosen automatically; use them only on the user's explicit request.
Cached input is 90% off for 24h — reuse the same prompt prefix across workers when possible.
Do not ration Codex calls and set no turn, context or time cap (global §3). The owner's plan does not need protecting from extra workers; optimize for the right answer and run to the acceptance condition. A limit the user states explicitly always wins.
Error Handling
- 如果
codex --version或启动失败,先运行codex doctor并读取错误,最多重试一次;仍失败(含 402、登录失效、模型被拒、产物为空或含裸 tool-call 控制 token)就停下并如实告知用户,由用户决定。不许静默改派 Claude subagent,Claude subagent 也不得再派 Claude subagent。 - Sandbox flags need no permission prompt on this machine. The owner has granted
standing authorization for
--full-autoand--sandbox danger-full-access: it is their own single-user machine and they prefer agents to act rather than ask. Pick the sandbox the task needs and run. Still disclose it — the one-line launch report names the sandbox, so "no gate" never becomes "no visibility". Never useAskUserQuestionfor a sandbox flag. - If a background worker exits non-zero, read its tail output, summarize the failure, retry at most once after diagnosing, and if it still fails stop and tell the user. Exit code 0 is not acceptance: check the diff and artifacts.
CLI surface worth knowing (verified against codex-cli 0.147.0, 2026-08-22)
The skill used to describe exec as if it were the whole CLI. It is not. Commands that
change what you would reach for:
| Command | What it does | When it beats exec |
codex review | Non-interactive code review of the repo (also codex exec review) | A purpose-built reviewer — use it instead of hand-writing a "review this diff" prompt |
codex apply | Applies the agent's latest diff to the working tree via git apply | Lets a read-only worker propose changes you land separately — safer than workspace-write |
codex doctor | Diagnoses install, config, auth, runtime health | First move when a launch fails, before any retry |
codex fork | Forks a past session | Explore a variant without destroying the original thread |
codex resume / archive / delete / unarchive | Session lifecycle | Long-running work across days |
codex mcp / mcp-server | Manage MCP servers, or run Codex itself as one | Codex can be a tool for another agent |
codex cloud | Browse Codex Cloud tasks, apply locally (experimental) | Work started elsewhere |
codex update · codex features | Self-update; inspect feature flags | Check before assuming a capability is missing |
Two exec flags the recipes above should use more:
-o <FILE>/--output-last-message <FILE>— writes the agent's final message to a file. Prefer this over scraping stdout: stdout carries progress chatter, and parsing it is exactly the kind of silently-wrong extraction this workspace has been bitten by.--output-schema <FILE>— a JSON Schema constraining the final response shape. Use it whenever you need a structured result back, instead of asking for JSON in prose and hoping.
CLI Version
Check with codex --version. Default model gpt-6.1-sol is configured in ~/.codex/config.toml — do not override it unless the user explicitly requests a different model.
本 Skill 当前位于 yan-skills/codex/;安装位置和符号链接以实际工作树为准。
Anti-patterns
- Running
codex execin the foreground and making the user wait. - Calling
AskUserQuestionbefore every launch — decide from context. - Asking permission for a sandbox flag. Standing authorization exists on this machine; asking is friction, not safety. Disclose the sandbox in the launch line instead.
- Spawning parallel
workspace-writeworkers on overlapping paths. - Polling a background shell in a tight loop instead of waiting for the completion notification.
- Forgetting
2>/dev/nulland flooding the main thread with thinking tokens.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

