This guide is the detailed companion to the root [README](../README.md).
Use the README for quick orientation. Use this guide for installation, commands, role execution, workflow prompts, task orchestration, validation, and troubleshooting.
Codex Game Studio runs locally against the current repository checkout. `init` turns the current repository root into the game workspace and keeps project state in files that can be reviewed in Git.
By default, `init` converts a cloned template checkout into a game workspace. It preserves the game-facing studio surfaces and runtime assets, then removes maintainer-only authoring artifacts such as `eval-framework/`, stale research/reference folders, OpenSpec change files, repository TypeScript source files, and repository validation tests. Use `--keep-template-authoring` only when you are maintaining Codex Game Studio itself.
`run <role>` assembles a runtime prompt packet from tracked custom agents, project state, selected templates, and bounded context for that role/task. `--allow-broad-context` adds bounded discovery for existing artifacts such as the GDD, production timeline, market overview, `AGENTS.md`, and `.codex/studio.json`; it does not recursively dump the project into the prompt.
| `validate` | Run hard-failing repository or project validation. |
| `templates list` | List packaged template IDs. |
| `templates show <template-id>` | Print a packaged template. |
| `run <role>` | Prepare one bounded Codex prompt packet and invoke `codex exec`. |
| `task create` / `task run` / `task orchestrate` | Manage file-backed `.codex/tasks.json` work and bounded local orchestration. |
| `workflow create-tasks <workflow-id>` | Create explicit tasks from recipes such as `vertical-slice`, `bugfix`, `ui-ux-review`, and `release-checklist`. |
-`task run` runs a selected task through the configured role path.
-`task orchestrate` runs bounded local orchestration.
-`.codex/locks/` stores transient locks for bounded orchestration.
Task orchestration is local and bounded. Hosted background loops, unbounded parallelism, and planner/next automation are outside the current product boundary.
## Troubleshooting
### The wrapper cannot find `dist/cli.js`
Run:
```sh
npm install
npm run build
```
Generated bundled CLI artifacts are intentionally not committed.
### `run <role>` cannot launch Codex
Verify that the Codex CLI is installed and available on `PATH`:
```sh
codex --help
```
Use `--dry-run` or `--print-prompt` when you only need to inspect the prompt packet.
Inspect the relevant tracked template surface or project-state file before trusting the output. Project validation is intentionally strict about missing template files, malformed context metadata, and malformed project state.
Prompt surfaces declare concrete Codex model and reasoning-effort policy in tracked template files. The model family (`gpt-5.6-sol`, `gpt-5.6-terra`, or `gpt-5.6-luna`) is chosen by capability and blast radius, while reasoning effort is chosen independently per prompt surface. For example, a cheap-but-careful routine review can use Luna/medium, bounded routine production work can use Terra/low, difficult implementation can use Terra/high, and Sol can use medium or high effort depending on risk. Runtime dry-runs and run metadata expose both selected values, and Codex execution receives the exact model and effort instead of a generic tier name.