api-design
Installation
SKILL.md
API Design
Use this skill before implementation or when reviewing a public API surface. Target explicit types, stable semantics, and no irrelevant internals in the public contract.
If the library is a Nitro Module, use this skill for the public TypeScript and React API shape first, then use build-nitro-modules for Nitro-specific spec, native-state, and binding constraints. If the library is JS-only, React-only, or React Native JS-only, stay in this skill.
Workflow
- Sketch the user-facing TypeScript API before implementing internals.
- Write 2-3 realistic call-site examples, including error and cleanup paths.
- Check the surface against the rules below.
- Verify the exported TypeScript with the repo's typecheck/lint/docs tooling before treating the API as done.
- Implement only after the public shape is coherent and verified.
API Freshness
Before choosing public API shape, dependency APIs, platform capabilities, or implementation strategy, verify current official sources instead of relying on trained memory. Library, React, React Native, platform, and tooling APIs evolve quickly.