后端与数据库

api-design

margelo/react-n…e-skills

Design and review predictable public APIs for TypeScript, JavaScript, React, and React Native libraries. Use when shaping exported functions, classes, hooks, options objects, event and listener APIs, error behavior, naming, cross-platform abstractions, or JS-only packages. Pair with build-nitro-modules when the library is backed by Nitro.

  • 745 次安装
  • 178 星标
  • 收录于

安装命令

npx skills add https://github.com/margelo/react-native-skills --skill api-design

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

  1. Sketch the user-facing TypeScript API before implementing internals.
  2. Write 2-3 realistic call-site examples, including error and cleanup paths.
  3. Check the surface against the rules below.
  4. Verify the exported TypeScript with the repo's typecheck/lint/docs tooling before treating the API as done.
  5. 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.