mcpField
S
stripe-inspired-api-design-rules

stripe-inspired-api-design-rules

github.com/pproencaDevelopment218126 installsUpdated 11w ago
Repository

About stripe-inspired-api-design-rules

A reference skill with 52 rules for designing and reviewing JSON HTTP APIs, drawing on conventions associated with Stripe. It helps API designers and reviewers reason about resources, requests, errors, compatibility, and operational behavior through prioritized rules and examples.

Key features

  1. 01Provides 52 rules across eight categories
  2. 02Prioritizes resource and URL design decisions
  3. 03Covers request formats, errors, and retries
  4. 04Addresses versioning and backward compatibility
  5. 05Includes examples and rule-specific references

Use cases

  1. 01Design a new JSON HTTP API or endpoint
  2. 02Review an API proposal, OpenAPI spec, or PR
  3. 03Audit naming, error consistency, and compatibility
  4. 04Resolve integration issues caused by API shape

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill stripe-inspired-api-design-rules

After installing, type/stripe-inspired-api-design-rulesin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

AGENTS.md
gotchas.md
metadata.json
assets/templates/
_template.md
references/
_sections.md
error-doc-url-on-every-error.md
error-four-type-enum.md
error-http-status-mapping.md
error-lowercase-snake-case-codes.md
error-message-mandatory-code-optional.md
error-top-level-object.md
format-bracket-notation-nesting.md
format-cursor-pagination.md
format-dot-notation-expansion.md
format-expand-parameter.md
format-form-encoded-requests.md
format-list-envelope.md
format-no-total-counts.md
idem-24h-ttl.md
idem-fail-on-key-reuse.md
idem-key-header.md
idem-recovery-points.md
idem-scoped-per-account.md
naming-american-english.md
naming-boolean-past-tense.md
naming-enums-over-booleans.md
naming-metadata-pattern.md
naming-simple-unambiguous.md
naming-snake-case-wire-format.md
naming-type-discriminator-polymorphism.md

Details

From the project README

Stripe-Inspired API Design Best Practices

A reference distillation of the design conventions behind Stripe's API — the most widely admired and copied JSON HTTP API in the industry. Contains 52 actionable rules across 8 categories, prioritised by how irreversibly a wrong decision cascades through every endpoint, every SDK, and every client integration. Each rule explains the WHY, shows incorrect-vs-correct code, and links to the canonical source.

When to Apply

Reach for this skill when:

  • Designing a new JSON HTTP API or a new endpoint on an existing one
  • Reviewing an API design proposal, OpenAPI spec, or PR that adds/changes endpoints
  • Debugging an integration where the "wrong" shape of the API is causing client bugs
  • Auditing an API for naming consistency, error shape uniformity, or compatibility risks
  • Producing an API design report (the kind your inspector tool emits — Critical / Warning / Suggestion / Positive)
  • Picking between two designs and looking for an authoritative source to back the choice
  • Onboarding to API design — these are the canonical patterns to internalise first

The rules are general — they apply to any JSON HTTP API, not just APIs imitating Stripe. Triggers include "API design", "OpenAPI", "endpoint", "schema", "webhook", "idempotency", "pagination", "API versioning", and reviews of YAML/JSON spec files.

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Resource Modeling & IdentifiersCRITICALresource-
2URL Structure & HTTP SemanticsCRITICALurl-
3Request & Response FormatHIGHformat-
4Errors & Status CodesHIGHerror-
5Idempotency & Safe RetriesHIGHidem-
6Versioning & Backwards CompatibilityHIGHver-
7Naming, Polymorphism & MetadataMEDIUM-HIGHnaming-
8Authentication, Webhooks & SearchMEDIUM-HIGHops-

Earlier categories cascade harder: a wrong choice in resource modeling (numeric IDs, no object discriminator) propagates to every endpoint forever; a wrong choice in webhook event naming is a single category to fix.

Quick Reference

1. Resource Modeling & Identifiers (CRITICAL)
2. URL Structure & HTTP Semantics (CRITICAL)
3. Request & Response Format (HIGH)
4. Errors & Status Codes (HIGH)
5. Idempotency & Safe Retries (HIGH)
6. Versioning & Backwards Compatibility (HIGH)
7. Naming, Polymorphism & Metadata (MEDIUM-HIGH)
8. Authentication, Webhooks & Search (MEDIUM-HIGH)

How to Use

For a focused question ("should this field be a boolean or an enum?"), jump directly to the relevant rule (naming-enums-over-booleans) — each rule is self-contained with the WHY, code examples, and the canonical source.

For a full API review or audit, work through the categories top-to-bottom. The order matches Stripe's own design priority: get resource modeling and URL structure right first; format, errors, idempotency, and versioning are the next layer; naming and operational surface come last because they're the easiest to evolve.

For producing a structured findings report (the kind an inspector tool emits), cite rules by their slug — resource-unix-seconds-timestamps, format-no-total-counts — so each finding traces back to a specific, defensible source.

Read section definitions for the cascade-impact rationale behind the category ordering, or the rule template when adding a new rule.

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering by design-propagation impact
assets/templates/_template.mdTemplate for authoring new rules
metadata.jsonVersion and reference URLs
gotchas.mdFailure points discovered when applying the rules

Comments

Markdown supported