Using factory with Codex
Codex runs the same workflows, roles and task catalog as Claude Code. The factory is copied into the product repository, and each workflow gets a small Codex entry point that reads the copy. Task records and the journal are not copied: both agents use the shared Git-directory catalog described in storage, so a task defined in Claude can be delivered in Codex and the other way round.
Install Codex
Follow OpenAI's Codex CLI guide for installation and authentication, for example:
npm install -g @openai/codex
codex --version
Add the factory to a project
With the factory plugin installed in Claude Code, run this in the product repository:
/factory:codex
Without Claude Code, run the same script from a checkout of this repository at the release you want:
node /path/to/software-factory/scripts/codex.mjs install /path/to/product
This writes:
product/
└── .agents/
├── factory/ # copy of skills/, agents/, docs/, README, CHANGELOG and plugin.json, plus manifest.json
└── skills/
├── factory-define/ # Codex entry: "read .agents/factory/skills/define/SKILL.md"
├── factory-deliver/
└── … # one per factory workflow, found automatically
Commit these files so everyone using Codex in the project gets the same version. Restart Codex afterwards. The setup owns .agents/factory/ and the factory-* folders listed in its manifest.json, and replaces their whole contents on every run, so don't keep your own files there. It stops instead of taking over an existing .agents/factory or factory-* folder it didn't create. Your project's other .agents/skills/ entries are left alone.
The copied files follow the factory's formatting, not your project's. If the project runs a formatter or linter over the whole repository, exclude .agents/factory/ and .agents/skills/factory-*/ from it (for example in .prettierignore); the install output reminds you. Otherwise the generated files fail the check on every delivery's baseline.
Invocation
Start Codex in the product repository and invoke the skills in the prompt:
| Workflow | Codex | Claude Code |
|---|---|---|
| define | $factory-define <idea> |
/factory:define <idea> |
| deliver | $factory-deliver <task-id> |
/factory:deliver <task-id> |
| design | $factory-design define <idea> or $factory-design deliver <task-id> |
/factory:design … |
| tasks | $factory-tasks (overview; settles merged tasks first) |
/factory:tasks |
| settle | $factory-settle |
/factory:settle |
| journal | $factory-journal <note> or $factory-journal review |
/factory:journal <note | review> |
| feedback | $factory-feedback |
/factory:feedback |
| migrate | $factory-migrate [check | apply] [version] |
/factory:migrate … |
The shared instructions are written with Claude's spelling. When they mention /factory:<workflow>, use $factory-<workflow> in Codex. deliver, settle and feedback run only when invoked explicitly, as in Claude Code; tasks and deliver also run settle first.
Roles
The workflows start workers for the builder, reviewer, designer and design-reviewer roles. The reviewers run on Claude Code when the session can start it, as delegate describes. From the command line, run claude -p in the product checkout with the role file's body and the brief as the prompt, and --allowedTools limited to Read, Grep, Glob and the Bash commands the review needs (for example Bash(git diff:*), Bash(git log:*), Bash(git rev-parse:*), plus the project's test command when it re-runs a check); never bypass permission checks. Bash can still write, so report that read-only is only an instruction. Otherwise, and for the builder and designer, start a fresh Codex subagent:
- Its instructions are the body of
.agents/factory/agents/<role>.md. Ignore the Claude-only frontmatter (tools,model). - Give it only the inputs the workflow lists, as absolute paths. Never fork your own conversation into it.
- For the reviewer and design-reviewer, use Codex's read-only controls where available. Otherwise tell the subagent to stay read-only and report that the limit is only an instruction.
If Codex can't start subagents in the session, the delegate skill first checks the host application's delegation tools, then falls back to a separate-session handoff: the developer starts a new codex session in the product repository and gives it only the handoff. Without independent review the task stays pending; the orchestrator never reviews its own work.
Updating
After updating the factory, run /factory:codex again (or the script), commit the refreshed .agents/ files, and restart Codex. /factory:codex check or node …/scripts/codex.mjs check reports whether the copy is current without writing anything. Updating the copy never migrates task records; use $factory-migrate for that, as described in updating.
Original Markdown, including metadata
# Using factory with Codex
Codex runs the same workflows, roles and task catalog as Claude Code. The factory is copied into the product repository, and each workflow gets a small Codex entry point that reads the copy. Task records and the journal are not copied: both agents use the shared Git-directory catalog described in [storage](../../skills/storage.md), so a task defined in Claude can be delivered in Codex and the other way round.
## Install Codex
Follow OpenAI's [Codex CLI guide](https://developers.openai.com/codex/cli/) for installation and authentication, for example:
```sh
npm install -g @openai/codex
codex --version
```
## Add the factory to a project
With the factory plugin installed in Claude Code, run this in the product repository:
```text
/factory:codex
```
Without Claude Code, run the same script from a checkout of this repository at the release you want:
```sh
node /path/to/software-factory/scripts/codex.mjs install /path/to/product
```
This writes:
```text
product/
└── .agents/
├── factory/ # copy of skills/, agents/, docs/, README, CHANGELOG and plugin.json, plus manifest.json
└── skills/
├── factory-define/ # Codex entry: "read .agents/factory/skills/define/SKILL.md"
├── factory-deliver/
└── … # one per factory workflow, found automatically
```
Commit these files so everyone using Codex in the project gets the same version. Restart Codex afterwards. The setup owns `.agents/factory/` and the `factory-*` folders listed in its `manifest.json`, and replaces their whole contents on every run, so don't keep your own files there. It stops instead of taking over an existing `.agents/factory` or `factory-*` folder it didn't create. Your project's other `.agents/skills/` entries are left alone.
The copied files follow the factory's formatting, not your project's. If the project runs a formatter or linter over the whole repository, exclude `.agents/factory/` and `.agents/skills/factory-*/` from it (for example in `.prettierignore`); the install output reminds you. Otherwise the generated files fail the check on every delivery's baseline.
## Invocation
Start Codex in the product repository and invoke the skills in the prompt:
| Workflow | Codex | Claude Code |
| --- | --- | --- |
| define | `$factory-define <idea>` | `/factory:define <idea>` |
| deliver | `$factory-deliver <task-id>` | `/factory:deliver <task-id>` |
| design | `$factory-design define <idea>` or `$factory-design deliver <task-id>` | `/factory:design …` |
| tasks | `$factory-tasks` (overview; settles merged tasks first) | `/factory:tasks` |
| settle | `$factory-settle` | `/factory:settle` |
| journal | `$factory-journal <note>` or `$factory-journal review` | `/factory:journal <note \| review>` |
| feedback | `$factory-feedback` | `/factory:feedback` |
| migrate | `$factory-migrate [check \| apply] [version]` | `/factory:migrate …` |
The shared instructions are written with Claude's spelling. When they mention `/factory:<workflow>`, use `$factory-<workflow>` in Codex. `deliver`, `settle` and `feedback` run only when invoked explicitly, as in Claude Code; `tasks` and `deliver` also run `settle` first.
## Roles
The workflows start workers for the builder, reviewer, designer and design-reviewer roles. The reviewers run on Claude Code when the session can start it, as [delegate](../../skills/delegate/SKILL.md#reviewers-run-on-the-other-agent) describes. From the command line, run `claude -p` in the product checkout with the role file's body and the brief as the prompt, and `--allowedTools` limited to `Read`, `Grep`, `Glob` and the `Bash` commands the review needs (for example `Bash(git diff:*)`, `Bash(git log:*)`, `Bash(git rev-parse:*)`, plus the project's test command when it re-runs a check); never bypass permission checks. Bash can still write, so report that read-only is only an instruction. Otherwise, and for the builder and designer, start a fresh Codex [subagent](https://developers.openai.com/codex/subagents/):
- Its instructions are the body of `.agents/factory/agents/<role>.md`. Ignore the Claude-only frontmatter (`tools`, `model`).
- Give it only the inputs the workflow lists, as absolute paths. Never fork your own conversation into it.
- For the reviewer and design-reviewer, use Codex's read-only controls where available. Otherwise tell the subagent to stay read-only and report that the limit is only an instruction.
If Codex can't start subagents in the session, the [delegate](../../skills/delegate/SKILL.md#2-start-the-role) skill first checks the host application's delegation tools, then falls back to a separate-session handoff: the developer starts a new `codex` session in the product repository and gives it only the handoff. Without independent review the task stays pending; the orchestrator never reviews its own work.
## Updating
After updating the factory, run `/factory:codex` again (or the script), commit the refreshed `.agents/` files, and restart Codex. `/factory:codex check` or `node …/scripts/codex.mjs check` reports whether the copy is current without writing anything. Updating the copy never migrates task records; use `$factory-migrate` for that, as described in [updating](../updating.md).