context-api-contracts
Frontend-backend API contracts, routes, clients, and type definitions.Handles API endpoint definitions, request/response types, route configuration, and cross-stack integration.Use when working with API endpoints, request/response types, route definitions, or frontend-backend integration,or when user mentions API design, adding endpoints, type mismatches, API contracts, REST endpoints,client integration, "404 Not Found" errors, "Type error" in API calls, or route configuration issues.
When & Why to Use This Skill
This Claude skill streamlines the management of frontend-backend API contracts, ensuring seamless integration across the full stack. It provides a centralized context for API endpoint definitions, request/response type safety, and route configurations, helping developers prevent type mismatches, resolve connectivity issues, and maintain a single source of truth for cross-stack data flow.
Use Cases
- Case 1: Designing and adding new REST API endpoints by defining backend routes and corresponding frontend service clients simultaneously to ensure consistency.
- Case 2: Debugging 'Type error' in API calls or '404 Not Found' errors by verifying the alignment between backend endpoint paths and frontend request configurations.
- Case 3: Managing cross-stack integration during database schema updates to ensure that changes in the data layer are correctly reflected in TypeScript contracts and API responses.
- Case 4: Navigating and refactoring complex API architectures, including versioned endpoints (v1/v2), authentication middleware, and specialized analytics services.
| name | context-api-contracts |
|---|---|
| description | | |
| tags | [api, contracts, integration, cross-stack] |
API Contracts
Navigate frontend-backend API integration, routes, clients, and data flow.
Overview
API contracts define frontend ↔ backend communication. Critical for cross-stack changes.
Backend API Routes
backend/api/*.py- API v1 endpointsbackend/api/v2/*.py- API v2 endpointsbackend/api/analytics_api.pybackend/api/brokerage_connections.pybackend/api/accounts.pybackend/api/securities.py
Frontend API Clients
frontend/src/services/analyticsApi.tsfrontend/src/services/researchApi.tsfrontend/src/lib/apiClient.ts- Base API client
TypeScript Contracts
supabase/types/database.types.ts- Database typesfrontend/src/types/**/*.ts- Frontend types
Backend Middleware
backend/middleware/*.py- Auth, CORS, etc.
Tests
backend/tests/integration/- API integration testsfrontend/e2e/- E2E API tests
Documentation
- Internal:
docs/backend/API_CONTRACTS.md(create if needed)
Related Areas
- See
context-clerk-integrationfor auth middleware - See
context-testing-infrastructurefor API test patterns