api-contract-sync

Synchronize API contracts and generate frontend types from backend models.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pydantic, typescript, graphql-codegen, openapi-typescript, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill automatically detects and synchronizes API contracts between your backend and frontend, preventing type mismatches and runtime errors when data structures, endpoints, or message formats change.

Core Features & Use Cases

  • Context-Driven Detection: Dynamically identifies the API contract type (Pydantic, GraphQL, OpenAPI, WebSocket) from your project context.
  • Automated Type Generation: Generates corresponding frontend types (TypeScript interfaces, Zod schemas, client SDKs) based on the detected backend contract.
  • Mismatch Validation & Resolution: Validates synchronization, identifies type drift, and suggests strategies for resolving breaking changes.
  • Use Case: You've updated a Pydantic model in your FastAPI backend. This skill automatically detects the change, generates the updated TypeScript interfaces for your React frontend, and ensures type safety across your full-stack application, saving you manual effort and preventing bugs.

Quick Start

This skill is typically invoked automatically when backend models change.

To manually trigger a sync for Pydantic models:

Invoke skill with:

contract_type: "Pydantic → TypeScript"

backend_model_files: ["backend/app/models/user.py", "backend/app/models/task.py"]

frontend_output_dir: "frontend/types/"

Frequently Asked Questions about api-contract-sync

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

FAQPage Schema
How do I keep TypeScript types synchronized with backend API models?

API contract synchronization automatically detects backend model changes—whether Pydantic, GraphQL, or OpenAPI—and generates matching TypeScript interfaces for your frontend, eliminating manual type updates and preventing runtime mismatches.

Can I sync Pydantic models to TypeScript without manual code generation?

Yes. This skill detects Pydantic model changes in your FastAPI backend, automatically generates updated TypeScript types, and validates type alignment across your full-stack application without manual intervention.

What API contract types does automatic type synchronization support?

Context-driven detection handles REST via OpenAPI, GraphQL schemas, Pydantic models, and WebSocket message formats, generating corresponding frontend types and client interfaces with rigorous type mapping and validation.

How do I resolve type mismatches when backend and frontend schemas drift?

Mismatch validation identifies type drift between backend contracts and generated frontend types, suggests resolution strategies for breaking changes, and ensures type safety across your full-stack stack after model updates.

Does API contract sync work with REST, GraphQL, and WebSocket endpoints?

Yes. The skill handles REST with OpenAPI specifications, GraphQL schema contracts, WebSocket message formats, and gRPC workflows, automatically generating and validating corresponding frontend client code and TypeScript interfaces.

What happens when I update a backend API endpoint or message format?

Changes trigger automatic detection of the contract type, generation of updated frontend types or client SDKs, and validation of synchronization status, preventing type drift and runtime errors across your application.