# Codex Formatter

<!-- Auto-generated by `pnpm docs:formatters`. Do not edit manually. -->

PromptScript compiles your `.prs` sources to native Codex configuration. The main output is `AGENTS.md`. It is not enabled by default, add it to `targets` to use it.

## Enable the Target

```yaml
targets:
  - codex
```

Pick an output version when you need more than the default:

```yaml
targets:
  - codex:
      version: full
```

## At a Glance

| Property          | Value                                  |
| ----------------- | -------------------------------------- |
| **Tier**          | Tier 1                                 |
| **Main output**   | `AGENTS.md`                            |
| **Dot directory** | `.codex/`                              |
| **Skills**        | Yes (`.agents/skills/<name>/SKILL.md`) |
| **Agents**        | Yes (`.codex/agents/<name>.toml`)      |
| **Commands**      | No                                     |
| **Local files**   | No                                     |

## Output Files

| File              | Path                             | Purpose                                       |
| ----------------- | -------------------------------- | --------------------------------------------- |
| Main instructions | `AGENTS.md`                      | Primary rule file                             |
| Lifecycle hooks   | `.codex/hooks.json`              | Project hooks in `multifile` and `full` modes |
| Skills            | `.agents/skills/<name>/SKILL.md` | Reusable skill definitions                    |
| Agents            | `.codex/agents/<name>.toml`      | Agent configurations                          |

## Output Versions

| Version          | Output                                                                 |
| ---------------- | ---------------------------------------------------------------------- |
| `simple`         | Single AGENTS.md file                                                  |
| `multifile`      | AGENTS.md + .codex/agents/<name>.toml                                  |
| `full` (default) | AGENTS.md + .codex/agents/<name>.toml + .agents/skills/<name>/SKILL.md |

## MCP and Hooks

| Block         | Support                                                                                                     |
| ------------- | ----------------------------------------------------------------------------------------------------------- |
| `@mcpServers` | `.codex/mcp.json` (json)                                                                                    |
| `@hooks`      | `.codex/hooks.json` in `multifile`, `full`                                                                  |
| Hook events   | `pre-terminal-command`, `pre-tool-use`, `post-tool-use`, `session-start`, `setup`, `subagent-start`, `stop` |

Native hook reference: <https://developers.openai.com/codex/hooks>

## Supported Features

| Feature                    | Supported |
| -------------------------- | --------- |
| Markdown Output            | Yes       |
| MDC Format                 | No        |
| Code Blocks                | Yes       |
| Mermaid Diagrams           | No        |
| Single File Output         | Yes       |
| Multiple Rule Files        | No        |
| Workflow Files             | No        |
| Nested Directory Structure | Partial   |
| YAML Frontmatter           | No        |
| Description in Frontmatter | No        |
| Globs in Frontmatter       | No        |
| Activation Type            | No        |
| Glob Pattern Targeting     | No        |
| Always Apply Rules         | Yes       |
| Manual Activation          | No        |
| Auto/Model Activation      | No        |
| Structured Examples        | Yes       |
| Character Limit Validation | No        |
| Content Section Splitting  | Yes       |
| Guard Dependencies         | Yes       |
| Context File Inclusion     | No        |
| @-Mentions                 | No        |
| Tool Integration           | No        |
| Path-Specific Rules        | Partial   |
| Prompt Files               | No        |
| Slash Commands             | No        |
| Skills                     | Yes       |
| Agent Instructions         | Yes       |
| Local Memory               | No        |
| Nested Memory              | Yes       |

## See Also

- [Platform matrix](https://getpromptscript.dev/reference/formatters/index.md)
- [Configuration reference](https://getpromptscript.dev/reference/config/index.md)
- [Target platforms and output families](https://getpromptscript.dev/features/target-platforms/index.md)