Install · Initialise · First skill

Start in a repository.

Requires Node.js 18.17 or newer. Install globally so cg is available in later sessions. Nothing in your repository changes until you run cg init there.

Install the CLI

npm install --global contract-graph
cg --version

That installs the CLI, its YAML parser, the scaffold, and the eight lifecycle skills. Use that global cg for repository commands and hooks. cg init installs skills and context; it does not add Contract Graph to the adopting application’s npm dependencies.

To identify a development build precisely, run cg --version --json. cg status compares the running CLI’s build identity with the installation record.

Initialise a repository

cd your-repository
cg init

In a terminal, init confirms this directory, then lets you pick editor and agent support. Restart or reload the IDE so the /cg-* skills appear.

Non-interactive init needs --docs docs (or another single-directory root) when docs/ already exists.

Choose the next skill

Existing code

Warmup

Run cg modules, then /cg-warmup in a new chat. If roots are still unmapped, that is adoption. If every root is already governed, that is reseed: warmup adds missing children, product rules, and route targets without rewriting existing purpose or P IDs.

Until adoption finishes, cg verify: OK means the scaffold is well-formed, not that this repository is governed.

New repository

Plan or prototype

Fill the root contract’s purpose, boundaries, and routes. If the outcome is understood, start with /cg-plan. If you still need to feel the experience, start with /cg-prototype.

Supported discovery

Cursor, Codex, Antigravity

Share the agents profile: AGENTS.md and .agents/skills/.

Claude Code

Uses its own adapter. An optional gate can compare a requested skill with cg next.

GitHub Copilot

VS Code agent mode, with its own installation profile.

Already on 0.3.0 or 0.4.0?

Install 0.5.0, run cg init --yes --docs docs, reload the IDE, then /cg-warmup. Framework skills and schemas update; contracts and catalogs stay yours. See the upgrade guide.