본문으로 건너뛰기
cccskills
무료GitHub에 공개

api-contract-testing

Design and review API contract tests across providers and consumers. Use for schema changes, compatibility regressions and client integration failures.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

API Contract Testing

Overview

Turn an API change into explicit provider and consumer checks. Start from the actual contract and affected clients, then verify wire-level behavior rather than relying on generated types or a successful build. Default to local fixtures and existing test tools; this skill does not provision a testing service.

When to Use

  • A response field, endpoint, event schema or error envelope changes.
  • A client and server build successfully but disagree at runtime.
  • A team needs to distinguish a breaking change from a compatible extension.
  • A reported regression needs a minimal provider/consumer reproduction.

Do not use this as authorization to call production endpoints, bypass access controls or publish a new API version.

How It Works

1. Bind the contract and scope

Identify the provider, transport, contract source and version, known consumers and the requested behavior. Read the real OpenAPI/JSON Schema/protobuf definition or documented examples and the corresponding server/client code. Record missing consumers and stale specifications as coverage gaps; do not invent interfaces or claim complete coverage from one client.

Keep these distinct: documented schema, actual provider output, generated client types and runtime parsing. A type assertion alone is not validation. Preserve the existing protocol and test runner instead of introducing a new platform by default.

2. Classify the change

Review fields, requiredness, nullability, enum values, status codes, headers, content type, pagination and error behavior. Inspect whether clients tolerate extra fields and unknown enum values. Even an added optional field can break a strict consumer. Explicitly identify affected versions and assumptions before calling a change compatible.

For events, include duplicate delivery, ordering and version envelopes. For request changes, check serialization and server validation as well as responses.

3. Build a small test matrix

Use deterministic synthetic fixtures for:

  • Valid success, including optional and empty values.
  • Missing required fields, wrong types and explicit nulls.
  • Extra fields and unknown enums according to the actual compatibility policy.
  • Declared error envelopes, non-success statuses and malformed bodies.
  • Old consumer against new provider and new consumer against retained old provider, where those combinations are supported.

Assert the behavior promised by the contract. Do not silently coerce malformed values or make the fixture match a defect just to get a passing test.

4. Verify each boundary

Run the existing schema validator against fixtures. Exercise the provider handler locally and pass its serialized result through the real consumer parser. Check failure cases reject or map errors as specified. Use an authorized isolated integration environment only when fixtures cannot establish the required property; report that boundary explicitly.

A mock verifies assumptions encoded in the mock. It does not establish that the real provider implements them. Record exact commands, fixture versions and observed outcomes separately from unrun checks.

5. Report and hand off

Deliver the change classification, affected consumers, test matrix, observed failures, minimal reproduction and remaining coverage gaps. For a breaking change, propose versioning, a compatibility adapter or a staged migration with owners and rollback criteria. Deployment and consumer migration require their own task authorization.

Example

Synthetic documented response:

{"id":"invoice-demo","amount_minor":1250,"currency":"EUR"}

Contract: id and currency are strings; amount_minor is a non-negative integer in minor units. This fixture does not represent an actual customer or payment.

Fixture changeExpected check
amount_minor becomes "1250"Runtime parser rejects the string; compile-time generated types alone cannot detect wire drift.
amount_minor is missing or nullReject when the field is required and non-nullable.
Extra display_label fieldVerify the consumer's documented extra-field policy before declaring compatibility.
HTTP error with an HTML bodyProduce the declared transport/protocol error, rather than treating it as a valid invoice.

Reusable prompt:

Review this API change against the actual contract and supplied client/server code.
List affected consumers and supported version combinations. Add local contract tests
for valid, missing, null, wrong-type and error responses with the existing runner.
Report checks actually run and any provider behavior still requiring integration proof.

Best Practices

  • Keep fixtures synthetic, minimal and versioned with the relevant contract.
  • Test serialization and runtime parsing in addition to static types.
  • Require evidence for compatibility claims and preserve the failing reproduction.
  • Use the existing tools; no hosted vendor, broker or

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ranbot-ai/awesome-skills72026년 10월 18일 업데이트

Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ranbot-ai/awesome-skills72026년 10월 18일 업데이트

Usar al iniciar o mejorar un proyecto de IA: diagnostica código y restricciones, propone skills existentes y redacta tareas y un plan de implementación en español.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ranbot-ai/awesome-skills72026년 10월 18일 업데이트

Usar para crear o mejorar una skill de Andru.ia: define entradas y resultados, redacta SKILL.md con ejemplos y límites, valida la estructura y prepara una PR.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ranbot-ai/awesome-skills72026년 10월 18일 업데이트

Usar tras definir el sector de un proyecto: prepara un dossier en español con contexto, normas aplicables, patrones UX y riesgos, distinguiendo fuentes verificadas de hipótesis.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ranbot-ai/awesome-skills72026년 10월 18일 업데이트

AI-powered presentation generation via the 2slides API — create slides from text, match a reference image style, summarize documents into decks, add AI voice narration, and export pages/audio. Use f

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ranbot-ai/awesome-skills72026년 10월 18일 업데이트

ranbot-ai의 스킬 모두 보기

이 스킬의 문제 신고