adamsardo

OpenAI Codex Sub Agents

開發程式設計v1.0.0
作者:adamsardo更新於 2026-05-17codex-sub-agents@clawhub_adamsardo/codex-sub-agents
程式碼生成程式碼審查#Code Review#Subagent#Coding

據 AlphaMoat 統計,截至 2026-10,OpenAI Codex Sub Agents 累計下載 8,586 次、獲 6 個星標,按累計下載量在本次參與排名的 10,914 個 AI 技能中排名第 3,235 位,在「開發程式設計」分類(1,069 個)中排名第 263 位。

列表預設按累計下載量排序,也可按星標排序;詳情頁排名按累計下載量計算。

累計下載
8586
星標
6
全站下載量排名
#3,235
全站前 30% · 「開發程式設計」前 25%
平台累計下載星標評論
ClawHub ↗64516-
SkillHub ↗85866—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

Codex CLI 在本機執行並擁有完整檔案系統訪問,需要 ChatGPT Plus/Pro/Business/Enterprise 訂閱;安裝用 npm i -g @openai/codex,認證可 codex login 走瀏覽器 OAuth 或用 API key。提供互動式 TUI 與非互動 codex exec(支援 --full-auto 自動批准工作區寫入、--json 輸出、-i 附圖),會話可 codex resume/--last/<SESSION_ID> 恢復;TUI 內有 /model(切換 gpt-5-codex、gpt-5)、/approvals、/review、/diff、/compact、/init、/mcp 等斜槓命令。審批模式分 Auto(預設,工作區內讀寫執行、區外詢問)、Read Only、Full Access(含網路的完整機器訪問,慎用);關鍵 flag 含 --cd、--add-dir、--sandbox、--search。與 Clawdbot 的整合有四種模式:直接 exec 呼叫、編碼子代理委派、CLI 後端回退、以及 codex mcp-server 把 Codex 作為 MCP 伺服器;認證自動從 ~/.codex/auth.json 同步,自定義提示詞放在 ~/.codex/prompts/。

資料釋出於 2026-10-27

可以用來做什麼

  • 把程式碼審查、重構或 CI 修復交給 Codex CLI
  • 在大型程式碼庫裡做探索、解釋與跨目錄修改
  • 讓 Clawdbot 以子代理或直接工具方式委派編碼工作

什麼時候用

  • 使用者要求改程式碼、修 CI/構建失敗、提交前審查或需要 GPT-5-Codex 的程式碼生成與工具呼叫能力時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

用 codex exec 修復 CI 的 lint 報錯
把這個元件重構成用 React Query 取數
對著這張設計稿實現這個功能

月度資料趨勢

累計下載8586
4963690988542026-05 · 累計下載 52312026-06 · 累計下載 54802026-07 · 累計下載 59172026-08 · 累計下載 61342026-09 · 累計下載 66562026-10 · 累計下載 858626-0526-0926-10
星標6
5672026-05 · 星標 62026-06 · 星標 62026-07 · 星標 62026-08 · 星標 62026-09 · 星標 62026-10 · 星標 626-0526-0926-10

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-108586—6
2026-096656—6
2026-086134+3.7%6
2026-075917+8.0%6
2026-065480+4.8%6
2026-055231—6

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

7.8 KB · ClawHub v1.0.0
---
name: codex-cli
description: "Use OpenAI Codex CLI for coding tasks. Triggers: codex, code review, fix CI, refactor code, implement feature, coding agent, gpt-5-codex. Enables Clawdbot to delegate coding work to Codex CLI as a subagent or direct tool."
---

# OpenAI Codex CLI Skill

Use OpenAI Codex CLI (`codex`) for coding tasks including code review, refactoring, bug fixes, CI repairs, and feature implementation. Codex CLI runs locally on your machine with full filesystem access.

## When to Use
展開全部(共 293 行)

- User asks for code changes, refactoring, or implementation
- CI/build failures need fixing
- Code review before commit/push
- Large codebase exploration or explanation
- Tasks requiring file editing + command execution
- When GPT-5-Codex model strengths are needed (code generation, tool use)

## Installation & Auth

Codex CLI requires ChatGPT Plus/Pro/Business/Enterprise subscription.

```bash
# Install
npm i -g @openai/codex

# Authenticate (opens browser for OAuth)
codex login

# Or use API key
printenv OPENAI_API_KEY | codex login --with-api-key

# Verify auth
codex login status
```

## Core Commands

### Interactive Mode (TUI)
```bash
codex                           # Launch interactive terminal UI
codex "explain this codebase"   # Start with a prompt
codex --cd ~/projects/myapp     # Set working directory
```

### Non-Interactive (Scripting)
```bash
codex exec "fix the CI failure"                    # Run and exit
codex exec --full-auto "add input validation"      # Auto-approve workspace writes
codex exec --json "list all API endpoints"         # JSON output for parsing
codex exec -i screenshot.png "match this design"   # With image input
```

### Session Management
```bash
codex resume               # Pick from recent sessions
codex resume --last        # Continue most recent
codex resume <SESSION_ID>  # Resume specific session
```

## Slash Commands (In TUI)

| Command | Purpose |
|---------|---------|
| `/model` | Switch model (gpt-5-codex, gpt-5) |
| `/approvals` | Set approval mode (Auto, Read Only, Full Access) |
| `/review` | Code review against branch, uncommitted changes, or specific commit |
| `/diff` | Show Git diff including untracked files |
| `/compact` | Summarize conversation to free context |
| `/init` | Generate AGENTS.md scaffold |
| `/status` | Show session config and token usage |
| `/undo` | Revert most recent turn |
| `/new` | Start fresh conversation |
| `/mcp` | List configured MCP tools |
| `/mention <path>` | Attach file to conversation |

## Approval Modes

| Mode | Behavior |
|------|----------|
| **Auto** (default) | Read/edit/run commands in workspace; asks for outside access |
| **Read Only** | Browse files only; requires approval for changes |
| **Full Access** | Full machine access including network (use sparingly) |

## Key Flags

| Flag | Purpose |
|------|---------|
| `--model, -m <model>` | Override model (gpt-5-codex, gpt-5) |
| `--cd, -C <path>` | Set working directory |
| `--add-dir <path>` | Add additional writable roots |
| `--image, -i <path>` | Attach image(s) to prompt |
| `--full-auto` | Workspace write + approve on failure |
| `--sandbox <mode>` | read-only, workspace-write, danger-full-access |
| `--json` | Output newline-delimited JSON |
| `--search` | Enable web search tool |

## Clawdbot Integration Patterns

### Pattern 1: Direct exec Tool
Call Codex from Clawdbot's exec tool for coding tasks:

```bash
# In Clawdbot session
exec codex exec --full-auto --cd ~/projects/medreport "fix the TypeScript errors in src/components"
```

### Pattern 2: Subagent Delegation
Spawn a coding subagent that uses Codex:

```json5
// In agents.defaults or per-agent config
{
  agents: {
    list: [
      {
        id: "coder",
        workspace: "~/clawd-coder",
        model: "openai-codex/gpt-5.2",  // Uses Codex auth
        tools: {
          allow: ["exec", "read", "write", "edit", "apply_patch", "process"]
        }
      }
    ]
  }
}
```

### Pattern 3: CLI Backend Fallback
Configure Codex as a text-only fallback:

```json5
{
  agents: {
    defaults: {
      cliBackends: {
        "codex-cli": {
          command: "codex",
          args: ["exec", "--full-auto"],
          output: "text",
          sessionArg: null  // Codex manages its own sessions
        }
      }
    }
  }
}
```

### Pattern 4: MCP Server Mode
Run Codex as an MCP server for other agents:

```bash
codex mcp-server  # Exposes Codex tools via stdio MCP
```

## Clawdbot Config: OpenAI Codex Provider

Use your ChatGPT Pro subscription via the `openai-codex` provider:

```json5
{
  agents: {
    defaults: {
      model: { primary: "openai-codex/gpt-5.2" },
      models: {
        "openai-codex/gpt-5.2": { alias: "Codex" },
        "anthropic/claude-opus-4-5": { alias: "Opus" }
      }
    }
  }
}
```

Auth syncs automatically from `~/.codex/auth.json` to Clawdbot's auth profiles.

## Code Review Workflow

```bash
# Interactive review
codex
/review  # Choose: branch, uncommitted, or specific commit

# Non-interactive
codex exec "review the changes in this PR against main branch"
```

## Multi-Directory Projects

```bash
# Work across monorepo packages
codex --cd apps/frontend --add-dir ../backend --add-dir ../shared

# Or in TUI
codex --cd ~/projects/myapp --add-dir ~/projects/shared-lib
```

## Custom Slash Commands

Create reusable prompts in `~/.codex/prompts/`:

```markdown
<!-- ~/.codex/prompts/pr.md -->
---
description: Prepare and open a draft PR
argument-hint: [BRANCH=<name>] [TITLE="<title>"]
---

Create branch `dev/$BRANCH` if specified.
Stage and commit changes with a clear message.
Open a draft PR with title $TITLE or auto-generate one.
```

Invoke: `/prompts:pr BRANCH=feature-auth TITLE="Add OAuth flow"`

## MCP Integration

Add MCP servers to extend Codex:

```bash
# Add stdio server
codex mcp add github -- npx @anthropic/mcp-server-github

# Add HTTP server
codex mcp add docs --url https://mcp.deepwiki.com/mcp

# List configured
codex mcp list
```

## Web Search

Enable in `~/.codex/config.toml`:

```toml
[features]
web_search_request = true

[sandbox_workspace_write]
network_access = true
```

Then Codex can search for current docs, APIs, etc.

## Best Practices

1. **Start with `/init`** to create AGENTS.md with repo-specific instructions
2. **Use `/review` before commits** for AI code review
3. **Set `/approvals` appropriately** — Auto for trusted repos, Read Only for exploration
4. **Use `--add-dir`** for monorepos instead of `danger-full-access`
5. **Resume sessions** to maintain context across coding sessions
6. **Attach images** for UI work, design specs, error screenshots

## Example Workflows

### Fix CI Failure
```bash
codex exec --full-auto "The CI is failing on the lint step. Fix all ESLint errors."
```

### Refactor Component
```bash
codex exec --cd src/components "Refactor UserProfile.tsx to use React Query instead of useEffect for data fetching"
```

### Implement Feature from Spec
```bash
codex exec -i spec.png --cd ~/projects/app "Implement this feature based on the design spec"
```

### Code Review PR
```bash
codex exec "Review the diff between main and feature/auth branch. Focus on security issues."
```

## Troubleshooting

| Issue | Solution |
|-------|----------|
| Auth fails | Run `codex logout` then `codex login` |
| Commands blocked | Check `/approvals`, may need `--full-auto` |
| Out of context | Use `/compact` to summarize |
| Wrong directory | Use `--cd` flag or check `/status` |
| Model unavailable | Verify subscription tier supports model |

## References

- [Codex CLI Overview](https://developers.openai.com/codex/cli)
- [Codex CLI Features](https://developers.openai.com/codex/cli/features)
- [Codex CLI Reference](https://developers.openai.com/codex/cli/reference)
- [Slash Commands Guide](https://developers.openai.com/codex/cli/slash-commands)
- [AGENTS.md Spec](https://agents.md)
- [Codex GitHub](https://github.com/openai/codex)

「開發程式設計」分類下的熱門技能

程式設計大神.Skill開發程式設計

【全棧能力】程式設計大神.Skill:面向複雜真實專案的高階全棧程式設計助手。不止生成程式碼,而是從一句目標接手陌生程式碼庫,拆解需求、補齊實現、追到根因、完成重構、聯調前後端,並把結果推進到能執行、能驗證、能交付。覆蓋 Web、後端、指令碼、iOS、安卓、鴻蒙 ArkUI、微信小程式及其他技術棧,支援中英文工程、疑難 Bug、跨模組任務和長任務續做;用構建、日誌、真實入口、裝置或介面證據說明結果。僅問概念時直接回答,要求落地時持續推進到驗收或明確阻塞。

↓ 1125.9萬★ 82u_42bbb65f
程式設計專家Pro.Skill開發程式設計

程式設計專家 Pro:融合程式設計專家 2.0.3 工程專題與程式設計大神的鴻蒙 ArkTS/ArkUI、微信小程式和小遊戲開發資料。用於專案實現、根因除錯、審查、重構、測試、架構效能分析及多端開發驗證。支援自然語言和 @專題標識,按任務讀取包內知識;只問概念時直接回答。

↓ 626.9萬★ 32user_47d655f0
程式設計專家.Skill開發程式設計

程式設計專家.Skill P8級程式設計助手,25年實戰經驗技能Skill,全棧:Java/Php網站/軟體專案、API設計、Bug診斷、程式碼生成、程式碼審查、重構、測試用例、效能基準、技術選型、文件生成、任務拆解、Spec驅動、Karpathy規範、CMS二次開發、前端設計、MySQL/Mariadb、專案知識圖譜,以及工程紀律層(根因除錯硬閉環、階段導航、事故復盤/SLO、威脅建模/供應鏈安全、生產就緒/漸進式釋出、AI編碼治理、面向Agent程式碼可讀性、LLM應用安全)。支援 @標識 顯式呼叫跳過路由。

↓ 600.7萬★ 378user_741dc82b
dev-expert開發程式設計

程式設計專家.Skill P8級程式設計助手,25年實戰經驗技能Skill,全棧:Java/Php網站/軟體專案、API設計、Bug診斷、程式碼生成、程式碼審查、重構、測試用例、效能基準、技術選型、文件生成、任務拆解、Spec驅動、Karpathy規範、CMS二次開發、前端設計、MySQL/Mariadb、專案知識圖譜,以及工程紀律層(根因除錯硬閉環、階段導航、事故復盤/SLO、威脅建模/供應鏈安全、生產就緒/漸進式釋出、AI編碼治理、面向Agent程式碼可讀性、LLM應用安全)。支援 @標識 顯式呼叫跳過路由。

↓ 528.1萬★ 32user_814dbe54
dev-expert-pro開發程式設計

程式設計專家 Pro:融合程式設計專家 2.0.3 工程專題與程式設計大神的鴻蒙 ArkTS/ArkUI、微信小程式和小遊戲開發資料。用於專案實現、根因除錯、審查、重構、測試、架構效能分析及多端開發驗證。支援自然語言和 @專題標識,按任務讀取包內知識;只問概念時直接回答。

↓ 104.7萬★ -user_814dbe54
程式設計專家 Pro開發程式設計

程式設計專家 Pro:融合程式設計專家 2.0.3 工程專題與程式設計大神的鴻蒙 ArkTS/ArkUI、微信小程式和小遊戲開發資料。用於專案實現、根因除錯、審查、重構、測試、架構效能分析及多端開發驗證。支援自然語言和 @專題標識,按任務讀取包內知識;只問概念時直接回答。

↓ 98.2萬★ 1user_28275a78
程式設計專家.Skill開發程式設計

程式設計專家.Skill P8級程式設計助手,25年實戰經驗技能Skill,全棧:Java/Php網站/軟體專案、API設計、Bug診斷、程式碼生成、程式碼審查、重構、測試用例、效能基準、技術選型、文件生成、任務拆解、Spec驅動、Karpathy規範、CMS二次開發、前端設計、MySQL/Mariadb、專案知識圖譜,以及工程紀律層(根因除錯硬閉環、階段導航、事故復盤/SLO、威脅建模/供應鏈安全、生產就緒/漸進式釋出、AI編碼治理、面向Agent程式碼可讀性、LLM應用安全)。支援 @標識 顯式呼叫跳過路由。

↓ 70.1萬★ 6user_613b33ea
Github開發程式設計

用 gh 命令列工具檢視 GitHub 上的 PR 檢查、工作流執行與 API 查詢的技能。

↓ 48萬★ 714Peter Steinberger

資料月份:2026-10 · 下載/星標數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。