--- name: "API Contract Guard" description: "Verifies structural parity between frontend request objects, backend Pydantic schemas, and API response contracts." --- # Skill: API Contract Guard ## 1. Purpose Prevent integration errors and payload mismatches by auditing API contracts before deploying changes. ## 2. When to Use Trigger after changing any database columns or Pydantic fields that are exposed to the frontend. ## 3. Step-by-Step Checklist 1. Compare fields and types between the backend Pydantic schemas and database models. 2. Compare the backend endpoint responses with the frontend API fetch/axios interfaces. 3. Check for: - Missing optional parameters (nullable columns vs Optional types). - Mismatched variable naming conventions (snake_case vs camelCase conversion). - Incorrect date/time formats. 4. Verify that schema updates do not break backward compatibility for client-facing apps.