skills/codex/SKILL.md

Set up factory for Codex

Copy this factory into the current product repository so Codex can run the same workflows ($factory-define, $factory-deliver, $factory-design, …) against the same task catalog.

The setup script ships with this plugin at ../../scripts/codex.mjs, relative to this skill file. Run it with Node against the product repository root:

node "<plugin folder>/scripts/codex.mjs" install "$(git rev-parse --show-toplevel)"

With the argument check, run check instead of install. It writes nothing and reports whether the project's copy matches this plugin. Reject any other argument.

install writes only:

  • .agents/factory/: a copy of this plugin's skills/, agents/, docs/, README.md, CHANGELOG.md and .claude-plugin/plugin.json, plus manifest.json, which records which factory-* entries the setup owns;
  • .agents/skills/factory-<workflow>/: one Codex entry per factory workflow, pointing into that copy.

It owns those folders and replaces their whole contents on every run. It refuses to take over an existing .agents/factory or factory-* folder it did not create. If it stops, report the path it named and ask the developer what to do; never move or delete those files yourself.

Afterwards, show the developer git status --short -- .agents and tell them:

  • These files are meant to be committed, so everyone using Codex in this project gets the same factory version. Task records and the journal are not among them; they stay in the shared Git directory described in storage.
  • Restart Codex to pick up new or changed skills.
  • If the project formats or lints the whole repository, exclude the generated folders from it, as Using factory with Codex describes.
  • After each factory update, run this skill again (or check) and commit the refreshed copy.

Do not commit, start tasks or run migrations.

Original Markdown, including metadata
---
name: codex
description: Make this factory's workflows, roles and docs available to Codex in the current project as $factory-* skills, or check that the project's Codex copy is current. Run again after updating the factory.
argument-hint: "[check]"
disable-model-invocation: true
---

# Set up factory for Codex

Copy this factory into the current product repository so Codex can run the same workflows (`$factory-define`, `$factory-deliver`, `$factory-design`, …) against the same task catalog.

The setup script ships with this plugin at `../../scripts/codex.mjs`, relative to this skill file. Run it with Node against the product repository root:

```sh
node "<plugin folder>/scripts/codex.mjs" install "$(git rev-parse --show-toplevel)"
```

With the argument `check`, run `check` instead of `install`. It writes nothing and reports whether the project's copy matches this plugin. Reject any other argument.

`install` writes only:

- `.agents/factory/`: a copy of this plugin's `skills/`, `agents/`, `docs/`, `README.md`, `CHANGELOG.md` and `.claude-plugin/plugin.json`, plus `manifest.json`, which records which `factory-*` entries the setup owns;
- `.agents/skills/factory-<workflow>/`: one Codex entry per factory workflow, pointing into that copy.

It owns those folders and replaces their whole contents on every run. It refuses to take over an existing `.agents/factory` or `factory-*` folder it did not create. If it stops, report the path it named and ask the developer what to do; never move or delete those files yourself.

Afterwards, show the developer `git status --short -- .agents` and tell them:

- These files are meant to be committed, so everyone using Codex in this project gets the same factory version. Task records and the journal are not among them; they stay in the shared Git directory described in [storage](../storage.md).
- Restart Codex to pick up new or changed skills.
- If the project formats or lints the whole repository, exclude the generated folders from it, as [Using factory with Codex](../../docs/adapters/codex.md) describes.
- After each factory update, run this skill again (or `check`) and commit the refreshed copy.

Do not commit, start tasks or run migrations.