Skip to content
Merged
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
10 changes: 10 additions & 0 deletions packages/converters/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Complete overview of all supported formats, their subtypes, and official documen
| **Factory Droid** | `skill` | Reusable workflows with YAML frontmatter | [docs.factory.ai](https://docs.factory.ai/cli/configuration/skills) |
| | `slash-command` | Custom slash commands with argument hints | [docs.factory.ai](https://docs.factory.ai/cli/configuration/custom-slash-commands) |
| | `agents-md` | Agent configurations in markdown | [docs.factory.ai](https://docs.factory.ai/cli/configuration/agents-md) |
| **Codex** | `skill` | Agent Skills SKILL.md format | [developers.openai.com](https://developers.openai.com/codex/skills) |
| | `agent` | Subagent TOML configs with MCP and skills | [developers.openai.com](https://developers.openai.com/codex/multi-agent/) |
| | `rule` | AGENTS.md project instructions | [developers.openai.com](https://developers.openai.com/codex/skills) |
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The Codex rule entry links to the skills docs instead of the AGENTS.md instructions guide.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/converters/docs/README.md, line 31:

<comment>The Codex `rule` entry links to the skills docs instead of the AGENTS.md instructions guide.</comment>

<file context>
@@ -26,6 +26,9 @@ Complete overview of all supported formats, their subtypes, and official documen
 | | `agents-md` | Agent configurations in markdown | [docs.factory.ai](https://docs.factory.ai/cli/configuration/agents-md) |
+| **Codex** | `skill` | Agent Skills SKILL.md format | [developers.openai.com](https://developers.openai.com/codex/skills) |
+| | `agent` | Subagent TOML configs with MCP and skills | [developers.openai.com](https://developers.openai.com/codex/multi-agent/) |
+| | `rule` | AGENTS.md project instructions | [developers.openai.com](https://developers.openai.com/codex/skills) |
 | **OpenCode** | `agent` | AI agents with mode, tools, and permissions | [opencode.ai](https://opencode.ai/docs/agents/) |
 | | `slash-command` | User-triggered prompts with templates and placeholders | [opencode.ai](https://opencode.ai/docs/commands/) |
</file context>
Suggested change
| | `rule` | AGENTS.md project instructions | [developers.openai.com](https://developers.openai.com/codex/skills) |
| | `rule` | AGENTS.md project instructions | [developers.openai.com](https://developers.openai.com/codex/guides/agents-md/) |
Fix with Cubic

| **OpenCode** | `agent` | AI agents with mode, tools, and permissions | [opencode.ai](https://opencode.ai/docs/agents/) |
| | `slash-command` | User-triggered prompts with templates and placeholders | [opencode.ai](https://opencode.ai/docs/commands/) |
| **Gemini CLI** | `slash-command` | Custom slash commands in TOML format | [geminicli.com](https://geminicli.com/docs/commands/) |
Expand Down Expand Up @@ -67,6 +70,7 @@ This directory contains detailed specifications for each AI IDE/tool format that
| **Kiro Agents** | [kiro-agents.md](./kiro-agents.md) | Custom AI agent configurations (JSON) | [kiro.dev/docs](https://kiro.dev/docs/cli/custom-agents/) |
| **Ruler** | [ruler.md](./ruler.md) | Plain markdown rules, centralized management | [okigu.com/ruler](https://okigu.com/ruler) |
| **Factory Droid** | [factory-droid.md](./factory-droid.md) | Skills, slash commands, and hooks | [docs.factory.ai](https://docs.factory.ai/) |
| **Codex** | [codex.md](./codex.md) | Skills, subagents, and AGENTS.md instructions | [developers.openai.com](https://developers.openai.com/codex/multi-agent/) |
| **OpenCode** | [opencode.md](./opencode.md) | Agents and slash commands with YAML frontmatter | [opencode.ai/docs](https://opencode.ai/docs/) |
| **Gemini CLI** | [gemini-plugin.md](./gemini-plugin.md) | Extensions with MCP servers and custom commands | [geminicli.com/docs](https://geminicli.com/docs/extensions/) |
| **agents.md** | [agents-md.md](./agents-md.md) | OpenAI format, plain markdown | [github.com/openai/agents.md](https://github.com/openai/agents.md) |
Expand Down Expand Up @@ -125,6 +129,10 @@ Each format has a corresponding JSON Schema in `../schemas/` that defines the st
- `droid-slash-command.schema.json` - Custom slash commands
- `droid-hook.schema.json` - Event-driven automations (JSON)

**Codex Subtypes:**
- `codex-agent-role.schema.json` - Subagent TOML configurations
- `agent-skills.schema.json` - Agent Skills SKILL.md (shared standard)

**OpenCode Subtypes:**
- `opencode-slash-command.schema.json` - Template-based commands

Expand Down Expand Up @@ -198,6 +206,7 @@ These specifications serve as the source of truth for:
| Copilot | Markdown headers | none | `applyTo`, `excludeAgent` |
| Kiro | YAML (optional) | none | `inclusion`, `fileMatchPattern`, `domain` |
| Factory Droid | YAML (required) | `name`, `description` | `argument-hint`, `allowed-tools` |
| Codex Agents | TOML (required) | `name`, `description`, `developer_instructions` | `model`, `model_reasoning_effort`, `sandbox_mode`, `nickname_candidates`, `mcp_servers`, `skills.config` |
| OpenCode Agents | YAML (required) | `description`, `mode` | `model`, `temperature`, `prompt`, `tools`, `permission`, `disable` |
| OpenCode Commands | YAML (required) | `template` | `description`, `agent`, `model`, `subtask` |
| Gemini Extension | JSON (required) | `name`, `version` | `description`, `author`, `mcpServers`, `contextFileName`, `excludeTools`, `experimentalSettings` |
Expand All @@ -221,6 +230,7 @@ These specifications serve as the source of truth for:
| Kiro | `.kiro/steering/*.md` | Multiple files |
| Kiro Hooks | `.kiro/hooks/*.json` | Multiple JSON files |
| Factory Droid | `.factory/skills/*/SKILL.md`, `.factory/commands/*.md` | Skills in subdirs, commands as files |
| Codex | `.codex/agents/*.toml`, `.agents/skills/*/SKILL.md` | Agents as TOML, skills in subdirs |
| OpenCode | `.opencode/agent/*.md`, `.opencode/command/*.md` | Agents and commands as separate files |
| Gemini CLI | `.gemini/extensions/*/gemini-extension.json` | Extensions in subdirectories with JSON config |
| agents.md | `agents.md` | Single file |
Expand Down
181 changes: 181 additions & 0 deletions packages/converters/docs/codex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# Codex Format Specification

**File Locations:**
- Skills: `.agents/skills/{skill-name}/SKILL.md`
- Agents/Subagents (project): `.codex/agents/*.toml`
- Agents/Subagents (global): `~/.codex/agents/*.toml`
- Rules/Instructions: `AGENTS.md`
- Slash Commands: `.opencommands/*.md`
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The .opencommands slash-command location is inaccurate for Codex. Codex's reusable command mechanism is user-scoped prompts under ~/.codex/prompts/, and this repo already treats slash commands as an AGENTS.md fallback, so these lines would direct users to files Codex never loads.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/converters/docs/codex.md, line 8:

<comment>The `.opencommands` slash-command location is inaccurate for Codex. Codex's reusable command mechanism is user-scoped prompts under `~/.codex/prompts/`, and this repo already treats slash commands as an AGENTS.md fallback, so these lines would direct users to files Codex never loads.</comment>

<file context>
@@ -0,0 +1,181 @@
+- Agents/Subagents (project): `.codex/agents/*.toml`
+- Agents/Subagents (global): `~/.codex/agents/*.toml`
+- Rules/Instructions: `AGENTS.md`
+- Slash Commands: `.opencommands/*.md`
+
+**Format:** TOML (agents), Markdown with YAML frontmatter (skills), plain Markdown (AGENTS.md)
</file context>
Fix with Cubic


**Format:** TOML (agents), Markdown with YAML frontmatter (skills), plain Markdown (AGENTS.md)
**Official Docs:** https://developers.openai.com/codex/multi-agent/

## Overview

OpenAI Codex CLI supports multiple format types for configuring AI agent behavior:

1. **Skills** (Agent Skills format): Markdown files with YAML frontmatter following the agentskills.io specification
2. **Agents/Subagents**: TOML configuration files that define specialized agent roles for multi-agent workflows
3. **Rules**: Project-level instructions via AGENTS.md
4. **Slash Commands**: Custom commands via `.opencommands/`

## Subagent TOML Format

### Required Fields

- **`name`** (string): Display name of the agent/subagent
- **`description`** (string): Short description of what this agent does and when to use it
- **`developer_instructions`** (string): System prompt / developer instructions for this agent role

### Optional Fields

- **`nickname_candidates`** (string[]): Alternative names the agent can be referred to as
- **`model`** (string): Model identifier to use (e.g., "o3", "o3-mini")
- **`model_reasoning_effort`** (enum): Reasoning effort level — `low`, `medium`, or `high`
- **`sandbox_mode`** (enum): Filesystem/network sandbox policy — `read-only` (default), `workspace-write`, or `danger-full-access`
- **`mcp_servers`** (object): MCP server configurations available to this agent
- **`skills.config`** (object): Skills configuration key-value pairs

### Global Settings (in codex config, not agent files)

- `agents.max_threads` (default: 6): Maximum parallel agent threads
- `agents.max_depth` (default: 1): Maximum spawning depth
- `agents.job_max_runtime_seconds`: Maximum runtime per agent job

### Built-in Agents

Codex includes three built-in agents: `default`, `worker`, and `explorer`.

## Skill Format (Agent Skills)

### Required Fields

- **`name`** (string): 1-64 chars, lowercase alphanumeric and hyphens, must match parent directory name
- **`description`** (string): 1-1024 chars, explains what skill does and when to use it

### Optional Fields

- **`license`** (string): Licensing terms
- **`compatibility`** (string): Environment requirements (max 500 chars)
- **`allowed-tools`** (string): Space-delimited list of pre-approved tools
- **`metadata`** (object): Arbitrary key-value pairs

## Content Format

### Subagent TOML

```toml
name = "Security Reviewer"
description = "Find security vulnerabilities and unsafe code patterns"
developer_instructions = "Focus on OWASP Top 10 vulnerabilities, injection attacks, and authentication issues."
nickname_candidates = ["sec-review", "security"]
model = "o3"
model_reasoning_effort = "high"
sandbox_mode = "read-only"

[mcp_servers.github]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-github"]

[skills.config]
focus_areas = "security,authentication"
```

### Skill SKILL.md

```markdown
---
name: typescript-expert
description: Expert TypeScript development assistance with type safety and best practices.
license: MIT
allowed-tools: Bash(tsc:*) Read Write
---

You are an expert TypeScript developer.

## Guidelines

- Always use strict type checking
- Prefer `unknown` over `any`
```

## Best Practices

1. Keep `developer_instructions` focused and specific to the agent's role
2. Use `sandbox_mode: "read-only"` for agents that only need to analyze code
3. Provide meaningful `nickname_candidates` for easier agent invocation
4. Configure `model_reasoning_effort` based on task complexity (use "low" for simple tasks)
5. Limit MCP server configurations to only what the agent needs

## Conversion Notes

### From Codex to Canonical

- `name` and `description` from TOML map to package metadata and `codexAgent` metadata
- `developer_instructions` maps to an instructions section
- `model`, `model_reasoning_effort`, `sandbox_mode` are stored in `codexAgent` metadata
- `nickname_candidates`, `mcp_servers`, `skills.config` are preserved in `codexAgent` metadata for roundtrip

### From Canonical to Codex

- Package name and description populate the `name` and `description` TOML fields
- Instructions sections map to `developer_instructions`
- Tools sections are skipped with a warning (not supported by agent role TOML)
- Persona sections are skipped with a warning
- `codexAgent` metadata fields are restored for roundtrip fidelity

## Limitations

- Agent role TOML does not support tools sections (use `allowed-tools` in skill format instead)
- Persona sections cannot be represented in TOML format
- File reference sections are not supported
- Hook sections are not supported
- `mcp_servers` and `skills.config` are opaque to PRPM — values are preserved but not interpreted

## Examples

### Minimal Subagent

```toml
name = "Code Reviewer"
description = "Reviews code for bugs and best practices"
developer_instructions = "Review code changes for correctness, performance, and security issues."
```

### Full-Featured Subagent

```toml
name = "Security Auditor"
description = "Deep security analysis of code changes"
nickname_candidates = ["sec-audit", "security-check"]
model = "o3"
model_reasoning_effort = "high"
sandbox_mode = "read-only"
developer_instructions = """
You are a security auditor. Analyze code for:
- OWASP Top 10 vulnerabilities
- Injection attacks (SQL, command, XSS)
- Authentication and authorization issues
- Sensitive data exposure
- Security misconfigurations
"""

[mcp_servers.semgrep]
command = "npx"
args = ["-y", "semgrep-mcp-server"]

[skills.config]
severity_threshold = "medium"
```

## Related Documentation

- [Codex Multi-Agent Docs](https://developers.openai.com/codex/multi-agent/)
- [Codex Skills Docs](https://developers.openai.com/codex/skills)
- [Agent Skills Specification](https://agentskills.io/specification)
- [PRPM Format Guide](../../docs/formats.mdx)

## Changelog

- **2026-03-17**: Added subagent support (name, description, nickname_candidates, mcp_servers, skills.config)
- **2025-01-15**: Initial Codex format support (skills, agent roles)
56 changes: 50 additions & 6 deletions packages/converters/schemas/codex-agent-role.schema.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://registry.prpm.dev/api/v1/schemas/codex/agent-role.json",
"title": "Codex Agent Role Format",
"description": "JSON Schema for OpenAI Codex CLI agent role configuration (TOML format, installed to ~/.codex/agents/)",
"title": "Codex Agent Role / Subagent Format",
"description": "JSON Schema for OpenAI Codex CLI agent role and subagent configuration (TOML format, installed to ~/.codex/agents/ or .codex/agents/)",
"type": "object",
"required": ["name", "description", "developer_instructions"],
"properties": {
"name": {
"type": "string",
"description": "Display name of the agent/subagent"
},
"description": {
"type": "string",
"description": "Short description of what this agent does and when to use it"
},
"developer_instructions": {
"type": "string",
"description": "System prompt / developer instructions for this agent role"
},
"nickname_candidates": {
"type": "array",
"items": { "type": "string" },
"description": "Alternative names the agent can be referred to as"
},
"model": {
"type": "string",
"description": "Model identifier to use for this agent role"
Expand All @@ -14,14 +32,40 @@
"enum": ["low", "medium", "high"],
"description": "Reasoning effort level for the model"
},
"developer_instructions": {
"type": "string",
"description": "System prompt / developer instructions for this agent role"
},
"sandbox_mode": {
"type": "string",
"enum": ["read-only", "workspace-write", "danger-full-access"],
"description": "Filesystem/network sandbox policy: read-only (default), workspace-write, or danger-full-access (no sandbox)"
},
"mcp_servers": {
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: mcp_servers entries need a required launcher (command or url), otherwise malformed MCP configs pass schema validation.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/converters/schemas/codex-agent-role.schema.json, line 40:

<comment>`mcp_servers` entries need a required launcher (`command` or `url`), otherwise malformed MCP configs pass schema validation.</comment>

<file context>
@@ -14,14 +32,40 @@
       "enum": ["read-only", "workspace-write", "danger-full-access"],
       "description": "Filesystem/network sandbox policy: read-only (default), workspace-write, or danger-full-access (no sandbox)"
+    },
+    "mcp_servers": {
+      "type": "object",
+      "description": "MCP server configurations available to this agent",
</file context>
Fix with Cubic

"type": "object",
"description": "MCP server configurations available to this agent",
"additionalProperties": {
"type": "object",
"properties": {
"command": { "type": "string" },
"args": {
"type": "array",
"items": { "type": "string" }
},
"env": {
"type": "object",
"additionalProperties": { "type": "string" }
}
}
}
},
"skills": {
"type": "object",
"description": "Skills configuration for this agent",
"properties": {
"config": {
"type": "object",
"description": "Skill-specific configuration key-value pairs",
"additionalProperties": true
}
Comment on lines +62 to +66
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: skills.config should be an array of tables, not a single object, or valid Codex agent files using [[skills.config]] will be rejected.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/converters/schemas/codex-agent-role.schema.json, line 62:

<comment>`skills.config` should be an array of tables, not a single object, or valid Codex agent files using `[[skills.config]]` will be rejected.</comment>

<file context>
@@ -14,14 +32,40 @@
+      "type": "object",
+      "description": "Skills configuration for this agent",
+      "properties": {
+        "config": {
+          "type": "object",
+          "description": "Skill-specific configuration key-value pairs",
</file context>
Suggested change
"config": {
"type": "object",
"description": "Skill-specific configuration key-value pairs",
"additionalProperties": true
}
"config": {
"type": "array",
"description": "List of skill-specific configuration tables",
"items": {
"type": "object",
"additionalProperties": true
}
}
Fix with Cubic

},
"additionalProperties": true
}
},
"additionalProperties": false
Expand Down
Loading
Loading