Codex Auto 是一个 Bun/TypeScript CLI:先让分类器描述任务属性,再由确定性策略选择 Codex 模型角色、reasoning effort 与现有 Matt Pocock skill。
Auto owns routing. Skills own methodology.
请按以下顺序安装;完整的安装、仓库初始化、验证及升级说明见 安装与升级指南。codex-auto doctor 会检查同一组依赖并给出修复命令。
# 1. Bun
curl -fsSL https://bun.com/install | bash
# 2. Codex CLI;安装后运行 codex 完成登录
curl -fsSL https://chatgpt.com/codex/install.sh | sh
# 3. CodeGraph CLI 与 Codex MCP 配置
curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh
codegraph install --target codex --location global --yes
# 4. Matt Pocock skills
bunx skills@latest add mattpocock/skills --skill '*' --agent codex --global --yes进入每个目标代码仓库后,初始化 CodeGraph,并在首次使用 Matt skills 时让 Codex 执行 $setup-matt-pocock-skills 完成仓库级配置:
cd /path/to/target-repository
codegraph init当前里程碑从源码安装:
git clone <codex-auto-repository-url>
cd codex-auto
bun install
bun link
bunx skills@latest add . --skill auto --agent codex --global --yes然后在目标仓库验证:
codex-auto doctor# 默认:规划完成后,在 workspace-write 前暂停
codex-auto "add team invitations" --explain
# 批准并继续同一 durable run
codex-auto approve <run-id>
# 中断后恢复
codex-auto resume <run-id>
# 只显示保守路由,不启动 Codex
codex-auto run "add team invitations" --dry-run
# 已明确授权生成计划后的 workspace writes
codex-auto "add team invitations" --yes默认 SQLite ledger 位于 ~/.codex-auto/runs.sqlite。自动化和测试可用 CODEX_AUTO_HOME 改写位置;模型 ID 可分别通过 CODEX_AUTO_MODEL_LUNA、CODEX_AUTO_MODEL_TERRA、CODEX_AUTO_MODEL_SOL 覆盖。
Benchmarks compare a complete Auto route with one direct Codex run from fresh worktrees at the same commit. The first command records an approval-gated benchmark; it never merges either candidate.
codex-auto benchmark task \
"Isolate each Codex stage's skills and plugin context" \
--repo . \
--base HEAD \
--verify "bun run check"The command returns a durable ID in awaiting_approval. Inspect the planned participant count, then explicitly run codex-auto benchmark approve <benchmark-id> to permit temporary candidate writes. See benchmarking.md for the full operator workflow.
flowchart TD
U[Task] --> C[Luna medium classifier]
C --> P{Deterministic policy}
P -->|ambiguity >= 6| G[grilling · Terra high]
P -->|repo research| I[founding-engineer · Luna/Terra high]
P -->|architecture-sensitive| A[cto · Sol high]
G --> S[to-spec · Terra high]
I --> S
A --> S
P --> S
S --> H{Workspace-write approved?}
H -->|no| W[Persist awaiting_approval]
H -->|yes| E[tdd · Luna/Terra high]
E -->|ESCALATE with evidence| R[cto · Sol high narrow resolution]
R --> E
E --> V[code-review · Terra high]
V --> F{P0 / P1 / P2 findings?}
F -->|yes| E
F -->|no · clean or P3 only| D[Persist completed]
每个方框是新的 codex exec --json 进程。阶段之间只传递经过 Zod 验证的 Context Packet,不重放完整 transcript。审查的 P0/P1/P2 会持久化并回到实现阶段,P3 仅作建议;循环上下文只保留每种阶段的最新 packet,SQLite 仍保存完整历史。自动路由中没有 Sol xhigh。
bun run check源码 TypeScript 禁止 any 与 unknown;分类、route、run、Context Packet、process protocol 和 CLI 输入均由 Zod schema 定义或验证。
下一里程碑才会加入“生成可重复 workflow script”的 skill,本 MVP 只提供薄 $auto skill。