Skip to content
Agentmart
Submit a tool

contracts

Team baseline for external-interface contract artifacts: OpenAPI, JSON Schema, AsyncAPI, .proto, and GraphQL SDL, with spectral, ajv, buf, and…

Skill by ramboz

IndexedMIT★ 7
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/ramboz-contracts

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

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.

Use cases: documents, design, backend, productivity

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/contracts

What's inside

Skill 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.
License
MIT
Instructions
221 lines in SKILL.md · view on GitHub

Files (3)

  • SKILL.md
  • worked-example-json-schema-envelope.md
  • worked-example-openapi-http.md

SKILL.md (first lines)

> 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, TypeBox for TS+JSON-Schema export) acceptable when the team has already standardized. |
| **Config / env vars** | JSON Schema (per config file) or bespoke env-contract pattern | `ajv validate`, custom env-contract checker | `quicktype` (when JSON Schema) | JSON Schema for structured config files; for env-var sprawl, a bespoke env-contract pattern (markdown reference table + `.env.example` seed + stdlib-only checker script + CI gate) is a worked-example-friendly alternative — see [ADR-0005](../../docs/decisions/adr-0005-contracts-as-judgment-skill.md) Context §1 for the case study that motivated this row. |
| **CLI output** | JSON Schema for `--json` / `--format json` output | `ajv validate` in shell-test fixtures | `quicktype` | Lets downstream pipes assume the shape; reproducible test fixtures. |

**Notes on the table:**

- One canonical artifact per surface — firmer nudge than a menu, with
  stack-coupled alternatives called out inline (rather than as
  separate rows) so the table stays scan-friendly.
- Internal data shapes is the row most likely to draw push-back: Zod /
  Pydantic / TypeBox have real ergonomic wins inside their respective
  stacks. The recommendation is JSON Schema because (a) it's portable
  across stacks, (b) the JSON-Schema → TS-types codegen path is
  already mature via `quicktype`. If a team is single-stack and
  committed, opting into Zod / Pydantic with optional JSON-Schema
  export (e.g., `zod-to-json-schema`) is a reasonable opt-out.
- Smithy is listed as an RPC alternative because AWS-native projects
  often standardize on it; for everything else, `.proto` wins on
  ecosystem maturity.

## When to opt out

**The skill nudges; it does not refuse edits.** Slice 022-02 will wire
two structural touchpoints that make declared surfaces visible to the
spec-author at init time (`/jig:vision-elicitation` Appendix A) and to
the independent reviewer at slice-review time (`review.py` prompt
template). Even with those wired, no part of jig blocks a commit or
rejects a slice for skipping an artifact — the wizard skips on empty
answer, the reviewer flags a *suggestion*, and `migrate.py report`
*recommends* per surface without auto-rewriting.

Legitimate opt-out scenarios:

- **Migration of a project with a working bespoke pattern.** If a
  project already ships a contract-shaped artifact (e.g., the
  `env-contract.md` + `.env.example` + stdlib-checker triple from
  aso-shallow-validator), don't force a migration. The pattern works;
  the recommendation table is for new surfaces.

From ramboz/jig, MIT.

More from ramboz/jig

Signals

Stars
7
Forks
1
Open issues
10
Last commit (this folder)
Jul 15, 2026 (3 months ago)
Last release
Oct 5, 2026 (25 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from ramboz

Cite this page

contracts skill. Agent Mart. https://agentmart.dev/skills/ramboz-contracts (last updated 2026-10-24)