api-contractlisted
Install: claude install-skill gonimar/claude-web-studio
# API Contract
Reply in the project conversation language (CLAUDE.md → Language); code, identifiers, paths and commit messages stay in English.
Template `.claude/docs/templates/api-contract.md`; references `graphql.md`, `web-platform.md` (REST conventions), rules `api-contracts.md`.
## Phase 1: Scope and style
Style from technical-preferences (GraphQL by default) or `--style`. Read the feature spec (sections 3–5), the current schema (`docs/architecture/api/schema.graphql` / `openapi.yaml`), the threat model (permissions).
## Phase 2: Draft
GraphQL: an SDL fragment — types, `Node`, connections, inputs (`@oneOf`), mutations with `…Payload { …, errors: [UserError!]! }`, subscriptions; field authorisation directives; limits (`first` ≤ 100). Then `graphql-inspector diff` against the current schema (Bash, if installed) — highlight breaking changes.
REST: operations with `operationId`, schemas with limits, `Problem`, cursor pagination, `Idempotency-Key`; `spectral lint`.
WS/games: message types `type/v/seq`, limits, auth at handshake.
Example operations + persisted documents.
## Phase 3: Agreement
Show the table operations → permissions → errors; ask about contentious points (nullability, naming, permissions). When changing an existing contract — `frontend-lead`/`game-lead` via Task to confirm compatibility.
## Phase 4: Write
"May I write `docs/architecture/api/…` and update the api-contract document?" — one `AskUserQuestion`: write (Recommended) · show the draft/diff first ·