agentsclimarketplace

Api contracts

Skill ahtishamshahzad/agent_dev_flow/.ai/skills/backend/api-contracts

Tool-neutral AI Engineering System: 174 reusable skills (installable as Claude Code plugins) for planning and building software with AI agents. Classify → plan → approve → build under quality gates. Works with Claude Code, Codex, Cursor, Windsurf, Copilot & Antigravity. Canonical in .ai/.

Install
npx -y skills add ahtishamshahzad/agent_dev_flow --skill api-contracts

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 20 days oldThe repository was created 20 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use to define and maintain the API contract between backend and clients — OpenAPI/GraphQL schema as source of truth, shared/generated types, breaking-change policy, and contract-first workflow for new endpoints.

SKILL.md

4.0 KB, as published. Nobody here has run it

API Contracts

Purpose

Make the API contract explicit and enforceable: one source of truth (OpenAPI spec or GraphQL schema), types shared or generated from it, and a policy for what may change without breaking clients.

When to Use

  • When backend and any client (web/mobile/third party) must agree on shapes.
  • When adding/changing endpoints — contract first, then implementation.
  • Not for internal service-to-service shapes with a single owner (still useful, lower ceremony).

Inputs

  • Endpoint/schema design (rest-api-design / graphql-api-design).
  • Client list and how they consume types (codegen, shared package, manual).

Discovery Questions

  • Where does the contract live, and what generates from it (types, clients, docs)?
  • Which clients are deployed independently and can lag the backend?
  • Is the contract written first, or inferred from code — and is that enforced?

Responsibilities

  • Establish the source of truth: OpenAPI document or GraphQL SDL, versioned in the repo.
  • Plan type flow: generate client types/servers stubs from the contract, or generate the contract from typed server code — one direction, enforced in CI.
  • Define the breaking-change policy: additive (new optional fields, new endpoints) is safe; removing/renaming/retyping/making-required breaks — requires a version bump or deprecation window.
  • Keep validation schemas (backend-validation) and the contract from drifting — ideally derived from the same definitions.
  • Document error shapes and auth requirements in the contract, not just prose.

Required Workflow

  1. Choose contract format + storage location.
  2. Choose the generation direction and wire it into CI (drift fails the build).
  3. Record the breaking-change policy and deprecation process.
  4. For each new/changed endpoint: update contract → review → implement → verify against contract.

Decision Rules

  • One source of truth; hand-maintained parallel type definitions are drift waiting to happen.
  • Mobile clients lag: deprecation windows must cover store-release cycles (../../mobile/ pack, if present).
  • Contract review is part of code review for any endpoint change (../../code-review).

Rules

  • No endpoint ships that isn't in the contract.
  • Breaking changes require explicit approval and a migration note for clients.
  • Generated artifacts are never hand-edited.

Anti-Patterns

  • Types copy-pasted between backend and frontend repos.
  • Contract updated after implementation "when there's time."
  • Silent breaking changes ("just renamed a field").
  • OpenAPI docs that describe an older API than the deployed one.

Validation Checklist

  • Source of truth chosen and versioned.
  • Generation direction wired; drift detected in CI.
  • Breaking-change policy recorded.
  • Error shapes + auth requirements in the contract.
  • Deprecation window covers slowest client.

Definition of Done

A versioned contract source of truth with enforced type flow, a recorded breaking-change policy, and a contract-first workflow for endpoint changes.

Related Skills

rest-api-design, graphql-api-design, backend-validation, backend-error-handling, ../../code-review, ../../documentation.

Related Knowledge

../../../knowledge/ (client release cadences, integration owners).

Related References

../../../references/backend/api/ (contract conventions, when populated).

Context Loading Guidance

  • Requires: endpoint design, client list.
  • Does not require: handler implementations, database schema.
  • May load: backend-validation (schema sharing).
  • Stop when: contract source, type flow, and change policy are recorded.

Token Efficiency Guidance

Reference the contract file instead of pasting it; review diffs of the contract, not the whole document.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.