Skip to content
Development
Skill

/contracts

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.

From plugin
jig
720 skills3 agents5 hooks

Claude Code

$ npx -y skills add ramboz/jig --skill contracts --agent claude-code

SKILL.md

contracts.SKILL.md
name: contracts
description: >
  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.
user-invocable: true

> Spec 022 promoted this skill from a deliberate stub > ([ADR-0002](../../docs/decisions/adr-0002-contracts-stays-deferred.md)) > to jig's **team baseline** for external-interface contract artifacts, > following the reframing in > [ADR-0005](../../docs/decisions/adr-0005-contracts-as-judgment-skill.md). > Like `/jig:pr-review` (spec 012), `/jig:arch-review` (spec 014), and > `/jig:vision-elicitation` (spec 017), it ships as SKILL.md only — no > `.py` helper. The skill recommends the canonical industry-standard > schema per external surface and points at the ecosystem tools that > validate it. It does **not** write schemas, **not** scaffold a > `contracts/` directory, and **not** enforce contracts via PreToolUse > hooks. Enforcement is structural via the spec-author's first-pass > attention and the independent-review reviewer prompt's second-pass > check — both wired in slice 022-02.

What this skill does

For each external surface a project exposes (HTTP API, event bus, RPC, GraphQL, internal data shapes, CLI output, config), this skill recommends:

1. **The canonical artifact** — what to put on disk (e.g., `openapi.yaml`, `*.schema.json`, `*.proto`, `schema.graphql`). 2. **The validation tool** — what runs in CI to keep code and artifact in sync (e.g., `spectral lint`, `ajv validate`, `buf lint`, `graphql-inspector diff`). 3. **The codegen tool** — what produces typed clients / server stubs / TS types from the artifact, when ecosystem-appropriate (e.g., `openapi-typescript`, `quicktype`, `buf generate`).

The skill is **breadth over depth**: catch the right artifact per surface, leave language-specific niceties (Zod vs JSON Schema vs Pydantic vs TypeBox for internal shapes) to a richer user-installed contracts skill or to the dev's judgment. The recommendations are a nudge; the dev decides whether to follow them.

When to use vs. when to defer

  • **Any other installed contracts skill.** Common location:

`~/.claude/skills/contracts/` — but the deferral is **category-based, not name-based**, so a skill named anything (`contracts`, `schema-design`, `contract-first`, `api-contracts`, etc.) whose description claims external-interface contract artifacts, API schema design, or contract-first workflow will be preferred. If one is present, **defer to it.** The Claude Code skill router should route to the more specific skill automatically; if you want to be sure, explicitly invoke it.

  • **`/jig:arch-review`** — sibling jig skill that reviews the

**design** of an API surface (the proposal, the trade-offs, the failure modes). This skill is downstream: once the design is locked, formalize the resulting interface as a contract artifact. Reach for `/jig:arch-review` to debate whether the API should exist; reach for this skill once it does.

  • **`/jig:adr-workflow`** — if the dev decides to systematically opt

out of the canonical recommendation for a surface (e.g., "we'll keep our bespoke env-contract checker, not migrate to a JSON Schema + ajv triple"), capture the rationale in an ADR. This skill nudges; ADRs document the choice when the nudge is declined.

  • **The deferred ADR-0002 stub concept** (internal module-boundary

enforcement, cross-module Python imports, kitchen-sink scaffolding). Not this skill. ADR-0002 stays in force for the internal-boundary problem; ADR-0005 carved out external-interface artifacts as the separate concern this skill addresses.

Rule of thumb: **external interface a caller depends on → this skill. Internal Python imports → not this skill.**

Per-surface artifact recommendations

The table below is the canonical reference. Each row prescribes the recommended artifact + validation tool + codegen tool (where the ecosystem affords one). Rationale: the most portable artifact with the richest ecosystem tooling, biased toward stack-agnostic choices when possible.

| Surface | Recommended artifact | Validation | Codegen | Rationale | |---|---|---|---|---| | **HTTP API** | OpenAPI 3.x (`openapi.yaml`) | `spectral lint`, `redocly lint` | `openapi-typescript`, `openapi-generator`, `orval` | De facto industry standard; richest ecosystem; vendor-neutral. | | **Event bus / async messaging** | AsyncAPI (`asyncapi.yaml`) | `asyncapi/parser`, `spectral` (AsyncAPI ruleset) | `asyncapi/generator` (clients, docs, code) | Same shape as OpenAPI from the same maintainers; portable across Kafka / NATS / MQTT / WebSocket. | | **RPC** | Protocol Buffers `.proto` (or Smithy for AWS-native) | `buf lint`, `buf breaking` | `buf generate` (Go / TS / Java / Python / etc.) | Schema-first by design; codegen is the primary workflow, not an afterthought. | | **GraphQL** | SDL (`schema.graphql`) | `graphql-inspector diff`, `spectral-graphql` | `graphql-codegen` | Native to the GraphQL toolchain; SDL is the single source of truth across server and client. | | **Internal data shapes** | JSON Schema (`*.schema.json`) | `ajv validate` | `quicktype`, `json-schema-to-typescript` | Portable across ecosystems; most language-agnostic. Stack-coupled alternatives (Zod for TS, Pydantic for Python

Read more
@ramboz
Ships withjig

A Claude Code and Codex plugin that scaffolds AI-native development practices into new projects. jig adds a repeatable spec, implementation, review, and memory workflow to AI-assisted software projects.

720 skills3 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
7
Star history of ramboz/jig on GitHub, a chart by star-history.com

Other skills on jig.

adr-workflow

adr-workflow

Scaffold, accept, index, and link Architectural Decision Records (ADRs). Use when the user says "write an ADR", "record this…

@ramboz@rambozInstall Skill
analyze

analyze

Cross-artifact consistency report for jig specs — a non-destructive six-category audit at CRITICAL/HIGH/MEDIUM/LOW severity,…

@ramboz@rambozInstall Skill
arch-review

arch-review

Team baseline for architecture, design-doc, and RFC review — produces summary, strengths, concerns, and open questions.…

@ramboz@rambozInstall Skill
bug-fix

bug-fix

Drive the teeth-gated lifecycle for reported defects: diagnose root cause, prove it, and prevent regression through REPORTED →…

@ramboz@rambozInstall Skill
clarify

clarify

Lightweight spec clarification scan for jig projects — a six-category ambiguity audit that asks up to five prioritized questions…

@ramboz@rambozInstall Skill
code-health

code-health

Run a static-analysis pass on a project — detect the ecosystem (Python or Node), drive its linter (ruff / eslint, plus advisory…

@ramboz@rambozInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about contracts.

Which coding agents can use contracts?
contracts installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.