npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

code-pact

v1.19.0

Published

Design Control Plane for AI Coding Agents

Readme

code-pact

npm version License: MIT Node.js version

A vendor-neutral control plane for AI coding agents.

Claude Code writes CLAUDE.md. Codex writes AGENTS.md. Cursor writes .cursor/rules/. Each AI coding agent has its own conventions for instruction files, skills, and progress tracking. Switching between them — or running more than one against the same project — means hand-editing parallel state.

code-pact gives any supported agent the same deterministic CLI for fetching task context, recording progress, and verifying completion criteria. The agent calls a small set of commands; code-pact keeps design/ as the structured source of truth and .code-pact/state/progress.yaml as the operational log. Adapters generate the per-agent instruction files so each agent sees its own world without the project state diverging.

v1.0 ships stable adapters for claude-code, codex, and generic. The cursor and gemini-cli adapters are experimental — they ship, they work, but their generated file formats may shift in minor releases to track upstream tooling changes.

# 30-second tour — runs the whole loop in a throwaway sandbox, writes nothing to your repo:
npx code-pact tutorial

Want to drive the loop yourself in a real project? Scaffold the sample TUTORIAL phase, then walk it command by command:

npx code-pact init --non-interactive --agent claude-code --locale en-US --sample-phase
code-pact adapter install claude-code --json
code-pact task prepare TUTORIAL-T1 --agent claude-code --json  # single per-task entry: state + recommendation + the exact commands to run
code-pact task start TUTORIAL-T1
# ... agent implements ...
code-pact verify --phase TUTORIAL --task TUTORIAL-T1           # run the phase's verification commands
code-pact task complete TUTORIAL-T1                            # re-runs verify, appends a done event
code-pact task finalize TUTORIAL-T1 --json                    # preview the design-status flip (dry-run is the default)
code-pact task finalize TUTORIAL-T1 --write --json            # apply it
code-pact validate                                            # CI-friendly health check

task prepare is the recommended per-task entry point: one call returns the current state, the execution recommendation, the context pack metadata, and a commands dictionary with the exact next commands. recommend and task context remain available as standalone diagnostics. (A plain init without --sample-phase starts with an empty roadmap — you add your own phases; see getting-started.)

Status

v1.0 freezes the public CLI surface — flags, exit codes, JSON envelope shapes, and error codes are stable across the v1.x line. The full stability taxonomy (Stable (v1.0) / Stable (human-output) / Experimental / Deprecated) lives in docs/cli-contract.md.

Release notes live in CHANGELOG.md. Upgrade guidance lives in docs/upgrading.md (within v1.x it is just a version bump; pre-v1.0 alpha notes are archived in docs/migration.md).

Install

# One-off invocation (no install)
npx code-pact --version

# Global install
npm install -g code-pact
code-pact --version

Past alpha releases remain available under the alpha dist-tag (npm install code-pact@alpha) for users who pinned to pre-v1.0 behaviour. New projects should use the default (latest) tag.

Contributors can also run from a clone with pnpm link --global, or install a local tarball produced by npm pack — see Development.

Getting started

docs/getting-started.md is the canonical first-thirty-minutes guide. It walks several onboarding approaches side by side:

  • Smoke testcode-pact tutorial runs the whole loop end to end in a throwaway sandbox (nothing is written to your repo); or scaffold a real sample phase with init --sample-phase.
  • Agent-firstplan prompt --schema-only gives your agent the output shape; it emits a roadmap YAML you ingest with phase import.
  • Existing-plan adoption — already have a roadmap.md / TODO.md / draft YAML? plan adopt converts it into phases and tasks deterministically, no AI round-trip.
  • Code-pact-first — capture a brief + constitution, then plan prompt and have your agent draft the full roadmap from them.
  • Manual — write the roadmap by hand with a mix of interactive wizards and flag-based commands.

They all converge on the same per-task agent loop, entered through task prepare (task preparetask start → implement → verifytask completetask finalize). See docs/per-task-loop.md for the lifecycle diagram and a worked example. recommend and task context remain available as standalone diagnostics — task prepare surfaces both for you in one call.

New to the terms used here (context pack, envelope, derived state, …)? The docs/glossary.md defines them in plain language.

Starting fresh, or adopting on an existing repo? Two workflow guides cover each case — greenfield and brownfield. The full documentation index — including the Japanese docs — lives at docs/ (日本語).

Reference docs

| Doc | What it covers | | --- | --- | | docs/per-task-loop.md | The canonical per-task lifecycle — state diagram, the verbs, and a worked example. | | docs/glossary.md | Plain-language definitions for every code-pact term used in the docs. | | docs/positioning.md | What code-pact is, what it deliberately is not, the core CLI surfaces, and the success metrics the project measures itself against. | | docs/agent-contract.md | The v1.11+ agent contract: what code-pact guarantees, what adapter conformance requires of each agent integration, and the recommended per-task lifecycle. | | docs/getting-started.md | First-thirty-minutes guide (onboarding approaches + the per-task loop). | | docs/cli-contract.md | Full flag / exit code / JSON envelope / error code reference and the Stability taxonomy. | | docs/upgrading.md | How to upgrade — additive within v1.x; pointers for coming from a pre-v1.0 alpha. | | docs/troubleshooting.md | Diagnostic code → recovery action for the most common error codes. | | docs/community.md | Where to file issues / discussions / PRs, the GitHub Discussions intent, and the scope-discipline rule for the Non-goals list. |

Maintainers: see docs/dogfood.md (quick guide) and docs/maintainers/operations.md (deeper operations) for running code-pact on code-pact itself.

Supported agents

| Agent | Status | Adapter output | | ------------- | ---------------- | ------------------------------------------------------------------------- | | claude-code | stable | CLAUDE.md, .claude/skills/, .claude/hooks/, .context/claude-code/ | | codex | stable | AGENTS.md, .context/codex/ | | generic | stable | docs/code-pact/agent-instructions.md, .context/generic/ | | cursor | experimental | .cursor/rules/code-pact.mdc (alwaysApply: true), .context/cursor/ | | gemini-cli | experimental | GEMINI.md, .context/gemini-cli/ |

The cursor adapter writes a Cursor Project Rule.cursor/rules/code-pact.mdc with alwaysApply: true so the agent always sees code-pact's workflow. .cursorrules (the legacy single-file format, deprecated in Cursor 0.43) is not written. The adapter is marked experimental because the .mdc format and placement may shift across Cursor releases.

The gemini-cli adapter writes GEMINI.md at the project root. Gemini CLI auto-discovers GEMINI.md files hierarchically (CWD → parent dirs up to .git, plus ~/.gemini/GEMINI.md). Install Gemini CLI only from the official google-gemini org — typosquat packages have been reported on npm.

The generic adapter writes one human-readable instructions file that you can copy or symlink into any other agent's expected location while the dedicated adapters land.

Non-goals (MVP)

These are deliberate, permanent boundaries — not a backlog. code-pact will not add them; each is ruled out to keep the "agent calls one stable CLI" promise (see docs/positioning.md).

  • No LLM API calls — your agent does the inference; code-pact never calls a model.
  • No web UI, daemon, or vector database — it runs as a CLI and exits.
  • No GitHub / Linear / Jira integration — you wire those into your own agent or CI.
  • No multi-agent orchestration — one task, one agent per invocation.
  • No RAG / semantic search — context selection is deterministic, not embedding-based.

Requirements

  • Node.js >= 22 (LTS or current)
  • pnpm (for contributors building from source)

Development

pnpm install
pnpm typecheck
pnpm test
pnpm build
node dist/cli.js --version

For dogfooding code-pact against code-pact itself, see docs/dogfood.md.