Loading...
Loading...
Ensures frontend and backend agree on API request/response shapes using Apidog MCP as the single source of truth. Replaces manual contracts.md files. Use when implementing or reviewing API endpoints and their consumers. Automatically loaded by team-lead, backend-dev, web-dev, mobile-dev, and reviewer.
npx skill4agent add en-nam/ennam-claude-agent-team api-contract-syncApidog Specification (source of truth)
│
├──→ team-lead: defines shared types/models matching spec
│
├──→ backend-dev: implements endpoints matching spec exactly
│
├──→ web-dev / mobile-dev: consumes endpoints using typed clients
│
├──→ test-worker: validates against spec in tests
│
└──→ reviewer: verifies all implementations match specNote: For mobile-only projects without a backend (e.g., apps consuming third-party APIs), API contracts are defined by the external API documentation. Use Apidog to document the external API surface your app consumes, or skip this protocol if no API layer exists.
src/types/lib/core/models/// Schema must match Apidog spec for the endpoint
const CreateItemSchema = z.object({
name: z.string().min(1).max(200),
description: z.string().min(1).max(5000),
});// Model must match Apidog spec for the endpoint
class CreateItemRequest with _$CreateItemRequest {
factory CreateItemRequest({
required String name,
required String description,
}) = _CreateItemRequest;
factory CreateItemRequest.fromJson(Map<String, dynamic> json) =>
_$CreateItemRequestFromJson(json);
}src/types/lib/core/models/const response = await fetch(`/api/items/${id}`, {
method: 'POST',
body: JSON.stringify(data),
});
if (!response.ok) {
// Handle each error code documented in Apidog
const error = await response.json();
// 400: validation error
// 401: not authenticated
// 404: not found
}final response = await dio.post('/api/items/$id', data: data.toJson());
// Handle error status codes documented in Apidog
// Use either try/catch with DioException or response status checkscontracts.mdany