PactKit

PactKit supports multiple AI coding tools. Every install goes through pip — there is no separate plugin or marketplace channel.

Option A: pip Install (Claude Code, OpenCode, Codex CLI)

Claude Code support ships in the core package. OpenCode and Codex CLI are opt-in extras, so install the ones you use:

pip install pactkit                 # Claude Code (classic)
pip install "pactkit[opencode]"     # + OpenCode
pip install "pactkit[codex]"        # + Codex CLI
pip install "pactkit[all]"          # both, plus the lint and visualize extras

Requirements

  • Python 3.10+
  • One or more supported AI coding tools installed

Install & Deploy (All IDEs)

pip install pactkit
pactkit init

Optional Extras

PactKit ships optional dependency groups for enhanced functionality:

pip install pactkit[lint]        # Includes ruff for lint gate
pip install pactkit[visualize]   # Includes tree-sitter for AST-based visualization
pip install pactkit[all]         # Everything (lint + visualize + IDE adapters)

These tools integrate with PactKit but cannot be distributed via pip:

ToolPurposeInstallFallback
ghGitHub CLI (issue sync, release, PR)brew install ghIssue sync disabled
codegraphSymbol index & call chain analysisnpm install -g codegraphFalls back to grep/find

All external tools degrade gracefully — PactKit works without them, but specific features (issue sync, code graph queries) will be unavailable.

This deploys to all three IDEs in one step:

IDEDeploy PathKey Files
Claude Code~/.claude/CLAUDE.md, rules/, agents/, commands/, skills/
OpenCode~/.config/opencode/AGENTS.md, rules/, agents/, commands/, skills/, opencode.json
Codex CLI~/.codex/AGENTS.md, prompts/, config.toml

Single-IDE Deployment (Optional)

Use --format to target a specific IDE:

pactkit init --format classic   # Claude Code only
pactkit init --format opencode  # OpenCode only
pactkit init --format codex     # Codex CLI only

Update & Upgrade

pip install --upgrade pactkit
pactkit update                    # Re-deploy all IDEs
pactkit upgrade --format opencode # Re-deploy single IDE

Other Commands

# Check version
pactkit version

# Preview to custom directory
pactkit init -t /tmp/preview
pactkit init --format opencode -t /tmp/oc-preview

IDE Format Details

The following sections describe format-specific differences. You don't need to read these unless you want to understand how PactKit adapts to each IDE.

Claude Code

PathContents
CLAUDE.mdConstitution root (references 8 rule modules via @import)
rules/7 modular rule files
agents/9 agent definitions
commands/12 Core-managed lifecycle entry points
skills/19 specialized and portable method skills

OpenCode

PathContents
AGENTS.mdSlim header (rules loaded via opencode.json instructions)
rules/8 rule files (3 core always-load via instructions + 6 on-demand via @reference)
agents/9 agent definitions (mode: subagent, tools as record format)
commands/12 Core-managed lifecycle entry points (agent: build + routing)
skills/19 skills (with SKILL.md frontmatter for auto-discovery)
opencode.jsonGlobal config (instructions, preserves user provider config)

Key Differences from Claude Code:

FeatureClaude CodeOpenCode
Rules loading@import in CLAUDE.md (all 8 rules)Lazy split: 3 core in instructions + 6 on-demand via @reference in AGENTS.md
Agent formatname:, permissionMode:, string toolsmode: subagent, no name, record tools
Command frontmatterallowed-tools: [...]agent: build + model: provider/model-id
Config file.claude/pactkit.yaml.opencode/pactkit.yaml
Model routingPrompt-level suggestionConfig-level enforcement via model: frontmatter

Lazy Rule Loading: OpenCode v2.1.1 introduced lazy rule loading to reduce token consumption by ~62% per turn. Core rules (3 files) load every turn via opencode.json instructions; on-demand rules (6 files) are read only when needed.

Model Routing: OpenCode commands automatically route to appropriate models:

CommandsModelReason
/project-plan, /project-clarify, /project-designInherit main modelDeep reasoning tasks
/project-act, /project-done, /project-check, etc.SonnetImplementation tasks
Background (title, compression)Haiku (small_model)Lightweight tasks

Configure in pactkit.yaml:

command_models:
  project-act: sonnet
  project-done: sonnet
  project-check: sonnet

Codex CLI

PathContents
AGENTS.mdSingle-agent file with 10KB budget + truncation
skills/project-*/SKILL.md12 managed lifecycle command facades
config.tomlUser-owned Codex configuration; PactKit never rewrites an existing file
.pactkit-deployed.jsonVerified host capability and deployment hashes

Key Differences from Claude Code:

FeatureClaude CodeCodex CLI
Agent modelMulti-agent (9 roles)App Server thread + Core WorkUnits
Command formatCommand playbooksSkills with SKILL.md frontmatter
Config format.claude/pactkit.yaml.codex/pactkit.yaml + config.toml
Brand referencesClaude-nativeAuto-replaced (Claude → Codex)
Sprint commandNative multi-agent orchestrationSerialized Plan → Act → Check → Done fallback
RecoveryClaude lifecycle integrationPersisted thread, cross-process thread/resume, versioned retry

Option B: GitHub Copilot

Copilot works differently from other adapters. It deploys to the project-level .github/ directory — not a user-level ~/ path. Each new project requires its own pactkit init --format copilot.

pip install pactkit pactkit-copilot
cd your-project
pactkit init --format copilot

Then open the project in your Copilot-enabled IDE and run /project-init.

PathContents
.github/skills/19 skills with SKILL.md frontmatter
.github/agents/9 agent definitions (individual .md files)
.github/prompts/12 slash commands (.prompt.md files)
.github/copilot-instructions.mdProject-level instructions

Key Differences from Other IDEs:

FeatureClaude Code / OpenCode / CodexCopilot
Deploy targetUser-level (~/)Project-level (.github/)
Setup frequencyOnce for all projectsPer project
Rules loading@import / @reference / inlineInline only (no @include)
Install packagepactkit (bundled)pactkit + pactkit-copilot
Sprint commandNative or serialized fallbackSerialized fallback

For the full guide, see GitHub Copilot.

Option C: Trae (Coming Soon)

Trae integration is under active development.

Trae support is planned for a future release. The adapter will follow the same thin-adapter pattern as OpenCode and Codex — install pactkit-trae and run pactkit init --format trae. Stay tuned for updates.

Project Initialization

After installing PactKit (via any method), initialize each project you work on:

/project-init

This creates the governance structure (docs/specs/, docs/product/sprint_board.md, docs/architecture/graphs/, etc.) and environment-appropriate project instructions:

  • Claude Code: .claude/CLAUDE.md with architecture overview, dev commands, and @ references
  • OpenCode: ./AGENTS.md + opencode.json with permission, mcp template, and instructions
  • Codex CLI: .codex/AGENTS.md + config.toml with sandbox and hooks configuration
  • Copilot: .github/copilot-instructions.md + agents/prompts/skills (requires pactkit init --format copilot first)

Forgot to initialize? No problem — /project-plan and /project-doctor automatically detect uninitialized projects and handle it for you.

Multi-Developer Collaboration

For teams, set the developer field in pactkit.yaml to avoid Story ID conflicts:

developer: alice

Story IDs become STORY-alice-001, preventing merge conflicts when multiple developers work on separate branches. See Configuration for details.

On this page