# Contracts

> Contracts is an open-source agent skill for developer tools. Recommends the right contract artifact and validator for each external API surface. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/ramboz/jig/tree/main/hosts/claude/skills/contracts
- **Repository:** https://github.com/ramboz/jig
- **GitHub stars:** 6
- **License:** MIT
- **Skill name:** contracts
- **Collection:** https://github.com/ramboz/jig
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill is a team baseline for external-interface contracts such as HTTP APIs, event buses, RPC, GraphQL, internal data shapes, config files and CLI JSON output. For each surface it points the agent to a canonical artifact (OpenAPI, AsyncAPI, Protocol Buffers, GraphQL SDL or JSON Schema), the validation tool to run in CI, and where it fits, a codegen tool. The table behind these recommendations is stack-neutral, while the bundled worked examples use JavaScript and Node tooling.

The skill is advisory by design. It does not write schemas, create a contracts directory, generate artifacts from code or enforce anything through hooks. It also defers to any more specific contract skill installed alongside it, and it suggests recording a deliberate departure from the recommended artifact in an architecture decision record rather than blocking it.

It ships as a SKILL.md with supporting markdown files and no scripts. Using it means having a project whose interfaces need documenting, and the tools it names (spectral, ajv, buf, graphql-inspector) must be installed by the developer, who also pins their versions.

## When your agent uses it

> Team baseline for external-interface contract artifacts: OpenAPI, JSON Schema, AsyncAPI, .proto, and GraphQL SDL, with spectral, ajv, buf, and graphql-inspector validation. Nudges devs toward contract-first artifacts; never writes them and never scaffolds a contracts/ directory. Auto-triggers for what contract should I use for this API, do we have an OpenAPI spec, add a JSON schema for this, recommend a schema for this endpoint, validate this API contract, or what's the right artifact for events. Defers to any other installed skill whose description identifies it as handling external-interface contract artifacts, API schema design, or contract-first workflow. Do not use for internal module-boundary refactoring, scaffolding a contracts/ directory, or auto-generating schemas from code.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/ramboz/jig/tree/HEAD/hosts/claude/skills/contracts)
- [License: MIT](https://github.com/ramboz/jig/tree/HEAD/hosts/claude/skills/contracts)

## Features

- **Surface-to-artifact mapping:** A reference table pairs each external surface with its recommended contract format.
- **Validation tool suggestions:** Names the linters and diff tools to run in CI for each artifact type.
- **Codegen recommendations:** Suggests client and type generators where the ecosystem supports them.
- **Deferral to specialised skills:** Yields to any installed skill focused on contract artifacts or schema design.
- **Opt-out guidance:** Explains when a bespoke or existing pattern is acceptable and how to document it.
- **Worked examples:** Includes an OpenAPI HTTP API walkthrough and a JSON Schema envelope walkthrough.

## Good for

- Decide whether an API should be described with OpenAPI or AsyncAPI
- Find out which validator to add to CI for a GraphQL schema
- Pick a JSON Schema for a CLI tool's --json output
- Check whether a project already has an OpenAPI spec
- Recommend a contract format for a new event stream

## Install

### Claude Code

This skill ships in the `jig` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add ramboz/jig
/plugin install jig@jig
```

Or copy only this skill to `~/.claude/skills/contracts`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ramboz/jig.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/contracts &&
cp -R "$tmp/hosts/claude/skills/contracts" ~/.claude/skills/contracts &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/contracts` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/contracts` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ramboz/jig.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/contracts &&
cp -R "$tmp/hosts/claude/skills/contracts" ~/.agents/skills/contracts &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/contracts` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/contracts` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ramboz/jig.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/contracts &&
cp -R "$tmp/hosts/claude/skills/contracts" ~/.cursor/skills/contracts &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/contracts` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ramboz/jig.git --path hosts/claude/skills/contracts
```

Or copy the folder to `~/.gemini/skills/contracts` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/contracts`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ramboz/jig.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/contracts &&
cp -R "$tmp/hosts/claude/skills/contracts" ~/.copilot/skills/contracts &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/contracts` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ramboz/jig.git
```

Then copy `jig/hosts/claude/skills/contracts` into your agent's skills folder as `contracts`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Does Contracts generate schema files for me?

No. It recommends artifacts and tools but never writes schemas or scaffolds a contracts directory.

### What happens if I already have a more specific contracts skill installed?

This skill defers to any other installed skill whose description covers external-interface contract artifacts, API schema design or contract-first workflow.

### Will Contracts block a commit if I skip a contract artifact?

No. The guidance is a nudge and no part of the workflow rejects a change for skipping an artifact.

### Is Contracts meant for internal module boundaries?

No. It targets interfaces that callers depend on, not internal Python imports or module-boundary refactoring.

### How do I install Contracts in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/contracts to use it in all your projects, or to .claude/skills/contracts in one project. Or install the jig plugin, which includes it: /plugin marketplace add ramboz/jig, then /plugin install jig@jig.

### Does Contracts run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Contracts?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Contracts?

The closest alternatives to Contracts are Contract first, Contract design, API, Patterns and Conventions codex.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Contract first](https://ai-powered.com/skills/contract-first): Contract first is an open-source agent skill for developer tools.
- [Contract design](https://ai-powered.com/skills/contract-design): Contract design is an open-source agent skill for developer tools.
- [API](https://ai-powered.com/skills/api): API is an open-source agent skill for developer tools.
- [Patterns](https://ai-powered.com/skills/patterns-xiaolai): Patterns is an open-source agent skill for developer tools.
- [Conventions codex](https://ai-powered.com/skills/conventions-codex-xiaolai): Conventions codex is an open-source agent skill for developer tools.
- [Architect](https://ai-powered.com/skills/architect-michael-denyer): Architect is an open-source agent skill for developer tools.
- [Conventions](https://ai-powered.com/skills/conventions-xiaolai): Conventions is an open-source agent skill for developer tools.
- [Use smart contract platform](https://ai-powered.com/skills/use-smart-contract-platform): Use smart contract platform is an open-source agent skill for legal and government.

---
Source: https://ai-powered.com/skills/contracts-ramboz
