Configure this skill should be used when the user asks about "API contract", "api-contract.md", "shared interface", "TypeScript interfaces", "request response schemas", "endpoint design", or needs…

MITAuto-check passedBackend & APIs

Install API Contract

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill api-contract -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace api-contract --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/api-contract .claude/skills/api-contract && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
api-contract
GitHub stars
2.8k
Token cost
~1.4k tokens
SKILL.md length
441 words
Files
7 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Configure this skill should be used when the user asks about "API contract", "api-contract.md", "shared interface", "TypeScript interfaces", "request response schemas", "endpoint design", or needs…

  • Works in 6 steps: Create api-contract.md in the sprint… → Define TypeScript interfaces for all… → For list endpoints, include pagination… → …
  • Asks about API contract
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

API Contract is an agent skill from jeremylongshore/tons-of-skills-marketplace. Configure this skill should be used when the user asks about "API contract", "api-contract.md", "shared interface", "TypeScript interfaces", "request response schemas", "endpoint design", or needs guidance on designing contracts that coordinate backend and frontend agents. Use when building or modifying API endpoints. Trigger with phrases like 'create API', 'design endpoint', or 'API scaffold'.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `references/best-practices.md`, `references/errors.md` and `references/examples.md`). Compatibility notes: Designed for Claude Code

It sits in Backend & APIs, covering API design. It works with TypeScript. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Asks about API contract
  • Api-contract.md
  • Shared interface
  • TypeScript interfaces

Example prompts

  • “API contract”
  • “api-contract.md”
  • “shared interface”
  • “/api-contract”

Requirements

  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Create api-contract.md in the sprint directory (.claude/sprint/[N]/api-contract.md). Define each endpoint using the standard format: HTTP…
  2. Define TypeScript interfaces for all request and response types. Use explicit types instead of any, mark optional fields with ?, and use…
  3. For list endpoints, include pagination parameters and the PaginatedResponse wrapper. Standardize on page, limit, sort, and order query…
  4. Document all response states: success (200, 201, 204), client errors (400, 401, 403, 404, 422), and empty states. Use a consistent error…
  5. Follow best practices from ${CLAUDE_SKILL_DIR}/references/best-practices.md: be specific about field constraints (e.g., "string, required…
  6. Share the contract file path in SPAWN REQUEST blocks so both backend and frontend agents read the same interface definition.

What it can do on your machine

Read from SKILL.md and the folder at commit 80f86df. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown and typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

API Contract loads about 1.4k tokens when it runs, and up to ~5.4k if it reads all its reference files. Until then it costs about 103 tokens; SKILL.md has 441 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~103
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit 80f86df, republished under its MIT licence (© jeremylongshore). 441 words, ~1,439 tokens.

Download SKILL.mdSave it as .claude/skills/api-contract/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
api-contract
description
Configure this skill should be used when the user asks about "API contract", "api-contract.md", "shared interface", "TypeScript interfaces", "request response schemas", "endpoint design", or needs guidance on designing contracts that coordinate backend and frontend agents. Use when building or modifying API endpoints. Trigger with phrases like 'create API', 'design endpoint', or 'API scaffold'.
allowed-tools
Read
compatibility
Designed for Claude Code
version
1.20.0
author
Damien Laine <damien.laine@gmail.com>
license
MIT
tags
community, api, typescript

API Contract

Overview

API Contract guides the creation of api-contract.md files that serve as the shared interface between backend and frontend agents during sprint execution. The contract defines request/response schemas, endpoint routes, TypeScript interfaces, and error formats so that implementation agents build to an agreed specification without direct coordination.

Prerequisites

  • Sprint directory initialized at .claude/sprint/[N]/
  • specs.md with defined feature scope and endpoint requirements
  • Familiarity with RESTful API conventions (HTTP methods, status codes, JSON schemas)
  • TypeScript knowledge for interface definitions (recommended)

Instructions

  1. Create api-contract.md in the sprint directory (.claude/sprint/[N]/api-contract.md). Define each endpoint using the standard format: HTTP method, route path, description, request body, response body with status code, and error codes. See ${CLAUDE_SKILL_DIR}/references/writing-endpoints.md for the full template.
  2. Define TypeScript interfaces for all request and response types. Use explicit types instead of any, mark optional fields with ?, and use string | null for nullable values. Reference ${CLAUDE_SKILL_DIR}/references/typescript-interfaces.md for canonical type patterns.
  3. For list endpoints, include pagination parameters and the PaginatedResponse<T> wrapper. Standardize on page, limit, sort, and order query parameters as documented in ${CLAUDE_SKILL_DIR}/references/pagination.md.
  4. Document all response states: success (200, 201, 204), client errors (400, 401, 403, 404, 422), and empty states. Use a consistent error response format with code, message, and optional details fields.
  5. Follow best practices from ${CLAUDE_SKILL_DIR}/references/best-practices.md: be specific about field constraints (e.g., "string, required, valid email format"), include request/response examples, reference shared types instead of duplicating, and omit implementation details (no database columns, framework names, or file paths).
  6. Share the contract file path in SPAWN REQUEST blocks so both backend and frontend agents read the same interface definition.
Show full SKILL.md (176 more words)Show less

Output

  • api-contract.md containing all endpoint definitions with typed request/response schemas
  • TypeScript interface declarations for User, CreateUserRequest, LoginRequest, AuthResponse, ApiError, and domain-specific types
  • Paginated response wrappers for list endpoints
  • Standardized error format across all endpoints

Error Handling

ErrorCauseSolution
Backend and frontend schemas divergeContract updated without notifying both agentsAlways reference a single api-contract.md; never duplicate endpoint definitions
Missing error response codesContract only documents the happy pathDocument all status codes: 400, 401, 403, 404, 409, 422 per endpoint
Ambiguous field typesUsing string without constraintsSpecify format, length, and validation rules (e.g., "string, required, min 8 chars")
Pagination inconsistencyList endpoints use different parameter namesStandardize on the PaginatedResponse<T> interface for all list endpoints
Type mismatch between JSON and TypeScriptDates serialized inconsistentlyUse ISO 8601 datetime strings; document as "createdAt": "ISO 8601 datetime"

Examples

Authentication endpoint contract:

markdown
#### POST /auth/register

Create a new user account.

**Request:**
{
  "email": "string (required, valid email)",
  "password": "string (required, min 8 chars)",
  "name": "string (optional)"
}

**Response (201):**  # HTTP 201 Created
{
  "id": "uuid",
  "email": "string",
  "name": "string | null",
  "createdAt": "ISO 8601 datetime"  # 8601 = configured value
}

**Errors:**
- 400: Invalid request body  # HTTP 400 Bad Request
- 409: Email already exists  # HTTP 409 Conflict
- 422: Validation failed  # HTTP 422 Unprocessable Entity

Paginated list endpoint:

markdown
#### GET /products

List products with pagination.

**Query Parameters:**
| Param | Type | Default | Description |
|-------|------|---------|-------------|
| page | integer | 1 | Page number |
| limit | integer | 20 | Items per page (max 100) |
| sort | string | createdAt | Sort field |
| order | string | desc | Sort order (asc/desc) |

**Response (200):**  # HTTP 200 OK
{
  "data": [Product],
  "pagination": { "page": 1, "limit": 20, "total": 150, "totalPages": 8 }
}

Shared TypeScript interface:

typescript
interface ApiError {
  code: string;
  message: string;
  details?: Record<string, string[]>;
}

Resources

  • ${CLAUDE_SKILL_DIR}/references/writing-endpoints.md -- Endpoint definition template and key elements
  • ${CLAUDE_SKILL_DIR}/references/typescript-interfaces.md -- Canonical type definitions and guidelines
  • ${CLAUDE_SKILL_DIR}/references/pagination.md -- Pagination parameters and PaginatedResponse interface
  • ${CLAUDE_SKILL_DIR}/references/best-practices.md -- Contract authoring rules (specificity, DRY, no implementation details)

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (references) in skills/.curated/api-contract of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/best-practices.md
  • references/errors.md
  • references/examples.md
  • references/pagination.md
  • references/typescript-interfaces.md
  • references/writing-endpoints.md

Open the folder on GitHubat commit 80f86df

Compare with similar skills

API Contract next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

API Contract compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
API Contract this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.4kAutomated safety check: PassMIT
API ContractChenyCHENYU/Robot_Admin1k—~1.9kAutomated safety check: PassMIT
Server TRPC Router Guidelobehub/lobehub83k—~904Automated safety check: PassCustom licence
defineRoute Route Builderbighadj22/codflow350—~924Automated safety check: PassApache-2.0
API Designcitypaul/.dotfiles740—~6.1kAutomated safety check: PassMIT
CLI Designcitypaul/.dotfiles740—~6.6kAutomated safety check: NotesCC-BY-SA-4.0

Similar skills

  • API Contract

    ChenyCHENYU/Robot_Admin

    A skill your agent uses when: generating TypeScript API layer (type definitions + request functions) from page-spec JSON or Swagger/OpenAPI docs.

    1k GitHub stars~1.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • Conventions for LobeHub's server tRPC routers: file locations, middleware that injects models into ctx, procedure patterns, aggregated detail endpoints and return shapes.

    83k GitHub stars~904 tokensUpdated today
    Backend & APIsAuto-check passed
  • defineRoute Route Builder

    bighadj22/codflow

    Creates new API endpoints, and converts older ones, with the defineRoute() pattern used in cod-server, including auth strategies, scopes and OpenAPI output.

    350 GitHub stars~924 tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • API Design

    citypaul/.dotfiles

    Stable consumer-facing API and interface design patterns. An agent skill from citypaul/.dotfiles.

    740 GitHub stars~6.1k tokensUpdated today
    Backend & APIsAuto-check passed
  • CLI Design

    citypaul/.dotfiles

    Unix-composable CLI design patterns. An agent skill from citypaul/.dotfiles.

    740 GitHub stars~6.6k tokensUpdated today
    Backend & APIsAuto-check: notes
  • Migrate a TypeScript codebase to MoonBit on the js target while keeping the same JavaScript API contract, using mizchi/js (JS/Web/Node bindings), mizchi/x (cross-target async backend…

    359 GitHub stars~4.2k tokensUpdated 7 days ago
    Backend & APIsAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about API Contract

What does API Contract do?

Configure this skill should be used when the user asks about "API contract", "api-contract.md", "shared interface", "TypeScript interfaces", "request response schemas", "endpoint design", or needs…. API Contract is an agent skill from jeremylongshore/tons-of-skills-marketplace.md", "shared interface", "TypeScript interfaces", "request response schemas", "endpoint design", or needs guidance on designing contracts that coordinate backend and frontend agents.

When should I use API Contract?

API Contract fits situations like: asks about API contract; api-contract.md; shared interface; typeScript interfaces.

How do I install API Contract in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill api-contract -a claude-code`. Or copy the skill folder (skills/.curated/api-contract in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/api-contract in your project. Claude Code loads it when a task matches its description.

How do I install API Contract in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill api-contract -a codex`. Or copy the skill folder (skills/.curated/api-contract in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/api-contract in your project. Codex loads it when a task matches its description.

Can I use API Contract in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill api-contract -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/api-contract, .gemini/skills/api-contract, .github/skills/api-contract and .opencode/skills/api-contract in your project.

What does API Contract need to run?

SKILL.md names no scripts, command-line tools or credentials: API Contract is instructions for the agent only. Its frontmatter pre-approves these tools: Read. Compatibility (from SKILL.md): Designed for Claude Code.

Does API Contract access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is API Contract safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does API Contract use?

API Contract is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does API Contract use?

About 1.4k tokens (SKILL.md is roughly 5.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4k tokens, read only when the agent opens those files.

What are the alternatives to API Contract?

Skills that share tags, products or a category with API Contract: API Contract (ChenyCHENYU/Robot_Admin, 1k stars), Server TRPC Router Guide (lobehub/lobehub, 83k stars), defineRoute Route Builder (bighadj22/codflow, 350 stars) and API Design (citypaul/.dotfiles, 740 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains API Contract?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,825 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 9, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.