api-documentation
Skill1 starsChanged 2 months agoMITView on GitHub
Document an API so an independent consumer can integrate against it without reading the server code - complete endpoint reference, real request/response examples, an error catalogue, auth, rate limits, pagination, versioning and deprecation. Use when writing or reviewing API docs, an OpenAPI spec, a "how do I call this" question, or when a consumer keeps getting 422s they did not expect.
- Reads credentials
- Sends data out
21 other projects use a version of this.
Adopted by
Most recently taken up by
- gromov0737/skillstheir own version, first seen Nov 29, 2026
- autohandai/community-skillstheir own version, first seen Nov 29, 2026
- camilooscargbaptista/cto-toolkittheir own version, first seen Nov 29, 2026
- AndersonAndrad/skillstheir own version, first seen Nov 8, 2026
- AxlZero21/Skillstheir own version, first seen Nov 8, 2026
- drvoss/everything-copilot-clitheir own version, first seen Oct 26, 2026
Used with
Projects with it also use data-engineering, feature-flags and 6 more.
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.
travisjneumanSkilldata-engineering
ETL/ELT pipelines, data warehousing (BigQuery, Snowflake, Redshift), stream processing (Kafka, Spark Streaming), orchestration (Airflow, Dagster, Prefect), dbt transformations, and data lake architecture. Use when building data pipelines, designing warehouse schemas, or implementing real-time data processing.
Also in 4 projects that use this
SentrySkillfeature-flags
Gate a Sentry feature behind a FlagPole feature flag. Use when adding a feature flag, registering a flag in temporary.py, checking a flag from Python or the frontend, enabling a flag in tests, or asking where FlagPole rollout config lives. Trigger on "add a feature flag", "gate this behind a flag", "register a flag", "features.has", "api_expose", "OrganizationFeature", "ProjectFeature", "FlagPole".
Also in 3 projects that use this
AnthropicSkillincident-response
Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.
Also in 3 projects that use this
xenitV1Skillclean-code
Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments
Also in 3 projects that use this
SentrySkillsecurity-review
Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.
Also in 4 projects that use this
CloudflareSkillsecurity-audit
Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.
Also in 4 projects that use this
Other versions21 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 21
- irahardianto/awesome-agv★ 157same name
- drvoss/everything-copilot-cli★ 49same name
- 5throck/ai-workspace-standards★ 27same name
- autohandai/community-skills★ 14same name
- camilooscargbaptista/cto-toolkit★ 9same name
- YepAPI/skills★ 8same name
- Ghosteken/agent-harness★ 2same name
- gromov0737/skills★ 2same name
- onejaejae/skills★ 2same name
- ronrefael/sonde★ 2same name
11 more not listed
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 repository126 other files it gives its agents.
- eu-data-backend-job-hunterSkill
- job-application-matcherSkill
- llm-agents-and-tool-useSkill
- llm-application-architectureSkill
- llm-cost-and-latency-optimizationSkill
- llm-evaluationSkill
- llm-fine-tuning-and-adaptersSkill
- llm-privacy-and-safetySkill
- llm-prompt-engineeringSkill
- llm-rag-systemsSkill
- structured-output-and-jsonSkill
- graphql-api-designSkill
- pagination-and-filteringSkill
- rest-api-designSkill
- webhooks-and-integrationsSkill
- caching-architecture-multi-layerSkill
- resilience-patternsSkill
- service-boundaries-and-monolithsSkill
- system-design-interviewSkill
- go-concurrencySkill
- go-error-handlingSkill
- java-spring-patternsSkill
- nodejs-server-performanceSkill
- python-async-patternsSkill
- python-data-modelingSkill
- python-packaging-and-toolingSkill
- python-performanceSkill
- rest-api-implementationSkill
- rust-error-handlingSkill
- rust-ownership-patternsSkill
- typescript-type-safetySkill
- ci-caching-and-speedupSkill
- ci-pipeline-designSkill
- deployment-strategiesSkill
- github-actions-hardeningSkill
- release-versioning-and-changelogsSkill
- reproducible-buildsSkill
- aws-iam-and-securitySkill
- aws-serverless-architectureSkill
- azure-fundamentalsSkill
- cloud-cost-optimizationSkill
- cloud-networking-and-vpcSkill
- gcp-cloud-architectureSkill
- code-review-skillsSkill
- design-review-and-refactoring-architectureSkill
- refactoring-techniqueSkill
- understanding-unknown-codebaseSkill
- buildkit-and-cacheSkill
- container-image-debuggingSkill
- container-runtime-securitySkill
- docker-compose-workflowsSkill
- dockerfile-authoringSkill
- docker-image-optimizationSkill
- database-connection-managementSkill
- database-transactionsSkill
- distributed-databasesSkill
- nosql-data-modelingSkill
- postgres-query-tuningSkill
- redis-and-cachingSkill
- schema-migrationsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 17 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 116
Every error response has the same shape:
- Very specific: line 148
messagemust not leak internals: No stack traces, no SQL, no hostnames, no "an unexpected error occurred" with a 500. - Distinctive: line 171
Never: document "contact us for an API key" without saying what the key can do and a test mode.
- Distinctive: line 176
Document the numbers, the window, the scope, and the *response* to exceeding them.
- Distinctive: line 196
Use cursor pagination for anything that can change while a consumer pages through it.
- Distinctive: line 220
Document the compatibility contract explicitly:
- Distinctive: line 305
Document whether a total is available, what the max page size is, and what happens on the last page.
“Common” is measured: kept by at least 6 in 10 of the 17 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 Documentation
Success is measurable and binary: a competent developer who has never seen the service can integrate against it, unassisted, without reading server code or asking a question in a channel. Everything here serves that.
The most common failure is documentation that is descriptive (a list of fields) rather than operational (here is a call that works, here is what happens when it does not).
What a consumer needs, in the order they need it
- Can I call this at all? Base URL, auth (how to get a credential, what scope, where to send it), content types, and the smallest complete example.
- What does each endpoint do? One line per endpoint, method, path, purpose.
- How do I do my task? Per-endpoint: every parameter, a real request, a real success response, every error response, and the idempotency/retry contract.
- What will bite me? Rate limits, pagination, versioning, webhooks, known limitations.
The endpoint reference
One section per endpoint, in this order. Consistent shape is what makes a reference scannable.
POST /v1/orders — Create an order
Creates an order in pending_payment state. Idempotent when an Idempotency-Key
header is supplied (see Idempotency).
Path parameters: none. Query parameters: none.
Request body (application/json):
| Field | Type | Required | Constraints | Description |
customer_id | string | yes | ^cus_[A-Za-z0-9]{16}$ | Customer placing the order. |
items | array | yes | 1–200 entries | Line items; see below. |
items[].sku | string | yes | max 64 chars | Product SKU. Must be active. |
items[].quantity | integer | yes | 1–999 | Units of this SKU. |
items[].unit_price_minor | integer | no | ≥ 0 | Overrides the catalogue price. Requires items[].price_override=true on the customer. |
currency | string | yes | ISO 4217, lowercase | usd, eur, gbp. Must match the customer's settlement currency. |
metadata | object | no | ≤ 20 keys, ≤ 4 KB total | Echoed back on the order. Not returned on list endpoints. |
Example request:
curl -X POST https://api.example.com/v1/orders \
-H "Authorization: Bearer $API_KEY" \
-H "Idempotency-Key: 7c9e6679-7425-40de-944b-e07fc1f90ae7" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "cus_a1b2c3d4e5f60718",
"currency": "usd",
"items": [
{"sku": "TSHIRT-M-BLK", "quantity": 2},
{"sku": "CAP-OSY", "quantity": 1, "unit_price_minor": 1500}
],
"metadata": {"cart_id": "cart_9931"}
}'Response 201 Created:
{
"id": "ord_01HZX4K2M9",
"status": "pending_payment",
"customer_id": "cus_a1b2c3d4e5f60718",
"currency": "usd",
"subtotal_minor": 4500,
"tax_minor": 383,
"total_minor": 4883,
"items": [
{"sku": "TSHIRT-M-BLK", "quantity": 2, "unit_price_minor": 1500, "line_total_minor": 3000},
{"sku": "CAP-OSY", "quantity": 1, "unit_price_minor": 1500, "line_total_minor": 1500}
],
"created_at": "2026-03-04T14:02:11Z",
"links": {"self": "https://api.example.com/v1/orders/ord_01HZX4K2M9",
"payment_intent": "https://api.example.com/v1/payment_intents/pi_3Qa"}
}Response headers on 201: Location (order URL), X-RateLimit-Limit,
X-RateLimit-Remaining, X-RateLimit-Reset, Idempotency-Replayed: true|false.
Errors: see the error catalogue. This endpoint can
return 400, 401, 403, 404 (unknown customer_id), 409, 422,
429, 500, 503.
Notes and constraints:
- Prices are in minor units (cents).
1500is $15.00. Never a float. - An empty
itemsarray returns422, not400(it is structurally valid but semantically empty). - The order is created in
pending_paymentand holds inventory for 15 minutes. Payment is a separate call.
Real examples beat prose. The example above is copy-pasteable; the note about minor units is the kind of thing a schema cannot say.
The error catalogue
One page for the whole API. Consumers will read only this section.
Every error response has the same shape:
{
"error": {
"type": "invalid_request",
"code": "item_sku_not_found",
"message": "SKU 'CAP-OSY' does not exist or is inactive.",
"param": "items[1].sku",
"request_id": "req_01HZX4K2M9PQ",
"docs_url": "https://docs.example.com/errors/item_sku_not_found",
"retryable": false
}
}| Field | Meaning |
type | Broad category: invalid_request, authentication, permission, not_found, conflict, rate_limit, server. Stable. |
code | Specific, machine-readable, stable identifier. Switch on this, never on message. |
message | Human-readable, for developers. Not stable; may change. Never parse it. |
param | The offending field, in a path notation (items[1].sku). Absent when not field-specific. |
request_id | Quote this in support. Also the log correlation id. |
retryable | Whether an identical retry could succeed. |
Code standards:
type→ status mapping is fixed:invalid_request→400,authentication→401,permission→403,not_found→404,conflict→409,unprocessable→422,rate_limit→429,server→500/503.- Never a bare
{"error": "Bad request"}. It forces the consumer to match on a string. messagemust not leak internals. No stack traces, no SQL, no hostnames, no "an unexpected error occurred" with a 500. A 500 sayscode: "internal_error"and nothing else.- Add codes, never change them. A removed or repurposed
codeis a breaking change, because consumers switch on it.
Authentication and authorization
- How to get a credential, with a real command:
curl -X POST https://api.example.com/v1/tokens \ -H "Authorization: Bearer $API_KEY" \ -d '{"scope": "orders:write", "ttl": "3600s"}' # -> {"access_token": "tok_...","expires_at":"2026-03-04T15:02:11Z"} - Where it goes, and what happens if it is wrong: missing →
401withcode: "missing_authorization_header"; malformed →401invalid_token; expired →401token_expiredwithWWW-Authenticate: Bearer error="invalid_token". - Scopes, as a table: which scope each endpoint needs, and what a
missing-scope
403says.403means authenticated but not allowed; the message must distinguish it from401so the consumer knows whether to get a new token or ask for more access. - Never document "contact us for an API key" without saying what the key can do and a test mode.
Rate limits
Document the numbers, the window, the scope, and the response to exceeding them. Vagueness here is the single most common integration complaint.
- Limit and window:
1000 requests per minuteper API key, per endpoint group. Say which. - Headers on every response:
X-RateLimit-Limit,-Remaining(requests left in the current window),-Reset(unix seconds when the window resets). - On
429:Retry-Afterin seconds;code: "rate_limit_exceeded";retryable: true. HonourRetry-After; do not retry sooner. - Bursts: a short burst allowance (e.g. an extra 100) is fine — say so, or
integrators will over-buffer and get a
429for the wrong reason. - Concurrent-request cap, if you have one, and the
429for it. This one catches people out badly because their load tests pass and production doesn't. - Behaviour under limit: is it a hard reject or a queue? A queued request
that returns
201eight seconds later is a different integration problem from a429.
Pagination
Use cursor pagination for anything that can change while a consumer pages through it. Offset pagination on a mutable collection silently skips and repeats rows.
- Default and maximum page size; what happens if the consumer asks for
more (clamp, or
400? say which). - The response envelope:
{"data": [ ... ], "has_more": true, "next_cursor": "eyJpZCI6Im9yZF8wMUhZWDRLMk09"} next_cursoris opaque; never document its format or let consumers construct one. Cursors are often base64 — say "opaque" and mean it, or they will start parsing them and break when you change the encoding.- Stability: cursors are valid for 24 h; after that,
400cursor_expired— restart from the beginning. - What order the results are in, explicitly, and that it is the only
guarantee. "Insertion order" is a promise; "by
created_at desc, id desc" is a promise. "Best effort" is a bug waiting to happen.
Versioning and deprecation
Default: URI major version (/v1/...), additive minor changes within a
major. It is visible, routable, and trivially testable.
Document the compatibility contract explicitly:
| Change | Breaking? | Policy |
| New endpoint, new optional field in a response | No | Shipped immediately; announced in the changelog |
| New enum value in a response | Yes, for strict clients | Announce ≥ 90 days ahead, or send the new value only behind a capability flag |
| New required request field | Yes | New endpoint version or a new endpoint; never silently |
| Removing/renaming a field, changing a type, tightening validation | Yes | New major version |
Changing an error code or its meaning | Yes | Never; add instead |
| Tightening rate limits | Yes, effectively | Never within a major version |
Deprecation is a process, documented in advance. State, in the docs:
- Deprecation header on every response from a deprecated endpoint:
Deprecation: true,Sunset: Tue, 04 Nov 2026 00:00:00 GMT, andLink: <https://docs.example.com/migrations/v1-to-v2>; rel="deprecation". - A migration guide per deprecated version, with before/after code.
- A minimum notice period (90 days is a reasonable house default) and email + dashboard metric on usage, so you deprecate what nobody uses and can find the consumers who matter.
- Runtime warning for the partner, not just a doc page: log or return a
Warningheader naming the replacement. The consumers who will break are the ones who will not read your changelog.
Webhooks, if you have them
- Event catalogue with a stable
typestring and a versioned payload schema (order.paid.v1). - Retry policy: how many attempts, over what period, with what backoff, and
what the endpoint must do to acknowledge (return
2xxwithin N seconds; anything else is a retry). - Signature verification — a real snippet, not "verify the signature":
And it must be over the raw body, before JSON parsing.# HMAC-SHA256 over the raw body, header Stripe-Signature: t=...,v1=... expected = hmac.new(secret.encode(), f"{t}.{raw_body}".encode(), hashlib.sha256).hexdigest() ok = hmac.compare_digest(expected, v1) - Ordering and duplicates are not guaranteed. Say so, and say the consumer
must be idempotent on
event.id. - Ordering of delivery versus the API's own eventual consistency — a
consumer that gets
order.paidthen GETs the order and seespending_paymentis a real bug; document the propagation delay.
Tooling: OpenAPI as support, not the point
OpenAPI 3.1 (openapi.yaml) is the source of truth and is validated in CI.
It is the substrate — but nobody integrates from a rendered schema page; they
integrate from prose, examples, and the error catalogue. A spec with no
examples and no error definitions is a spec nobody can use.
Rules:
openapi.yamlin the repo, linted in CI (spectral lintorredocly lint), withoperationIds stable (consumers generate clients from them — changing anoperationIdbreaks every generated SDK, so it is a breaking change even in a "no-breaking-changes" release).- Every schema has
example; every operation hasrequestand responseexampleswith values copied from a real test run, not invented. descriptionfields written for a human (theparamsemantics, the "why"), not just the type.- Generate the SDK/docs from the spec, but keep the hand-written guides (quickstart, error catalogue, migration guides) in version-controlled markdown. Generated error tables are poor; hand-written ones are excellent.
- Contract-test the spec against the running service (e.g. Schemathesis
or
dredd), so a documented-but-unimplemented status code fails CI rather than a consumer's week.
Gotchas
- The documented error list is always optimistic. Docs are written when the happy path is built; the 500s and edge cases get added later and never documented. Reject an endpoint whose errors can't be enumerated.
- Status code 200 for everything is common and destroys a consumer's ability
to handle failure.
400for a bad body,401unauthenticated,403authenticated-but-not-allowed,404missing,409conflict,422valid shape but invalid state,429throttled. Pick once and document it. 401vs403is ambiguous in most APIs and never documented. Say which one you return for an expired token versus a valid token lacking the scope. Consumers branch on this.- Timestamps without a timezone are a data-corruption bug waiting to
happen. Say UTC, always, in ISO 8601 (
2026-01-31T09:00:00Z). - Money as a float breaks silently at scale. Document minor units (cents), and whether the currency is fixed per endpoint or in a field.
- Pagination with
offsetand no total count forces consumers to guess. Document whether a total is available, what the max page size is, and what happens on the last page. - Rate limits documented as "fair use" are unenforceable. Give numbers, the
window, the scope (per key? per IP? per endpoint?), the headers you send, and
exactly what to do on
429— including whetherRetry-Afteris present. - Examples that were never run are the single biggest source of wasted consumer time. Generate examples from recorded responses, or contract-test them. A pasted curl block that 404s is worse than no example.
- A field's units or format is assumed, not stated. "duration: 300" — seconds or milliseconds? "size": bytes or KB? State it in the field description; a wrong guess can corrupt a client's data, not just display.
- Deprecation announced in prose only is invisible to tooling. Add the
DeprecationandSunsetheaders, give a date, and link a migration guide. "Will be removed soon" is not a deprecation policy. - Generated reference docs are complete and useless. They document every parameter nobody needs and explain none of the task. Keep the generated reference for completeness, and hand-write the quickstart, the error catalogue, and the migration guides.
- Documenting a webhook without the signature algorithm forces consumers to guess. Name the algorithm, show verification over the raw body (not a re-serialised object), and state whether delivery is at-least-once.
Review checklist
- Base URL, auth (how to obtain, where to send, what failure looks like), and content types in the first screen.
- A smallest-complete-example that works on a fresh machine.
- Every endpoint: purpose, auth scope, every parameter with type / required / constraints / default, a real request, a real success response with headers, and every error it can return.
- Prices/quantities/units stated (minor units, ISO codes, UTC timestamps).
- Error catalogue: consistent envelope,
type↔status mapping, stablecodes, no internal leakage,request_idin every response. - Rate limits: numbers, window, scope, headers,
429behaviour, concurrency cap. - Pagination: cursor opacity, page-size default and max, ordering guarantee, cursor expiry.
- Versioning policy table, deprecation headers, minimum notice period, and a migration guide.
- Webhooks: signature snippet over the raw body, retry schedule, at-least-once / idempotency statement.
openapi.yamllints clean, examples are from real runs, and the contract test passes.
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.

