360 Secure SkillHub
360 安全技能中心

Codex Swarm

基于OpenAI Codex的多智能体编排工具,通过分配架构师、开发者、审核者、集成者等角色,匹配o3/codex-mini模型实现并行编码全流程协作。核心支持git工作树隔离、tmux状态追踪、任务背书机制、自动代码审核、跨分支合并与冲突解决,以及webhook通知。典型场景为多需求并行开发、批量编码任务,通过编写任务描述JSON,执行bash脚本触发,输出完成的代码分支或集成后的代码,需依赖bash、tmux、git及Codex CLI。

linkbag
linkbag
热度 35.45
最近更新 2026-05-18 11:38:29
分类:开发依赖:代码执行 / 读写文件 / MCP 服务 / 第三方 API应用场景:代码生成 / 代码审查 / DevOps / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add codex-swarm
Metadata
name
codex-swarm
description
OpenAI Codex-native multi-agent swarm orchestration for parallel coding. Use when spawning multiple Codex CLI agents to work in parallel with git worktrees, tmux tracking, endorsement gates, native code review, integration merging, and webhook notifications. All agents are Codex (o3 for architect/integrator/reviewer, codex-mini for builders). Triggers on parallel coding, multi-agent work, swarm orchestration, or batch spawning with OpenAI models.

Codex Swarm — Multi-Agent Orchestration

Parallel Codex agents: plan → endorse → spawn → monitor → review → integrate → ship.

Quick Start

# 1. Write task prompts
cat > /tmp/prompt-task1.md << 'EOF'
Implement feature X...
EOF

# 2. Create tasks JSON
cat > /tmp/tasks.json << 'EOF'
[
  {"id": "feat-x", "description": "/tmp/prompt-task1.md", "role": "builder"},
  {"id": "feat-y", "description": "/tmp/prompt-task2.md", "role": "builder"}
]
EOF

# 3. Spawn batch
bash scripts/spawn-batch.sh "/path/to/project" "batch-1" "Description" /tmp/tasks.json

Roles & Models

Role Model Reasoning Use
architect o3 high Design, planning, complex decisions
builder codex-mini medium Feature implementation (parallel)
reviewer o3 medium Auto-review via codex exec review
integrator o3 high Cross-branch merge + conflict resolution

Key Codex Features Used

  • codex exec --full-auto — non-interactive sandboxed execution
  • codex exec review — native code review (replaces custom reviewer)
  • -c model=o3 — deep reasoning model for complex tasks
  • -c model_reasoning_effort=high — maximum reasoning depth

Scripts

Script Purpose
spawn-batch.sh Spawn N parallel agents + integration watcher
spawn-agent.sh Spawn single agent (manual worktree + tmux + codex exec)
endorse-task.sh Endorse task before spawn
check-agents.sh Show running agent status
cleanup.sh Remove worktrees, branches, sessions
notify.sh Webhook/Telegram notification
notify-on-complete.sh Auto-watcher with native codex exec review
integration-watcher.sh Auto-merge when batch completes

Setup

  1. Copy scripts/ and config/ to your workspace
  2. Configure config/swarm.conf (copy from .example)
  3. Required: bash 4+, tmux, git, gh, jq, codex (Codex CLI)