This skill should be used when the user asks to "sync the API contract", "handle a breaking change", "update an endpoint signature", "rename or remove an API endpoint", "fix a contract mismatch", "update the Module Feature Map", "check Scramble output", or "coordinate API changes between repos".
How this skill is triggered — by the user, by Claude, or both
Slash command
/fullstack-project-skills:api-contract-syncThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The root `CLAUDE.md` Module/Feature Map is the single source of truth for the backend↔frontend contract. This skill enforces that the map, the Scramble output (`/docs/api`), and the frontend consumption code stay in sync at all times. It handles both routine endpoint changes and breaking changes.
The root CLAUDE.md Module/Feature Map is the single source of truth for the backend↔frontend contract. This skill enforces that the map, the Scramble output (/docs/api), and the frontend consumption code stay in sync at all times. It handles both routine endpoint changes and breaking changes.
Modifying a controller, renaming a field in an API Resource, or changing HTTP method/path without: (1) marking the map as [breaking], (2) updating the frontend consumer, and (3) verifying both repos build. This leaves the system in an inconsistent state that only surfaces at runtime.
For any endpoint addition:
PendienteCompletadoFor a breaking change (endpoint modified, renamed, removed):
[breaking] in Module/Feature Map/docs/apinpm run build in frontend — must passsail test in backend — must pass[breaking] status — set to Completado or En progresodigraph contract_sync {
rankdir=TB;
node [shape=box, style=rounded];
A [label="Endpoint change\ndetected or planned"];
B [label="Breaking change?", shape=diamond];
C [label="New endpoint"];
D [label="Mark [breaking]\nin Module Map"];
E [label="Implement in\nBackend"];
F [label="Verify Scramble\n/docs/api"];
G [label="Implement in\nFrontend"];
H [label="Both repos\nbuild + test?", shape=diamond];
I [label="Fix issues"];
J [label="Update Map\nRemove [breaking]"];
K [label="Commit both repos"];
A -> B;
B -> C [label="no (new)"];
B -> D [label="yes"];
C -> E; D -> E;
E -> F -> G -> H;
H -> I [label="no"];
I -> H;
H -> J [label="yes"];
J -> K;
}
| Change | Breaking? | Action |
|---|---|---|
| New endpoint | No | Add to map, implement both sides |
| New optional field in response | No | Frontend ignores unknown fields safely |
| New required field in request | Yes | Frontend must send it |
| Field renamed in request or response | Yes | Frontend references break |
| Endpoint path changed | Yes | Frontend fetch URLs break |
| HTTP method changed | Yes | Frontend fetch method breaks |
| Endpoint removed | Yes | Frontend references break |
| Response structure reorganized | Yes | Frontend Zod schemas break |
After every backend change:
sail up -dhttp://localhost/docs/api (or fetch /docs/api.json)The map in root CLAUDE.md must be updated:
| Module Backend | Level | Feature(s) Frontend | Level | Main Endpoints | Status |
|----------------|-------|---------------------|-------|----------------|--------|
| Orders | 2 | orders | 2 | GET /api/orders, POST /api/orders | [breaking] |
Status values:
Pendiente — planned, not implementedEn progreso — partially implemented[breaking] — change made on one side, other side not yet updatedCompletado — both sides implemented, tested, and documentedWhen a response shape changes, update the Zod schema in the affected feature's schemas/ directory. The TypeScript compiler will then surface every usage that needs updating:
// features/orders/schemas/order.schema.ts
export const OrderSchema = z.object({
id: z.number(),
// Add/rename/remove fields here — TypeScript errors guide the rest
status: z.enum(['pending', 'confirmed', 'shipped', 'cancelled']),
total: z.number().positive(),
});
Both repos must pass independently before marking a breaking change resolved:
Backend:
sail test # all Pest tests green
sail pint --test # zero style violations
Frontend:
npm run build # TypeScript + lint clean
npm run test # all Vitest tests green
docker compose build # Docker image compiles
If a breaking change reflects a significant architectural decision (API versioning, resource restructuring, new authentication scheme), document it:
docs/ADR/NNN-title.md in the affected repo(s)Documentation (ALWAYS update before closing the task):
CLAUDE.md Module/Feature Map — Status column, Endpoints columnCLAUDE.md — API Pública sectionCLAUDE.md — API Consumption section[breaking] is a temporary state, never a resting state — resolve it before ending the sessionThis skill activates when there are changes to the API contract between backend and frontend. Superpowers has no equivalent for cross-repo coordination. This skill complements Superpowers' executing-plans: when a plan task involves an API change, this skill activates to synchronize the contract.
If Superpowers is not installed, this skill works independently.
npx claudepluginhub juan-apscreativas/fullstack-project-skills --plugin fullstack-project-skillsValidates OpenAPI, Swagger, and GraphQL schemas match backend implementation. Detects breaking changes, generates TypeScript clients, and syncs API docs.
Detects breaking changes in REST, GraphQL, and gRPC API contracts. Compares OpenAPI schemas and protobuf defs to baselines, classifies severity, validates semver, runs Pact tests, generates reports.