api-contract
Skill0 starsChanged 7 months agoMITView on GitHub
Distill an OpenAPI 3.x spec (JSON or YAML) into a compact CONTRACT.md with endpoints, methods, brief descriptions, schema references, and auth scheme summary. Read once instead of paging through a multi-MB spec file. Use when you need to understand or work against an API whose spec is too large for direct reading.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- gonimar/claude-web-studiotheir own version, first seen Sep 27, 2026
- ryktara/Foundrytheir own version, first seen Sep 25, 2026
- 1398281322-a11y/java-backend-guardrailstheir own version, first seen Aug 31, 2026
- PatriotAgenticLLC/better_claude_skillztheir own version, first seen Jul 1, 2026
- vndee/engineering-skillstheir own version, first seen Mar 22, 2026
- damienlaine/agentic-sprinttheir own version, first seen Dec 23, 2025
Used with
Projects with it also use data-model.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Modular-Earth-LLCSkilldata-model
Design data models including entity-relationship schemas, vector database schemas, knowledge graphs, ontologies, and data governance policies. Use after architecture defines the data layer.
Also in 3 projects that use this
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- damienlaine/agentic-sprint★ 18same name
- gonimar/claude-web-studio★ 5same name
- PatriotAgenticLLC/better_claude_skillz★ 3same name
- vndee/engineering-skills★ 3same name
- 1398281322-a11y/java-backend-guardrails★ 2same name
- ryktara/Foundry★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- answer-cacheSkill
- codemapSkill
- diff-summarySkill
- file-summarySkill
- git-digestSkill
- log-extractSkill
- run-quietSkill
- session-handoffSkill
- test-failures-onlySkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Do NOT invoke when:
- Distinctive: line 41
If under ~1500 lines: use the Read tool to read the whole file.
- Very specific: line 88
If type: object with properties, summarize as { key1: <type>, key2: <type>, … }.
- Very specific: line 90
If type: array, summarize as <item-type>[].
- Very specific: line 92
If $ref only, summarize as → <target>.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
api-contract
A Markdown-only skill — no Python, no scripts. You (Claude) read the
OpenAPI spec with the Read tool (or extract sections via grep when the
spec is too large), parse it in-context, and write CONTRACT.md.
When to invoke
Invoke api-contract when ANY of these apply:
- The user points you at an OpenAPI / Swagger spec file (
openapi.json,swagger.yaml, …) and asks about endpoints / shapes / auth. - You're about to read a spec file > 1000 lines.
- You need to call an API documented by a spec and want to know which endpoints exist before drilling into one.
Do NOT invoke when:
- The spec is small (< 200 lines) — just read it.
- The user wants details of a specific endpoint already in context.
- The input is GraphQL SDL — only OpenAPI is supported in v1.
How to run
Step 1 — measure the spec
wc -l "<path>"- If under ~1500 lines: use the Read tool to read the whole file.
- Otherwise: use
grep+ Read with offsets to extract only the sections you need (see Step 2 below).
Step 2 — extract the sections you need
For both JSON and YAML specs, you only need four top-level sections:
| Section | YAML key | JSON key |
| Metadata | info: | "info": |
| Servers | servers: | "servers": |
| Endpoints | paths: | "paths": |
| Schemas | components.schemas: or definitions: (Swagger 2) | "components"."schemas" or "definitions" |
| Auth | components.securitySchemes: or securityDefinitions: (Swagger 2) | same |
For huge specs, locate the line ranges of these sections with:
grep -nE '^(info|servers|paths|components|definitions|securityDefinitions):' "<path>"(JSON: look for top-level keys at indent 2 — grep -nE '^\s{2}"(info|servers|paths|components|definitions)"\s*:' "<path>".)
Then use the Read tool with offset and limit to read each section
individually.
Step 3 — parse and summarize
Endpoints
For each path in paths:
- For each HTTP method (
get,post,put,patch,delete,head,options):- Extract
summary(first line) ordescription(first sentence) as the one-line description. - Extract
tags(first tag is used for grouping). - Extract request body schema name if present (
requestBody.content.*.schema.$ref→ last segment after/). - Extract
parametersof typequery(list the names, comma-separated). - Extract success response status + schema name if present
(
responses.2xx.content.*.schema.$ref→ last segment).
- Extract
Group endpoints by tag (or (untagged)).
Schemas
For each entry in components.schemas (or definitions):
- If
type: objectwithproperties, summarize as{ key1: <type>, key2: <type>, … }. Mark required keys with(required). - If
type: array, summarize as<item-type>[]. - If
enum, summarize asenum (<comma-list>). - If
$refonly, summarize as→ <target>. - Cap at the first ~5 keys; append
…if more.
Auth
For each entry in securitySchemes:
- Print
<name>+<type>+ key transport (header / query / cookie) + scheme/format if relevant.
Step 4 — render CONTRACT.md
# API contract — <title> (v<version>)
Servers: <comma-list of server URLs>
Base URL: <basePath if Swagger 2, else first server.url path>
## Auth
- <name> (<type>, header: <Authorization|X-API-Key|…>)
- …
## Endpoints (<total>)
### <tag>
- <METHOD> <path> — <one-line summary> (<body: SchemaName, query: a, b, → 200 ResponseSchema>)
- …
(Repeat per tag, alphabetized.)
## Schemas (<total>)
- <Name> <inlined shape>
- …By default, write to <repo-root>/CONTRACT.md (use output=<path> to
override). If the file already exists, overwrite it.
Supported arguments
| Argument | Default | Purpose |
path (first positional) | required | Path to an OpenAPI 3.x JSON or YAML spec. |
output=<path> | CONTRACT.md at repo root | Where to write the distilled contract. |
tag=<name> | none | Filter endpoints whose tag contains <name> (case-insensitive). |
maxschemas=N | 40 | Cap on schemas in the Schemas section. |
noschemas=true | off | Skip the Schemas section entirely. |
Notes
- v1 supports OpenAPI 3.x and Swagger 2.0 (the section keys differ, but the shapes are similar enough). GraphQL SDL is out of scope.
- For YAML specs, you read them with the Read tool the same as JSON — no parser library is needed because YAML keys are line-oriented and shallow enough for visual parsing.
- Schemas with deep nesting are summarized to top-level shape only. Drill into the spec directly when you need full detail on one.
- The result is small and stable — commit
CONTRACT.mdto the repo so future sessions skip the distill step.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

