api-contract-validation
API contract validation patterns for ensuring client-side models match backend JSON responses. Prevents decoding failures from schema mismatches. Tech-stack…
от CarlosDanielDev★ 31 звезда на GitHub
Установить api-contract-validation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
API Contract Validation Skill
Purpose
Prevent bugs where client-side models don't match backend API responses — causing silent decoding failures at runtime.
Contract Schema Location
All API contracts live in docs/api-contracts/ as JSON files.
Naming Convention
docs/api-contracts/{feature-area}-{endpoint-name}.json
Contract Schema Format
{
"$schema": "api-contract-v1",
"endpoint": "GET /api/items/list",
"description": "Fetch items for display",
"issue": "#38",
"lastVerified": "2026-03-10",
"request": {
"query": {
"count": { "type": "integer", "required": false, "default": 10 }
}
},
"response": {
"items": {
"type": "array",
"items": {
"id": { "type": "string", "required": true },
"name": { "type": "string", "required": true },
"score": { "type": "integer", "required": false }
}
},
"total": { "type": "integer", "required": true }
}
}
DOR (Definition of Ready)
An issue is NOT ready for implementation unless:
- API contract schema exists in
docs/api-contracts/ - All response fields documented with types and required/optional
- Schema verified against actual backend response
DOD (Definition of Done)
Implementation is NOT done unless:
- Client models match contract schema field-by-field
- Required fields are non-optional in client code
- Optional fields are properly nullable
- A decode test exists using example JSON from the contract
- No extra fields in client model that don't exist in contract
Common Mismatch Patterns
- Ghost fields: Client model has a field that doesn't exist in backend response
- Required mismatch: Backend returns field optionally, client declares it as required
- Type mismatch: Backend returns
number(float) but client declares integer - Naming mismatch: Backend uses
snake_case, client usescamelCasewithout mapping - Nested structure mismatch: Backend nests data differently than client expects
Validation Process
- Read contract schema from
docs/api-contracts/ - Read the corresponding client model file
- For each field in schema: verify exists, type matches, optionality matches
- For each field in client model: verify exists in schema (catch ghost fields)
- Report mismatches
Integration with Orchestrator Workflow
subagent-architect → Architecture Blueprint
│
▼
CONTRACT VALIDATION ← This skill
│
▼
subagent-qa → Test Blueprint (includes decode tests)
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
- 01
Read - 02
Grep - 03
Glob - 04
WebSearch
FAQ
Что делает скилл api-contract-validation?
API contract validation patterns for ensuring client-side models match backend JSON responses. Prevents decoding failures from schema mismatches. Tech-stack agnostic.
Как установить скилл api-contract-validation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл api-contract-validation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…