
validating-api-contracts
by jeremylongshore
validating-api-contractsは、システム間の統合と連携を実現するスキルです。APIとデータの統合により、シームレスな情報フローと業務効率の向上をサポートします。
SKILL.md
name: validating-api-contracts description: | This skill validates API contracts using consumer-driven testing and OpenAPI validation. It leverages Pact for consumer-driven contract testing, ensuring that API providers adhere to the expectations of their consumers. It also validates APIs against OpenAPI specifications to guarantee compliance and identify breaking changes. Use this skill when the user asks to generate contract tests, validate API responses, check backward compatibility, or validate requests/responses using the terms "contract-test", "ct", "Pact", "OpenAPI validation", or "consumer-driven contract testing".
Overview
This skill enables Claude to generate and validate API contracts, ensuring compatibility between API providers and consumers. It uses Pact for consumer-driven contract testing and OpenAPI validation for specification compliance.
How It Works
- Generating Contract Tests: Claude creates Pact consumer tests based on API usage, generating provider verification tests and building OpenAPI contract validators.
- Validating Contracts: The skill verifies if API responses match the defined contracts.
- Checking Compatibility: It checks for backward compatibility to identify breaking changes in the API.
When to Use This Skill
This skill activates when you need to:
- Generate contract tests for an API.
- Validate API responses against existing contracts.
- Identify breaking changes in an API.
Examples
Example 1: Generating Pact Contracts
User request: "Generate contract tests for my API using Pact."
The skill will:
- Analyze the API and generate Pact consumer contracts.
- Create provider verification tests based on the contracts.
Example 2: Validating an OpenAPI Specification
User request: "Validate my API against the OpenAPI specification."
The skill will:
- Validate the API against the provided OpenAPI specification.
- Report any discrepancies or violations of the specification.
Best Practices
- Clarity: Be specific when requesting contract generation or validation, providing relevant API details.
- Completeness: Ensure that your OpenAPI specifications are up-to-date for accurate validation.
- Context: Provide context about the consumer and provider roles when using Pact.
Integration
This skill can be integrated with other testing and deployment tools in the Claude Code ecosystem to automate contract verification as part of a CI/CD pipeline.
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 1000以上
3ヶ月以内に更新
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です

