TL;DR
Use before $prototype, MVP, fullstack, or high-ambiguity feature work. Write .codex/specs/<slug>/SPEC.md first, then plan, delegate, implement, and validate against acceptance criteria.
Activation
- Activate on
$spec, $prototype, "spec-driven", "MVP", "fullstack prototype", "from scratch", or "build whole app".
- Activate when a task spans frontend + backend, data, QA, or deployment concerns.
- Activate when requirements are ambiguous enough that coding first would create rework.
Hard Rules
- Do not implement prototype/fullstack work before a spec exists.
- Specs must include requirements, non-goals, acceptance criteria, FE/BE/data/QA impact, and validation plan.
- Specs must include
Schema-Version: 1.0, AC IDs such as AC-001, and a traceability table mapping changed files to AC IDs and validation commands.
- Keep specs project-local under
.codex/specs/; do not always load every spec.
- Use
check_spec.py after code changes when .codex/specs/ exists.
- Treat spec checks as advisory in quality gate unless the user makes spec compliance mandatory.
Commands
python "<SKILLS_ROOT>/codex-spec-driven-development/scripts/init_spec.py" --project-root <path> --title "<title>"
python "<SKILLS_ROOT>/codex-spec-driven-development/scripts/check_spec.py" --project-root <path> --changed-files <csv>
Output Contract
init_spec.py returns JSON with status, spec_path, and slug.
check_spec.py returns JSON with schema_version, overall, matched_specs, matched_acceptance_criteria, unmapped_files, and suggested_actions.
Prototype Flow
- Run
$hook to detect domains and readiness.
- Run
$init-profile if profile is missing.
- Run
$genome and $init-docs if context/docs are missing.
- Run
$spec to lock requirements and acceptance criteria.
- Run
$plan, then $sdd or inline execution.
- Run
$check-full and update role docs/handoff.
Reference Files
references/spec.schema.json: required spec markdown contract and traceability fields.
1---2name: codex-spec-driven-development3description: Use for prototype, MVP, fullstack feature, from-scratch feature, or multi-domain work that needs a SPEC.md before planning or implementation. Do not use for tiny one-file edits.4---56## TL;DR7Use before `$prototype`, MVP, fullstack, or high-ambiguity feature work. Write `.codex/specs/<slug>/SPEC.md` first, then plan, delegate, implement, and validate against acceptance criteria.89## Activation101. Activate on `$spec`, `$prototype`, "spec-driven", "MVP", "fullstack prototype", "from scratch", or "build whole app".112. Activate when a task spans frontend + backend, data, QA, or deployment concerns.123. Activate when requirements are ambiguous enough that coding first would create rework.1314## Hard Rules15- Do not implement prototype/fullstack work before a spec exists.16- Specs must include requirements, non-goals, acceptance criteria, FE/BE/data/QA impact, and validation plan.17- Specs must include `Schema-Version: 1.0`, AC IDs such as `AC-001`, and a traceability table mapping changed files to AC IDs and validation commands.18- Keep specs project-local under `.codex/specs/`; do not always load every spec.19- Use `check_spec.py` after code changes when `.codex/specs/` exists.20- Treat spec checks as advisory in quality gate unless the user makes spec compliance mandatory.2122## Commands2324```bash25python "<SKILLS_ROOT>/codex-spec-driven-development/scripts/init_spec.py" --project-root <path> --title "<title>"26python "<SKILLS_ROOT>/codex-spec-driven-development/scripts/check_spec.py" --project-root <path> --changed-files <csv>27```2829## Output Contract30- `init_spec.py` returns JSON with `status`, `spec_path`, and `slug`.31- `check_spec.py` returns JSON with `schema_version`, `overall`, `matched_specs`, `matched_acceptance_criteria`, `unmapped_files`, and `suggested_actions`.3233## Prototype Flow341. Run `$hook` to detect domains and readiness.352. Run `$init-profile` if profile is missing.363. Run `$genome` and `$init-docs` if context/docs are missing.374. Run `$spec` to lock requirements and acceptance criteria.385. Run `$plan`, then `$sdd` or inline execution.396. Run `$check-full` and update role docs/handoff.4041## Reference Files42- `references/spec.schema.json`: required spec markdown contract and traceability fields.