agentleFS
jaydubya818jaydubya818/MissionControl/skills/api-and-interface-design/SKILL.md

api-and-interface-design

Skill1 starsChanged 9 months agoMITView on GitHub

Design API contracts, compatibility, and duplicate-safe mutations.

92 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use accessibility-engineering, constraint-driven-development and 8 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.
  • steven123397Skill

    accessibility-engineering

    Audits existing interfaces for WCAG 2.2 AA conformance and remediates the violations found. Use when auditing a page or component for accessibility, running axe-core or pa11y, triaging a11y violations, or checking screen reader and contrast issues before shipping.

    Also in 4 projects that use this

  • MrCipherSmithSkill

    constraint-driven-development

    Use when a project needs a persistent, measurable quality bar — starting a project without documented standards, 'set up constraints', or when coverage/perf/a11y thresholds get re-debated per-PR. Produces CONSTRAINTS.md with enforceable numbers, ratchets, and a guard against silent weakening. NOT for throwaway prototypes or a one-off CI setup.

    Also in 22 projects that use this

  • seikaikyoSkill

    doubt-driven-development

    對非平凡決策啟動新鮮 context 對抗審查(找碴不背書),在修正還便宜的時候抓出錯誤方向。適用:高風險改動(production、資安敏感邏輯、不可逆操作)、不熟的程式碼、要宣稱「這樣是安全的 / 可行的」之前。機械性操作與一行修改不適用。

    Also in 59 projects that use this

  • HK-hubSkill

    code-simplification

    Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

    Also in 65 projects that use this

  • HK-hubSkill

    source-driven-development

    Grounds every implementation decision in official documentation. Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters.

    Also in 48 projects that use this

  • skytiger6724Skill

    brainstorm-experiments-existing

    Design experiments to test assumptions for an existing product — prototypes, A/B tests, spikes, and other low-effort validation methods. Use when validating assumptions, testing feature ideas cheaply, or planning product experiments.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 87 edited versions we read keep these.

  • 3

    Distinctive

    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:

    Keep internal details out of public responses.

    line 34
  2. Distinctive:

    Prefer compatible extensions, but test real consumers.

    line 42
  3. Distinctive:

    Document which failures are retryable, who retries, the bounded retry policy, and how callers discover an operation's status after a lost …

    line 53

“Common” is measured: kept by at least 6 in 10 of the 87 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.

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

API and interface design

Define the contract before implementing or changing a public API. Start with existing callers, schema conventions, authorization rules, and retry behavior. A module-local refactor needs only the contract that crosses its boundary.

Work from consumer behavior

  1. Identify callers and independently deployed versions. Record required behavior, including ordering, nullability, defaults, errors, and observable quirks. A type-compatible change can still break a consumer.
  2. Specify inputs, outputs, validation, resource ownership, and failure cases using the repository's schema or interface format. Separate caller input from server-owned fields. Do not accept roles, prices, ownership, or state transitions just because the request matches a type.
  3. Validate untrusted data where it enters, including provider responses and persisted data whose invariants are not guaranteed. Typed internal calls do not need repeated shape validation; business invariants still apply.
  4. Define stable machine-readable errors and appropriate transport semantics. Keep internal details out of public responses. Follow existing conventions for validation errors and access-denied versus not-found behavior.
  5. Bound list queries. Specify a maximum page size, stable ordering with a tie-breaker, cursor or offset behavior, and what concurrent writes do to pagination. Do not promise a consistent snapshot unless it exists.
  6. Specify partial-update behavior for omitted values, explicit nulls, empty collections, and concurrent edits. Use version checks or transactions where stale writes could overwrite another actor's work.
  7. Prefer compatible extensions, but test real consumers. Optional fields and new enum values can break strict decoders. Existing public versioning and migration commitments take precedence over a preference for one version.

State changes and retries

For operations with side effects, read retry and idempotency rules. Apply these when implementing payments, provisioning, webhook processing, or replayable jobs. An accepted idempotency header alone does not make retrying safe.

Document which failures are retryable, who retries, the bounded retry policy, and how callers discover an operation's status after a lost response. Payment amounts need an explicit currency and representation, such as integer minor units with currency-specific precision. Do not use floating-point arithmetic for ledger values or trust client-supplied totals.

Verify the contract

Exercise the real boundary with representative consumers. Cover malformed inputs, unauthorized and cross-tenant access, missing resources, pagination edges, concurrent updates, and duplicate delivery where applicable. Verify response bodies as well as status codes. Keep contract documentation next to the implementation and identify any consumers that could not be checked.

Return the contract changes, compatibility evidence, and unresolved decisions. Designing an API does not authorize publishing it or migrating live consumers.

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.