api-contracts

Generate TypeScript types and React Query hooks from FastAPI OpenAPI schemas.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/djimontyp/task-tracker --skill api-contracts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-contracts
Source: https://github.com/djimontyp/task-tracker/tree/main/.claude/skills/api-contracts
Command: npx skills add https://github.com/djimontyp/task-tracker --skill api-contracts

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates manual synchronization errors between backend API schemas and frontend TypeScript types, ensuring type safety across your full-stack application.

Core Features & Use Cases

  • Automatic Type Generation: Generate TypeScript interfaces and React Query hooks from FastAPI OpenAPI schemas.
  • Bidirectional Sync: Keep frontend types automatically updated when backend models change.
  • Use Case: When you modify Pydantic schemas in your FastAPI backend, use this Skill to automatically regenerate all TypeScript types and API hooks, preventing runtime errors.

Quick Start

Use the api-contracts skill to synchronize all API types after backend schema changes by running the command: just api-sync

Frequently Asked Questions about api-contracts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep TypeScript types synchronized with my FastAPI backend?

Synchronize TypeScript types by generating them automatically from your FastAPI OpenAPI schema. When backend Pydantic schemas change, run code generation to update frontend types instantly, eliminating manual sync errors and ensuring type safety across your full-stack application.

Can I automatically generate React Query hooks from my OpenAPI schema?

Yes. This Skill generates TypeScript interfaces and React Query hooks directly from FastAPI OpenAPI schemas. After backend changes, regenerate all hooks and types in one step to keep your frontend API layer synchronized with the backend contract.

What happens when I modify Pydantic schemas in FastAPI?

Modifications to Pydantic schemas trigger automatic TypeScript type and React Query hook regeneration from the updated OpenAPI schema. This prevents runtime errors by maintaining a single source of truth in your contracts/openapi.json file.

How do I maintain a single source of truth for API contracts?

Store your OpenAPI schema as the single source of truth in contracts/openapi.json. Use Orval configuration to generate TypeScript types and React Query hooks from this schema, eliminating duplicate type definitions between backend and frontend.

Does this work with existing TypeScript and React projects?

Yes. This Skill applies to React frontends using TypeScript and FastAPI backends with Pydantic schemas. It integrates with Orval configuration for code generation and validates artifacts to ensure frontend types always match backend OpenAPI exports.

What validation steps ensure my API types stay in sync?

The Skill runs Orval configuration validation and artifact checks after code generation. These validation steps confirm TypeScript types and React Query hooks match the backend OpenAPI schema, catching synchronization issues before they reach production.