Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,4 @@ integrations/qwen/agents/
integrations/kimi/*/
!integrations/openclaw/README.md
!integrations/kimi/README.md
integrations/codex/agents/*
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ quickstart guide wearing an agent costume does not.

**Qwen Code Compatibility**: Agent bodies support `${variable}` templating for dynamic context (e.g., `${project_name}`, `${task_description}`). Qwen SubAgents use minimal frontmatter: only `name` and `description` are required; `color`, `emoji`, and `version` fields are omitted as Qwen doesn't use them.

**Codex Compatibility**: Codex custom agents are generated as standalone TOML files. The Codex integration keeps a minimal 1:1 mapping: `name` and `description` are copied from frontmatter, and the Markdown body becomes `developer_instructions`. Source-only metadata such as `color`, `emoji`, `vibe`, and other unsupported frontmatter fields are omitted.

### What Makes a Great Agent?

**Great agents have**:
Expand Down
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Each agent file contains:

Browse the agents below and copy/adapt the ones you need!

### Option 3: Use with Other Tools (Cursor, Aider, Windsurf, Gemini CLI, OpenCode, Kimi Code)
### Option 3: Use with Other Tools (Cursor, Aider, Windsurf, Gemini CLI, OpenCode, Kimi Code, Codex)

```bash
# Step 1 -- generate integration files for all supported tools
Expand All @@ -59,6 +59,7 @@ Browse the agents below and copy/adapt the ones you need!
./scripts/install.sh --tool aider
./scripts/install.sh --tool windsurf
./scripts/install.sh --tool kimi
./scripts/install.sh --tool codex
```

See the [Multi-Tool Integrations](#-multi-tool-integrations) section below for full details.
Expand Down Expand Up @@ -522,6 +523,7 @@ The Agency works natively with Claude Code, and ships conversion + install scrip
- **[OpenClaw](https://github.com/openclaw/openclaw)** — `SOUL.md` + `AGENTS.md` + `IDENTITY.md` per agent
- **[Qwen Code](https://github.com/QwenLM/qwen-code)** — `.md` SubAgent files → `~/.qwen/agents/`
- **[Kimi Code](https://github.com/MoonshotAI/kimi-cli)** — YAML agent specs → `~/.config/kimi/agents/`
- **[Codex](https://developers.openai.com/codex/overview)** — TOML custom agents → `~/.codex/agents/`

---

Expand Down Expand Up @@ -559,8 +561,9 @@ The installer scans your system for installed tools, shows a checkbox UI, and le
[ ] 9) [ ] Windsurf (.windsurfrules)
[ ] 10) [ ] Qwen Code (~/.qwen/agents)
[ ] 11) [ ] Kimi Code (~/.config/kimi/agents)
[ ] 12) [ ] Codex (~/.codex/agents)

[1-11] toggle [a] all [n] none [d] detected
[1-12] toggle [a] all [n] none [d] detected
[Enter] install [q] quit
```

Expand All @@ -570,6 +573,7 @@ The installer scans your system for installed tools, shows a checkbox UI, and le
./scripts/install.sh --tool opencode
./scripts/install.sh --tool openclaw
./scripts/install.sh --tool antigravity
./scripts/install.sh --tool codex
```

**Non-interactive (CI/scripts):**
Expand Down Expand Up @@ -796,6 +800,24 @@ See [integrations/kimi/README.md](integrations/kimi/README.md) for details.

</details>

<details>
<summary><strong>Codex</strong></summary>

Each agent is converted into a Codex custom agent TOML file and installed to `~/.codex/agents/`.

```bash
./scripts/convert.sh --tool codex
./scripts/install.sh --tool codex
```

Then reference the custom agent by name in Codex:
```
Use the Frontend Developer agent to review this component.
```

See [integrations/codex/README.md](integrations/codex/README.md) for details.
</details>

---

### Regenerating After Changes
Expand All @@ -805,6 +827,7 @@ When you add new agents or edit existing ones, regenerate all integration files:
```bash
./scripts/convert.sh # regenerate all (serial)
./scripts/convert.sh --parallel # regenerate all in parallel (faster)
./scripts/convert.sh --tool codex # regenerate just one tool
./scripts/convert.sh --tool cursor # regenerate just one tool
```

Expand All @@ -814,7 +837,7 @@ When you add new agents or edit existing ones, regenerate all integration files:

- [ ] Interactive agent selector web tool
- [x] Multi-agent workflow examples -- see [examples/](examples/)
- [x] Multi-tool integration scripts (Claude Code, GitHub Copilot, Antigravity, Gemini CLI, OpenCode, OpenClaw, Cursor, Aider, Windsurf, Qwen Code, Kimi Code)
- [x] Multi-tool integration scripts (Claude Code, GitHub Copilot, Antigravity, Gemini CLI, OpenCode, OpenClaw, Cursor, Aider, Windsurf, Qwen Code, Kimi Code, Codex)
- [ ] Video tutorials on agent design
- [ ] Community agent marketplace
- [ ] Agent "personality quiz" for project matching
Expand Down
31 changes: 31 additions & 0 deletions integrations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ supported agentic coding tools.
- **[Aider](#aider)**`CONVENTIONS.md` in `aider/`
- **[Windsurf](#windsurf)**`.windsurfrules` in `windsurf/`
- **[Kimi Code](#kimi-code)** — YAML agent specs in `kimi/`
- **[Codex](#codex)**`.toml` custom agents in `codex/`

## Quick Install

Expand All @@ -27,6 +28,7 @@ supported agentic coding tools.
./scripts/install.sh --tool copilot
./scripts/install.sh --tool openclaw
./scripts/install.sh --tool claude-code
./scripts/install.sh --tool codex

# Gemini CLI needs generated integration files on a fresh clone
./scripts/convert.sh --tool gemini-cli
Expand Down Expand Up @@ -176,6 +178,18 @@ See [windsurf/README.md](windsurf/README.md) for details.

---

## Qwen Code

Each agent becomes a project-scoped `.md` SubAgent file in `.qwen/agents/`.

```bash
cd /your/project && /path/to/agency-agents/scripts/install.sh --tool qwen
```

See [../README.md#tool-specific-instructions](../README.md#tool-specific-instructions) for usage details.

---

## Kimi Code

Each agent is converted to a Kimi Code CLI agent specification (YAML format with
Expand Down Expand Up @@ -206,3 +220,20 @@ kimi --agent-file ~/.config/kimi/agents/frontend-developer/agent.yaml \
```

See [kimi/README.md](kimi/README.md) for details.

---

## Codex

Each agent is converted into a standalone Codex custom agent TOML file and
installed to `~/.codex/agents/`.

Because Codex uses generated TOML files rather than the source Markdown
directly, run the converter before installing from a fresh clone:

```bash
./scripts/convert.sh --tool codex
./scripts/install.sh --tool codex
```

See [codex/README.md](codex/README.md) for details.
79 changes: 79 additions & 0 deletions integrations/codex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Codex Integration

Converts all Agency agents into Codex custom agent TOML files. Each source
agent becomes one standalone `.toml` file containing the minimal Codex-required
fields: `name`, `description`, and `developer_instructions`.

## Installation

### Prerequisites

- [Codex](https://developers.openai.com/codex/overview) installed

### Convert And Install

```bash
# Generate integration files (required on fresh clone)
./scripts/convert.sh --tool codex

# Install agents
./scripts/install.sh --tool codex
```

This copies generated agent files to `~/.codex/agents/`.

## Generated Format

Each generated file lives in:

```text
integrations/codex/agents/<slug>.toml
```

The mapping is intentionally minimal:

- `name` is copied from the source frontmatter unchanged
- `description` is copied from the source frontmatter unchanged
- `developer_instructions` contains the full Markdown body unchanged

Source-only metadata such as `color`, `emoji`, `vibe`, and other unsupported
frontmatter fields are omitted.

## Usage

After installation, reference the custom agent by name in Codex:

```text
Use the Frontend Developer agent to review this component.
```

Codex uses the `name` field inside the TOML file as the source of truth, so the
generated filename slug is only for filesystem safety.

## Regenerate

After modifying source agents:

```bash
./scripts/convert.sh --tool codex
./scripts/install.sh --tool codex
```

## Troubleshooting

### Codex integration not found

Generate the Codex artifacts before installing:

```bash
./scripts/convert.sh --tool codex
```

### Codex not detected

Make sure `codex` is in your PATH, or that `~/.codex/` already exists:

```bash
which codex
codex --help
```
47 changes: 43 additions & 4 deletions scripts/convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# openclaw — OpenClaw SOUL.md files (openclaw_workspace/<agent>/SOUL.md)
# qwen — Qwen Code SubAgent files (~/.qwen/agents/*.md)
# kimi — Kimi Code CLI agent files (~/.config/kimi/agents/)
# codex — Codex custom agent TOML files (~/.codex/agents/*.toml)
# all — All tools (default)
#
# Output is written to integrations/<tool>/ relative to the repo root.
Expand Down Expand Up @@ -104,6 +105,21 @@ slugify() {
echo "$1" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//'
}

# Escape a value for a TOML basic string, including control characters that
# cannot appear raw in TOML source.
toml_escape_string() {
printf '%s' "$1" | perl -0pe '
s/\\/\\\\/g;
s/"/\\"/g;
s/\n/\\n/g;
s/\r/\\r/g;
s/\t/\\t/g;
s/\f/\\f/g;
s/\x08/\\b/g;
s/([\x00-\x07\x0B\x0E-\x1F\x7F])/sprintf("\\u%04X", ord($1))/ge;
'
}

# --- Per-tool converters ---

convert_antigravity() {
Expand Down Expand Up @@ -132,6 +148,28 @@ ${body}
HEREDOC
}

convert_codex() {
local file="$1"
local name description slug outfile body

name="$(get_field "name" "$file")"
description="$(get_field "description" "$file")"
slug="$(slugify "$name")"
body="$(get_body "$file")"

outfile="$OUT_DIR/codex/agents/${slug}.toml"
mkdir -p "$(dirname "$outfile")"

# Codex custom agent format: one TOML file per agent with minimal required
# fields only. Use a TOML basic string so control characters in the source
# body are encoded safely instead of producing invalid TOML.
cat > "$outfile" <<HEREDOC
name = "$(toml_escape_string "$name")"
description = "$(toml_escape_string "$description")"
developer_instructions = "$(toml_escape_string "$body")"
HEREDOC
}

convert_gemini_cli() {
local file="$1"
local name description slug outdir outfile body
Expand Down Expand Up @@ -499,6 +537,7 @@ run_conversions() {

case "$tool" in
antigravity) convert_antigravity "$file" ;;
codex) convert_codex "$file" ;;
gemini-cli) convert_gemini_cli "$file" ;;
opencode) convert_opencode "$file" ;;
cursor) convert_cursor "$file" ;;
Expand Down Expand Up @@ -535,7 +574,7 @@ main() {
esac
done

local valid_tools=("antigravity" "gemini-cli" "opencode" "cursor" "aider" "windsurf" "openclaw" "qwen" "kimi" "all")
local valid_tools=("antigravity" "gemini-cli" "opencode" "cursor" "aider" "windsurf" "openclaw" "qwen" "kimi" "codex" "all")
local valid=false
for t in "${valid_tools[@]}"; do [[ "$t" == "$tool" ]] && valid=true && break; done
if ! $valid; then
Expand All @@ -554,7 +593,7 @@ main() {

local tools_to_run=()
if [[ "$tool" == "all" ]]; then
tools_to_run=("antigravity" "gemini-cli" "opencode" "cursor" "aider" "windsurf" "openclaw" "qwen" "kimi")
tools_to_run=("antigravity" "gemini-cli" "opencode" "cursor" "aider" "windsurf" "openclaw" "qwen" "kimi" "codex")
else
tools_to_run=("$tool")
fi
Expand All @@ -565,7 +604,7 @@ main() {

if $use_parallel && [[ "$tool" == "all" ]]; then
# Tools that write to separate dirs can run in parallel; buffer output so each tool's output stays together
local parallel_tools=(antigravity gemini-cli opencode cursor openclaw qwen)
local parallel_tools=(antigravity gemini-cli opencode cursor openclaw qwen codex)
local parallel_out_dir
parallel_out_dir="$(mktemp -d)"
info "Converting: ${#parallel_tools[@]}/${n_tools} tools in parallel (output buffered per tool)..."
Expand All @@ -577,7 +616,7 @@ main() {
[[ -f "$parallel_out_dir/$t" ]] && cat "$parallel_out_dir/$t"
done
rm -rf "$parallel_out_dir"
local idx=7
local idx=8
for t in aider windsurf; do
progress_bar "$idx" "$n_tools"
printf "\n"
Expand Down
Loading