api-expert
Installation
SKILL.md
API Expert Skill
This skill provides expertise in integrating backend services into React Native Expo applications. It emphasizes reliability, performance, and clean architecture.
Core Principles
- Use
expo/fetch: Always preferexpo/fetchover standardfetchoraxios. - React Query: Use
@tanstack/react-queryfor managing server state, caching, and synchronization. - Service Layer: Keep API logic in the
services/directory. - Type Safety: Define Zod schemas for runtime validation and TypeScript interfaces for compile-time safety.
Instructions
- Setup Client: Ensure the React Query client is configured in
app/_layout.tsx. - Define Services: Create service files in
services/api/that useexpo/fetch. - Custom Hooks: Wrap service calls in custom React Query hooks.
- Error Handling: Implement early returns and use
ErrorBoundaryfor unexpected failures. - Validation: Use Zod to validate API responses at the network boundary.