api-validate
БесплатноБез исполняемых скриптовНе проверенAPI contract validation and breaking change detection
от diegosouzapw★ 68 звёзд на GitHubОб этом скилле
API Contract Validation
I'll analyze your API contracts for breaking changes, compatibility issues, and schema validation.
Arguments: $ARGUMENTS - API spec paths, comparison targets, or validation focus
Token Optimization Strategy
Target Reduction: 50% (3,000-5,000 → 1,000-2,500 tokens)
This skill uses aggressive optimization through checksum-based caching, schema diffing, and early exit patterns to minimize token usage while providing comprehensive API contract validation.
Optimization Patterns Applied
OpenAPI Schema Caching (60% reduction)
- Cache parsed OpenAPI/Swagger schemas with checksums
- Detect changes via file checksums before expensive parsing
- Reuse cached schemas across validations
- Share contract cache with
/api-test-generate,/api-docs-generate - Pattern:
SESSION-STATE+CHECKSUM-VALIDATION
Breaking Change Detection with Pattern Matching (70% reduction)
- Template-based breaking change rules (no LLM needed for common patterns)
- Regex patterns for endpoint removal, type changes, required fields
- Progressive disclosure: Show breaking changes first, details on demand
- Pattern:
TEMPLATE-RULES+PROGRESSIVE-DISCLOSURE
Contract Diff Comparison (80% reduction)
- Compare schema diffs, not full API spec files
- Endpoint-level comparison (only changed endpoints analyzed)
- JSON path-based field diffing
- Pattern:
DIFF-ONLY+INCREMENTAL
Endpoint Version Comparison (50% reduction)
- Compare version metadata first (quick version number check)
- Skip unchanged endpoints (checksum per endpoint)
- Batch endpoint analysis (process multiple endpoints in one pass)
- Pattern:
BATCH-OPERATIONS+EARLY-EXIT
Git Diff for Changed API Specs Only (90% reduction)
- Use
git diffto identify changed API spec files - Only validate modified specs since last baseline
- Skip validation if no API specs changed
- Pattern:
GIT-DIFF-DEFAULT+EARLY-EXIT
- Use
Template-Based Validation Rules (75% reduction)
- Pre-defined breaking change rules (field removal, type change, etc.)
- Semantic versioning compliance templates
- Standard backward compatibility checks
- Pattern:
TEMPLATE-BASED+RULE-ENGINE
Token Usage by Validation Mode
| Mode | Scenario | Token Usage | Primary Optimization |
|---|---|---|---|
| Status Check | No changes detected | 200-500 | Git diff + Early exit (95% savings) |
| Baseline Validation | Compare against baseline | 1,000-2,000 | Schema diff + Caching (60% savings) |
| Create Baseline | Initial contract capture | 1,500-2,500 | Schema extraction + Caching (40% savings) |
| Version Compare | Compare specific versions | 2,000-3,000 | Endpoint comparison + Progressive disclosure (50% savings) |
| Full Analysis | Comprehensive validation | 2,000-2,500 | All patterns combined (50% savings) |
Caching Architecture
Session Files (Project Root):
api-validate/
├── baseline.json # Contract baseline with checksums
├── state.json # Validation state and metadata
├── plan.md # Validation plan and findings
└── endpoints.json # Cached endpoint schemas
Shared Cache (Claude Code Cache):
.claude/cache/api/
├── contracts.json # Shared contract cache
├── schemas/ # Parsed OpenAPI schemas
│ ├── {checksum}.json # Schema by file checksum
│ └── metadata.json # Schema metadata
└── validation-rules.json # Breaking change templates
Cache Strategy:
- Schema Cache: Valid until API spec file checksum changes
- Endpoint Cache: Per-endpoint checksums for granular invalidation
- Validation Rules: Static templates, never expire
- Baseline Cache: Valid until explicit baseline update
- Shared Across Skills:
/api-test-generate,/api-docs-generate,/api-mock
Performance Characteristics
Best Case (No Changes):
- Git diff check: ~200 tokens
- Checksum comparison: ~100 tokens
- Early exit: ~100 tokens
- Total: 200-500 tokens (95% reduction)
Typical Case (Minor Changes):
- Git diff: ~200 tokens
- Schema diff: ~500 tokens
- Breaking change detection: ~300 tokens
- Report generation: ~200 tokens
- Total: 1,000-2,000 tokens (67% reduction)
Worst Case (Major API Redesign):
- Schema parsing: ~800 tokens
- Full endpoint comparison: ~1,000 tokens
- Detailed breaking change analysis: ~500 tokens
- Migration recommendations: ~200 tokens
- Total: 2,000-2,500 tokens (50% reduction)
Implementation Details
Early Exit Patterns:
# 1. Git diff check (saves 95% if no changes)
if ! git diff --name-only HEAD~1 | grep -E '\.(openapi|swagger)\.(json|yaml|yml)$'; then
echo "No API spec changes detected"
exit 0
fi
# 2. Checksum validation (saves 90% if specs unchanged)
CURRENT_CHECKSUM=$(find . -name "*.openapi.*" -o -name "swagger.*" | xargs md5sum |
Установить api-validate в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл api-validate?
API contract validation and breaking change detection
Как установить скилл api-validate?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл api-validate запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This 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…
от Anthropic