Skip to main content

pactkit-codex

PactKit PDCA workflow framework adapted for OpenAI Codex CLI.

PyPI version Python 3.10+ License: MIT

What is this?

pactkit-codex brings the PactKit spec-driven development workflow to OpenAI's Codex CLI. It deploys:

  • AGENTS.md — Global constitution with agent roles and PDCA routing
  • Command Skills — PDCA workflow entries ($project-plan, $project-act, etc.)
  • Skills — Standalone Python scripts (visualize, board, scaffold)
  • Rules — Modular governance rules loaded on-demand per command

Installation

pip install pactkit

pactkit-codex is automatically installed as a dependency of pactkit.

Quick Start

# Deploy PactKit configuration to ~/.codex/
pactkit-codex init

# Update when pactkit-codex is upgraded
pactkit-codex update

# Check version
pactkit-codex version

What Gets Deployed

After running pactkit-codex init:

~/.codex/
├── AGENTS.md              # Global constitution (~6KB)
├── config.toml            # Model, sandbox, MCP config
├── .pactkit-version       # Version marker for updates
├── rules/                 # 9 rule files (on-demand loading)
│   ├── 01-core-protocol.md
│   ├── 02-hierarchy-of-truth.md
│   └── ...
└── skills/                # Skills and PDCA command entries
    ├── pactkit-visualize/
    ├── project-plan/
    ├── pactkit-board/
    └── ...

./                         # Project root
├── AGENTS.md              # Project instructions (PactKit-managed)
└── .codex/
    ├── pactkit.yaml       # Project config
    └── AGENTS.local.md    # Your custom instructions (never overwritten)

Commands

Initialization

pactkit-codex init                    # Full deployment
pactkit-codex init -t /tmp/preview    # Deploy to custom directory

Update

pactkit-codex update                  # Incremental update (if version changed)
pactkit-codex update --if-needed      # Silent no-op if current (for hooks)
pactkit-codex update --force          # Force redeploy even if current
pactkit-codex update --dry-run        # Show what would change

Utilities

pactkit-codex version                 # Show version
pactkit-codex spec-lint <file>        # Validate spec structure
pactkit-codex doctor                  # Check project health
pactkit-codex visualize --lazy        # Generate code dependency graphs

PactKit commands run directly in the current Codex session. They do not dispatch a separate runner, require a run ID, or create a resumable background workflow.

PDCA Workflow Commands

Once deployed, use these commands in Codex CLI (prefix $):

Command Phase Purpose
$project-init Bootstrap Initialize project governance
$project-design Plan Greenfield product design
$project-plan Plan Break down requirements into specs
$project-act Act Implement code per spec (TDD)
$project-check Check QA verification
$project-done Done Finalize and document
$project-release Done Version release
$project-pr Done Create pull request
$project-hotfix Act Quick fix bypass
$project-clarify Plan Clarify requirements

Project Structure

Your project should have:

your-project/
├── AGENTS.md                    # PactKit-managed (auto-generated)
├── .codex/
│   ├── pactkit.yaml             # Project config
│   └── AGENTS.local.md          # Your custom instructions
├── docs/
│   ├── specs/                   # Requirement specifications
│   │   ├── STORY-001.md
│   │   └── ...
│   └── product/
│       ├── sprint_board.md      # Current sprint tasks
│       └── context.md           # Project context (auto-generated)
└── tests/
    ├── unit/
    └── e2e/

Codex CLI vs Claude Code

This project adapts PactKit for Codex CLI, which has different capabilities:

Feature Claude Code Codex CLI pactkit-codex Solution
Multi-agent Native Single agent Prompt-level role conventions
Custom commands /project-* $project-* Deploy to ~/.codex/skills/project-*/SKILL.md
Rule loading @import None Agentic routing (Prerequisites header)
Config settings.json config.toml Generate with defaults

Configuration

pactkit.yaml

stack: python          # Detected automatically
version: 0.0.1         # Your project version
root: .
developer: ""          # Optional: your name prefix for Story IDs

Custom Instructions

Add your project-specific instructions to .codex/AGENTS.local.md:

# Project Local Instructions

## Build Commands
- Run tests: `pytest tests/ -v`
- Lint: `ruff check src/`

## Project Conventions
- Use snake_case for Python
- All APIs must have OpenAPI docs

This file is never overwritten by pactkit-codex updates.

Development

# Clone
git clone https://github.com/anthropics/pactkit-codex.git
cd pactkit-codex

# Install dev dependencies
pip install -e ".[multilang]"

# Run tests
pytest tests/ -v

# Lint
ruff check src/ tests/

License

MIT License - see LICENSE for details.

Related Projects

Release files for pactkit-codex 2.24.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pactkit-codex 2.24.0
File Size Uploaded
pactkit_codex-2.24.0.tar.gz 20.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pactkit-codex 2.24.0
File Interpreter ABI Platform
pactkit_codex-2.24.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.6 kB

Release files / pactkit_codex-2.24.0.tar.gz

Download URL pactkit_codex-2.24.0.tar.gz
Size 20.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fcde8dfd32808b48f982f3eb0be46e05482b57231525c5b92c4e24de289137b5
BLAKE2b-256 checksum
How to use checksums
3f690b0b35a146bac10370699d7f7451e49b7f9e1d5ca264876fd014856f9402
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.

Transparency log

Release files / pactkit_codex-2.24.0-py3-none-any.whl

Download URL pactkit_codex-2.24.0-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
71ca1f1ef41b4d21e377d1817a2b83610db72dcfa0fd4d4aec8aa06cdece4809
BLAKE2b-256 checksum
How to use checksums
1d7666151013a699653bb3b8e32a6fcf602eb9dfad15c7b80ea6d740c2f50f80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.

Transparency log

Release history Release notifications | RSS feed

3.0.1

2 release files

3.0.0

2 release files

2.27.0

2 release files

2.26.0

2 release files

2.25.0

2 release files

This release

2.24.0 This release

2 release files

2.20.0

2 release files

2.17.0

2 release files

2.11.0

2 release files

2.10.2

2 release files

2.9.1

2 release files

2.9.0

2 release files

2.8.0

2 release files

2.7.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page