Skills DirectoryCurated open-source Skills from GitHub

api-and-interface-designcommit 63128d0SKILL.md · Architecture

API and Interface Design

Guides stable, hard-to-misuse APIs and module interfaces: contract first, consistent errors, validation at boundaries and additive changes.

npx skills add addyosmani/agent-skills --skill api-and-interface-design
Permissions
  • read-repo
  • write-files
  • shell
  • network
Compatible with
Claude Code, Codex, Cursor, Copilot, Gemini CLI
GitHub
112.3k
Source
Community · Addy Osmani
Status
Scan passed
License
MIT
Category
Architecture

Core rule

Hyrum's Law: every observable behavior will be depended on, so be intentional about what you expose.

Execution Phases

  1. Phase 01Contract first

    Define typed input and output interfaces before implementing; the contract is the spec.

  2. Phase 02Errors and validation

    Use one error format everywhere, validate only at system boundaries, and treat third-party API responses as untrusted.

  3. Phase 03Design for extension

    Add optional fields rather than changing or removing them, follow the one-version rule and consistent naming, and paginate list endpoints.

  4. Phase 04Honour idempotency keys

    Derive keys from intent, claim them atomically with a unique constraint, reject a reused key with a different body, and retain keys past the longest retry path.

  5. Phase 05Verify with the checklist

    Confirm typed inputs and outputs on every endpoint, one error format, backward-compatible changes, and types or docs committed with the implementation.

Permissions (summarised from SKILL.md)

CapabilityNeededDetails
File writesRequiredWrites interface types, schemas, API handler code and accompanying docs.
Command executionNot requiredThe skill does not call for running commands.
Network outboundNot requiredNo network access.

SKILL.md frontmatter (YAML)

SKILL.md frontmatter (YAML)commit 63128d0
---
name: api-and-interface-design
description: Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.
---

Related skills

A rule scan cannot catch every risk. Read this skill's SKILL.md and check its permissions before installing.