codex-workflows

September 9, 2026 · View on GitHub

Codex CLI Agent Skills License: MIT

English | 简体中文 | 日本語 | Español | 한국어 | Português (Brasil)

On larger product work, Codex can pursue technical consistency beyond what the user needs. Handling every edge case and making each path deterministic can alter what users see even when the approved outcome does not require it.

codex-workflows keeps that work within the smallest approved outcome. It confirms which user-visible behavior may change, records what must not, and requires evidence before completion. Within those boundaries, Codex chooses reversible implementation details from the repository.

The workflows are installed as Agent Skills and custom agents for OpenAI Codex CLI. The main Codex session checks scope and rough cost before design, owns progress and review decisions, and carries approved work through implementation and independent verification.


Why not use Codex directly?

Direct Codex is the better fit for a well-scoped fix, disposable experiment, or one-shot script. It is faster and cheaper when the intended outcome and safe implementation boundary are already clear.

Use codex-workflows when technical choices can change the product scope, user-visible behavior, or a decision that needs to survive across contexts.

For example, a request to extend an existing authentication path can lead to a technically cleaner second mechanism, broader validation, and a new response contract. The frontend may adapt and the tests may pass, while users receive behavior that was never part of the approved change.

codex-workflows controls that expansion throughout the run:

ControlWhat changes
ScopeThe workflow compares the request with the desired outcome, explicit exclusions, the existing code, and rough implementation cost. Work that does not earn its cost is removed before it becomes architecture.
Phase gatesRequirements, design, and planning outputs are checked before they can authorize the next phase. Fresh agents read the approved decisions and evidence they need instead of reconstructing intent from a long conversation.
ExecutionAfter implementation approval, Codex executes the task set autonomously. Each task passes its focused verification and applicable repository checks before its implementation commit.
CompletionIndependent code and security reviews check that the completed change stays within the approved scope and has no serious problems. Required corrections return through the same implementation and quality cycle.

This workflow uses more agent calls and tokens than direct execution. Use it when protecting the approved outcome is worth that cost.

An edge case does not require work simply because Codex can handle it. Additional validation, deterministic behavior, or a new abstraction must protect an approved requirement, an observable contract, or a demonstrated failure.

A real workflow run

The BytePlus Seedream provider integration in mcp-image added a third external image provider across 18 files. Eight planned tasks kept the public MCP request, client, file-save, and file-URI contracts unchanged while the provider-specific implementation evolved.

Before merge, live evaluation established the final model routing, prompt limits, timeout, and response handling. Independent reviews also caught an unbounded file read, a validation bypass, a blocking FIFO path, and inconsistent API-key normalization. All four were fixed, and the PR passed 303 tests across 19 files plus a no-retry live provider call. Across the eight tasks and four fixes, the approved public contracts stayed unchanged.


Quick Start

Requires Node.js 22 or later and the latest Codex CLI.

Install and run

cd your-project
npx codex-workflows install

Then invoke a recipe in Codex CLI:

$recipe-implement Add user authentication with JWT

$ invokes a skill explicitly. Type $recipe- to see the available workflows.

Choose a path

What do you need?Start with
Deliver a change end to end and let the workflow choose the backend, frontend, or fullstack path$recipe-implement
Design first and implement later$recipe-design$recipe-plan$recipe-build
Design and build a React / TypeScript web frontend$recipe-front-design$recipe-front-plan$recipe-front-build
Start directly with separate backend and React frontend design flows$recipe-fullstack-implement
Review an implementation against its design$recipe-review or $recipe-front-review
Define or update repository-specific quality rules$recipe-quality-profile
Investigate a problem without changing code$recipe-diagnose
Run a throwaway experiment or one-shot scriptUse Codex directly

How It Works

flowchart LR
    A[Request] --> B[Agree on the smallest useful outcome]
    B --> C{One evident implementation path?}
    C -->|Yes| S[Direct task cycle and security review]
    S --> L[Complete]
    C -->|No| D[Inspect, design, and review]
    D --> E[Plan dependent work]
    E --> F[Approve implementation scope]
    F --> H[Per task: implement, verify, quality-check, commit]
    H --> K[Independent code and security review]
    K -->|Correction| H
    K -->|Requirement or major design changed| B
    K -->|Passed| L[Complete]

The number of independent product and design decisions determines the route, not file count or the number of edge cases Codex can identify.

ScaleWhat the change needsWhat happens
SmallOne outcome that follows an existing pattern in one part of the systemConfirmed task → implementation → quality and security checks
MediumOne outcome that needs coordination across parts of the system or a lasting design decisionReviewed Design Doc, plus UI Spec / ADR when required → selected integration/E2E proof → reviewed Work Plan → autonomous task cycles → final verification
LargeMultiple outcomes that need separate design decisionsReviewed PRD and Design Docs, plus UI Spec / ADR when required → selected integration/E2E proof → reviewed Work Plan → autonomous task cycles → final verification

An ADR is created only for a durable current-scope choice with at least two materially distinct options. When several choices qualify, their ADRs are reviewed together. An integration or E2E test is selected only when a cheaper test cannot prove the required interaction. Some changes need neither.

Only decisions that affect the product or repository implementation are carried forward in durable project documents. Third-party approval, production access, release execution, and unrelated operational work do not become implementation gates.

After the implementation scope is approved, the orchestrator runs the tasks, focused verification, applicable repository checks, and one implementation commit per task. It resolves problems from the approved documents and repository evidence first. User-visible behavior remains a product boundary rather than something the implementation may adjust for internal consistency. The orchestrator asks you only when progress requires a new product requirement, a change to a major approved design decision, authority only you hold, or an irreversible action you did not authorize.

Each specialist gets a bounded job, the relevant documents and paths, and a clear result to return. The specialist carries that job through completion while the main session keeps product and workflow decisions, steps in only for a decision or concrete blocker, and checks the result before the next phase. This gives specialists room to work without giving them authority to widen the approved outcome.

How decisions survive fresh contexts

Fresh contexts keep exploration, design, implementation, and review from silently sharing assumptions. The included Work Plan template ties each implementation task to its Design Doc section and acceptance criteria:

### P1-T1: Preserve the error response contract

- **Source**: `docs/design/example-design.md`, API contract, AC-2
- **Scope**: Update the repository implementation and its focused tests
- **Depends on**: none
- **Verification**: Run the contract test and observe the documented response shape

The Task File Contract carries the source, intended result, target files, and executable verification into implementation. It adds a Verification Focus only when a test could pass without proving one important behavior. After execution, the applicable repository checks run against the complete task change before commit. Final reviewers compare the completed code with the approved documents. They also look for work outside the approved scope and serious code-quality problems. When a correction is accepted, the next review focuses on the checks that correction could affect. Run $recipe-quality-profile to define repository-specific quality rules in docs/project-context/quality.yaml for implementation and review.


Installation

Requirements

Install

Install into the current project:

cd your-project
npx codex-workflows install

This copies into your project:

  • .agents/skills/: Codex skills (foundational + recipes)
  • .codex/agents/: Subagent TOML definitions
  • Manifest file for tracking managed files

To make the workflows available to Codex across all projects, install them into your user-level CODEX_HOME instead:

npx codex-workflows install --user

This installs skills into $CODEX_HOME/skills/ and agents into $CODEX_HOME/agents/. When CODEX_HOME is not set, it defaults to ~/.codex.

Customize agents

Agent definitions are regular TOML files. For a project installation, edit files in .codex/agents/; for a user-level installation, edit files in $CODEX_HOME/agents/. You can change the model, sandbox_mode, or developer_instructions. Updates preserve files you have edited, as described below.

Update

# Preview what will change
npx codex-workflows update --dry-run

# Apply updates
npx codex-workflows update

# Update a user-level installation
npx codex-workflows update --user

The updater preserves files you have modified locally. It compares each file against its hash at install time and skips changed files. Versioned update history applies file moves and deletions in order, so local changes follow a moved file to its current path. Modified files retired without a replacement are moved to .codex-workflows-preserved/<version>/. New files from the update are added automatically.

# Check installed version
npx codex-workflows status

# Check a user-level installation
npx codex-workflows status --user

Workflow Recipe Reference

Invoke recipes with $recipe-name in Codex. Type $recipe- and use tab completion to see all available recipes.

View all recipe entry points

Backend & General

RecipeWhat it doesWhen to use
$recipe-implementFull lifecycle with layer routing (backend/frontend/fullstack)New features (universal entry point)
$recipe-taskSingle task with rule selectionBug fixes, small changes
$recipe-designRequirements → scale-selected product and design documentsProduct and architecture design
$recipe-planDesign Doc → selective integration/E2E skeletons → work planPlanning phase from an approved Design Doc
$recipe-prepare-implementationPrepare existing repository-local tools needed by an approved Work PlanExplicit setup request or a concrete task capability is unavailable
$recipe-buildExecute backend tasks with validation between stepsResume backend implementation
$recipe-reviewReview implementation scope, Design Doc compliance, code quality, and security; apply corrections approved by the userPost-implementation check
$recipe-quality-profileDefine or update repository-specific quality rules in docs/project-context/quality.yamlSet up or maintain quality rules
$recipe-diagnoseProblem investigation → failure-point verification → solutionBug investigation
$recipe-reverse-engineerGenerate PRD + Design Docs from existing codeLegacy system documentation
$recipe-add-integration-testsAdd integration/E2E tests from Design DocTest coverage for existing code
$recipe-update-docUpdate existing Design Doc / PRD / ADR with reviewSpec changes, document maintenance

Frontend (React/TypeScript)

RecipeWhat it doesWhen to use
$recipe-front-designRequirements → scale-selected UI and design documentsFrontend product and architecture design
$recipe-front-adjustFocused UI adjustment using repository, supplied, or required external evidenceFocused UI changes after implementation
$recipe-front-planFrontend Design Doc → selective integration/E2E skeletons → work planFrontend planning phase
$recipe-front-buildExecute frontend tasks with focused verification and quality checksResume frontend implementation
$recipe-front-reviewReview frontend scope, compliance, code quality, and security; apply React corrections approved by the userFrontend post-implementation check

Fullstack (Cross-Layer)

RecipeWhat it doesWhen to use
$recipe-fullstack-implementFull lifecycle with separate Design Docs per layerCross-layer features
$recipe-fullstack-buildExecute tasks with layer-aware agent routingResume cross-layer implementation

Working State

Recipes use docs/plans/ as ephemeral working state for Work Plans, implementation Task Files, and temporary review-fix or test-addition Task Files. Task and phase progress is updated there after each quality-approved implementation commit, while those progress files stay outside that commit. Add the directory to your project's .gitignore unless your team intentionally wants to review those transient files:

docs/plans/

PRDs, ADRs, UI Specs, and Design Docs are durable project documents and are intended to be committed.


Included Guidance

Recipes load the repository-aware guidance required for the current task. You rarely need to select these skills directly.

View foundational skills
SkillWhat it provides
coding-rulesCode quality, function design, error handling, refactoring
testingProportionate TDD, observable proof selection, test integrity, and repository-required verification
ai-development-guideEvidence-backed root cause, proportionate impact analysis, and applicable quality assurance
reviewee-judgmentEvidence-backed evaluation of received findings before they generate revision work
documentation-criteriaDocument creation rules and templates (PRD, ADR, Design Doc, Work Plan)
requirement-convergenceOutcome, requirement layers, user-decided exclusions, and rough cost before design
implementation-approachDirect MVP, evidence-backed expansion, subtraction, slicing, and verification boundary
integration-e2e-testingSelecting and designing only integration/E2E tests that prove a necessary real interaction
external-resource-contextFocused resolution of one external evidence source required by a current decision
llm-friendly-contextClear prompts, handoffs, generated artifacts, task files, and review findings for downstream agents
task-analyzerTask intent analysis, task type classification, skill selection
subagent-delegationLetting subagents finish assigned work and ask for input when a decision is needed
subagents-orchestration-guideMulti-agent coordination, workflow flows, guided autonomous execution

Web-frontend references are included for TypeScript used in web frontend work, including React applications (coding-rules/references/typescript.md, testing/references/typescript.md). They do not apply to backend TypeScript.


Specialized Agents

Codex spawns these as needed during recipe execution. You do not need to learn them first; recipes route domain work to the relevant agents while the orchestrator retains workflow control. Each agent runs in its own context with specialized instructions and explicitly named required skills.

View all specialized agent roles

Document Creation Agents

AgentRole
requirement-analyzerCompact request signals plus repository-backed scope and cost evidence for orchestrator decisions
prd-creatorPRD creation and structuring
technical-designerComplete ADR-batch or Design Doc creation (backend/general)
technical-designer-frontendComplete frontend ADR-batch or Design Doc creation (React)
ui-spec-designerUI Specification from PRD and optional prototype code
codebase-analyzerCompact repository facts for later technical decisions, minimal design, and verification
ui-analyzerUI facts from external resources (design tools, design-system docs, deployed UI) and frontend code
work-plannerWork plan creation from Design Docs
document-reviewerDocument review against governing requirements and design decisions
design-syncCross-document consistency verification

Implementation Agents

AgentRole
task-decomposerWork plan → the fewest executable implementation task files
task-executorTask-file implementation with focused verification (backend)
task-executor-frontendReact implementation with applicable behavior-focused RTL verification
quality-fixerApplicable repository checks and in-scope quality repair (backend)
quality-fixer-frontendApplicable React, TypeScript, RTL, and bundle checks and repair
acceptance-test-generatorSelected integration/E2E test skeleton generation
integration-test-reviewerTest quality review

Analysis Agents

AgentRole
code-reviewerChecks the completed implementation against the approved scope and documents, and flags serious code-quality problems
code-verifierDocument-code consistency verification
security-reviewerSecurity compliance review after implementation
rule-advisorSkill selection for standalone work not already governed by a recipe
scope-discovererCodebase scope discovery for reverse docs, including PRD unit grouping
technical-spikeBounded empirical evidence for one design-changing effect or cost

Diagnosis Agents

AgentRole
investigatorEvidence collection, path mapping, and failure-point discovery
verifierPath coverage validation and independent failure-point evaluation
solverSolution derivation with tradeoff analysis

Project Structure

After installation, your project gets:

View installed layout
your-project/
├── .agents/skills/           # Codex skills
│   ├── coding-rules/         # Foundational guidance
│   ├── testing/
│   ├── ai-development-guide/
│   ├── reviewee-judgment/
│   ├── documentation-criteria/
│   ├── requirement-convergence/
│   ├── implementation-approach/
│   ├── integration-e2e-testing/
│   ├── external-resource-context/
│   ├── llm-friendly-context/
│   ├── task-analyzer/
│   ├── subagent-delegation/
│   ├── subagents-orchestration-guide/
│   └── recipe-*/             # Workflow entry points ($recipe-*)
├── .codex/agents/            # Subagent TOML definitions
│   ├── requirement-analyzer.toml
│   ├── technical-designer.toml
│   ├── ui-analyzer.toml
│   ├── task-executor.toml
│   └── ... (26 agents total)
└── docs/                     # Created as you use the recipes
    ├── prd/
    ├── design/
    ├── adr/
    ├── ui-spec/
    └── plans/
        └── tasks/

Ecosystem

Nautilus validates product ideas and produces PRDs, while linear-prism turns approved requirements into implementation-ready Linear issues. claude-code-workflows brings the same approach to Claude Code and can be installed alongside codex-workflows.


Design Rationale

Background reading behind the workflow design

License

MIT License. Free to use, modify, and distribute.


Built and maintained by @shinpr