agentleFS
AL-JANEFAL-JANEF/janefskills/skills/engineering/api-contracts/SKILL.md

api-contracts

Skill1 starsChanged 54 days agoMITView on GitHub

Design and change REST, GraphQL, RPC, and webhook contracts and the backend services and jobs behind them: validation, authorization scope, error semantics, pagination, idempotency, rate limits, retries, timeouts, versioning, and contract tests. Use for any endpoint, external integration, worker, or queue consumer.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every external request and every upstream response is untrusted.

    line 14
  2. Distinctive:

    Keep transport parsing separate from domain decisions and infrastructure adapters.

    line 21
  3. Distinctive:

    Never break a contract silently: version or stage the change, then update callers, docs, and tests together.

    line 22
  4. Distinctive:

    Verify authenticity (signature, timestamp window), resist replay or make processing idempotent, bound processing time, and retry safely.

    line 27
  5. Distinctive:

    Test validation failures, unauthorized and forbidden requests, duplicate or retried deliveries, and dependency failure where relevant.

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

API Contracts & Backend Services

Every external request and every upstream response is untrusted. A contract is a promise to callers you may never see; change it deliberately or not at all.

Contract

  • Specify input validation, authentication, authorization scope (object and tenant), response shape, status and error semantics, timeouts, and observability for every endpoint.
  • Bound request bodies, pagination, retries, concurrency, and external response sizes. Explicit pagination for every unbounded collection.
  • Idempotency for retriable side effects. Rate limits and retry/backoff where abuse or downstream saturation is plausible.
  • Keep transport parsing separate from domain decisions and infrastructure adapters.
  • Never break a contract silently: version or stage the change, then update callers, docs, and tests together.
  • Error responses are useful to the caller without leaking stack traces, internal identifiers, or sensitive implementation detail.

Webhooks and external integrations

Verify authenticity (signature, timestamp window), resist replay or make processing idempotent, bound processing time, and retry safely. Set timeouts and cancellation on all outbound calls; retry only transient, idempotent operations with jitter and limits.

Reliability

  • Make transaction boundaries and side-effect ordering explicit. When atomicity ends, use an outbox or a compensating action.
  • Design jobs and queue consumers for at-least-once delivery unless the platform proves otherwise; make duplicate handling safe.
  • Preserve error cause and correlation context without exposing internals. Avoid shared mutable process state when multiple workers or restarts are possible.

Verification

  • Contract or integration tests for material changes, exercising the real serialization and persistence boundary, not only mocked domain methods.
  • Test validation failures, unauthorized and forbidden requests, duplicate or retried deliveries, and dependency failure where relevant.
  • Confirm observability can distinguish caller errors, server faults, and dependency failures.

Route to database-integrity when persistence decisions are central and to auth-hardening when the endpoint issues or validates credentials.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.