openapi-contract-diff skill
OpenAPI 또는 Swagger 명세서를 비교하여 중대한 변경 사항을 식별하고, 심각도 수준에 따라 CI 파이프라인을 제어합니다.
- GitHub 스타
- 13
- 파일
- 12
- 마지막 커밋
- 2026년 11월 12일
- 라이선스
- MIT
- 허용된 도구
- —
openapi-contract-diff skill은 무엇을 하나요?
openapi-contract-diff은(는) agent skill입니다. OpenAPI 또는 Swagger 명세서를 비교하여 중대한 변경 사항을 식별하고, 심각도 수준에 따라 CI 파이프라인을 제어합니다.
skill의 SKILL.md에서 생성된 요약입니다.
openapi-contract-diff skill 정보
이 SKILL은 공개 API 또는 타사 통합을 관리하는 개발자가 API 명세서의 중대한 변경 사항(breaking changes)을 식별할 수 있도록 지원합니다. oasdiff 도구를 사용하여 로컬 파일과 원격 URL 등 두 개의 OpenAPI 또는 Swagger 파일을 비교하며, 외부 클라이언트에 영향을 줄 수 있는 수정을 감지합니다. 이 도구는 250개 이상의 체크를 수행하여 결과를 세 가지 심각도 수준으로 분류합니다. 즉, 확실한 변경 사항은 ERR, 잠재적 문제는 WARN, 영향이 없는 업데이트는 INFO로 분류합니다.
개발자가 풀 리퀘스트(pull request)가 기존 사용자에게 영향을 미치는지 확인하거나 자동화된 CI 게이트를 설정할 때 에이전트가 이 SKILL을 로드해야 합니다. --fail-on 플래그를 사용하면 특정 심각도 수준이 감지될 경우 프로세스를 종료하도록 설정할 수 있으며, 예를 들어 ERR 결과가 발견되면 빌드를 실패하게 만들 수 있습니다. 이 SKILL은 JSON, YAML, markdown, HTML 등 다양한 출력 형식을 지원하므로 사람이 직접 검토하거나 배포 파이프라인에서 머신 기반 자동화에 활용하기 적합합니다.
agent가 수행할 수 있는 작업
- 1CI에서 API 변경 사항 방지풀 리퀘스트가 OpenAPI 명세에 높은 심각도의 변경 사항을 도입할 경우 빌드 단계가 자동으로 실패하도록 구성합니다.
- 2특정 API 차이점 검토단일 풀 리퀘스트를 분석하여 엔드포인트 삭제나 enum 범위 축소가 외부 사용자에게 영향을 미치는지 판단합니다.
- 3원격 명세 파일 비교로컬 스키마 버전과 원격 URL에 호스팅된 라이브 버전을 비교하여 실행합니다.
skill의 SKILL.md를 기반으로 작성되었습니다. 모든 사용 사례는 해당 문서의 인용구와 대조 확인되었습니다.
openapi-contract-diff skill 설치 방법
각 명령은 skill 폴더를 클라이언트의 skills 디렉터리에 복사합니다. 클라이언트를 재시작하거나 새 세션을 시작하여 로드하세요.플러그인에 openapi-contract-diff skill 설치
/plugin marketplace add testland/qa /plugin install qa-contract-testing@testland-qa
Claude Code에 openapi-contract-diff skill 설치
~/.claude/skills/openapi-contract-diff/SKILL.md
$ npx degit testland/qa/plugins/qa-contract-testing/skills/openapi-contract-diff ~/.claude/skills/openapi-contract-diffClaude Code (project)에 openapi-contract-diff skill 설치
.claude/skills/openapi-contract-diff/SKILL.md
$ npx degit testland/qa/plugins/qa-contract-testing/skills/openapi-contract-diff .claude/skills/openapi-contract-diffCodex에 openapi-contract-diff skill 설치
~/.agents/skills/openapi-contract-diff/SKILL.md
$ npx degit testland/qa/plugins/qa-contract-testing/skills/openapi-contract-diff ~/.agents/skills/openapi-contract-diffGemini CLI에 openapi-contract-diff skill 설치
~/.gemini/skills/openapi-contract-diff/SKILL.md
$ npx degit testland/qa/plugins/qa-contract-testing/skills/openapi-contract-diff ~/.gemini/skills/openapi-contract-diffClaude.ai에 openapi-contract-diff skill 설치
npx degit testland/qa/plugins/qa-contract-testing/skills/openapi-contract-diff openapi-contract-diff && zip -r openapi-contract-diff.zip openapi-contract-diff # claude.ai → Customize → Skills → + → Create skill → Upload a skill → openapi-contract-diff.zip
SKILL.md
GitHub에서 보기openapi-contract-diff
Overview
oasdiff is the canonical CLI for comparing two OpenAPI specifications
and reporting breaking changes (oasdiff-readme). It runs
over 250 checks against the diff and classifies each finding into one
of three severity tiers (oasdiff-breaking):
| Severity | Meaning |
|---|---|
ERR |
Definite breaking change - should be avoided. |
WARN |
Potential breaking change - developers should be aware. |
INFO |
Non-breaking change. |
This is the schema-driven counterpart to
pact-contract-testing: use
oasdiff when you don't control the consumers (public APIs, third-
party integrations) and need to gate breaking-change shipment based on
the spec alone.
When to use
- The repo defines an OpenAPI 3 spec (
openapi.yaml,openapi.json, or split-file equivalent). - The team wants a CI gate that fails the build on breaking spec changes between the PR and the deployed version.
- The API has external consumers (no Pact possible) or the team isn't ready to invest in consumer-driven contracts yet.
- You need a one-shot review tool for "is this PR going to break consumers?"
Authoring (no authoring - the spec is the contract)
Unlike Pact, oasdiff doesn't add tests to the repo. Instead it consumes two OpenAPI specs and emits a diff. Authoring effort goes into keeping the spec authoritative - i.e. ensuring the OpenAPI file in the repo accurately describes the implementation. Tools that close the spec-vs-implementation gap (Schemathesis, Spectral lint) pair well with this skill but are out of scope.
Install
# Go install (preferred for native CLI)
go install github.com/oasdiff/oasdiff@latest
# Docker (CI-friendly, no Go toolchain required)
docker pull tufin/oasdiff
(Per oasdiff-readme.)
Running
Local diff
oasdiff breaking openapi-old.yaml openapi-new.yaml
(Per oasdiff-breaking.)
By default oasdiff prints colorized text. For machine consumption, use
--format:
oasdiff breaking --format json openapi-old.yaml openapi-new.yaml > breaking.json
oasdiff breaking --format yaml openapi-old.yaml openapi-new.yaml
oasdiff breaking --format markdown openapi-old.yaml openapi-new.yaml
oasdiff breaking --format html openapi-old.yaml openapi-new.yaml > breaking.html
Available formats: text (default), JSON, YAML, markdown, HTML, plus single-line (oasdiff-breaking).
Comparing remote specs
The CLI accepts URLs directly:
oasdiff breaking \
https://raw.githubusercontent.com/.../openapi-test1.yaml \
https://raw.githubusercontent.com/.../openapi-test3.yaml
(Adapted from oasdiff-readme.)
Docker variant
docker run --rm -t -v "$PWD:/specs" tufin/oasdiff breaking \
/specs/openapi-old.yaml /specs/openapi-new.yaml
--fail-on for CI gating
The exit code is the gate signal (oasdiff-breaking):
oasdiff breaking --fail-on ERR ... # exit 1 on ERR; default behavior most teams want
oasdiff breaking --fail-on WARN ... # exit 1 on ERR or WARN; stricter
oasdiff breaking --fail-on INFO ... # exit 1 on any reported change
Default for production gates: --fail-on ERR. Use --fail-on WARN for
stricter projects (financial APIs, public SDKs) where even potentially-
breaking changes need explicit acceptance.
What counts as breaking
oasdiff ships 250+ checks. The headline breaking patterns (oasdiff-breaking):
- Endpoint deletion - removing a path or HTTP method.
- Removed success response - e.g. dropping the 200 from a
responsesblock. - Deleted schemas from
components.schemas- even if no longer referenced. - Enum value removal - removing a value from an
enumarray. Mark the enumx-extensible-enum: trueto treat removals as non-breaking (clients should ignore unknown values). - Response shape narrowing - changing a property type from
stringtointeger, removing arequiredarray entry, etc. - Request shape widening into
required- making a previously- optional request field required.
For the full list, run oasdiff checks to dump the active rule set.
Reading the report
Text output (default) example:
1 changes: 1 error, 0 warning, 0 info
error [response-success-status-removed] at openapi-new.yaml
in API GET /pets
the success response status '200' was removed
JSON output (for downstream parsing):
[
{
"id": "response-success-status-removed",
"level": 3,
"operation": "GET",
"operationId": "listPets",
"path": "/pets",
"source": "openapi-new.yaml",
"section": "paths",
"text": "the success response status '200' was removed"
}
]
level: 3 is ERR, 2 is WARN, 1 is INFO per the standard
oasdiff convention. Pipe to jq for triage:
jq -r '.[] | select(.level==3) | "ERR " + .operation + " " + .path + " :: " + .text' breaking.json
CI integration
GitHub Actions example using the Docker image and the --fail-on ERR
default:
# .github/workflows/openapi-diff.yml
name: openapi-diff
on:
pull_request:
jobs:
oasdiff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # need merge-base SHA for `git show <base>:openapi.yaml`
- name: Extract base spec
run: |
BASE_SHA=$(git merge-base origin/main HEAD)
git show $BASE_SHA:openapi.yaml > /tmp/openapi-base.yaml
- name: Run oasdiff
run: |
docker run --rm -v "$PWD:/specs" -v /tmp:/tmp tufin/oasdiff breaking \
--fail-on ERR \
--format text \
/tmp/openapi-base.yaml \
/specs/openapi.yaml | tee oasdiff-report.txt
- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: openapi-breaking-report
path: oasdiff-report.txt
retention-days: 14
fetch-depth: 0 is required so the merge-base of the PR resolves; the
shallow clone GitHub uses by default doesn't include the merge-base
commit.
For a PR comment workflow, generate --format markdown and post via
actions/github-script@v7 - the markdown table format includes a
clickable per-finding rationale.
References
- oasdiff-readme - install (Go + Docker), output formats, key flags.
- oasdiff-breaking -
breakingsubcommand, severity tiers,--fail-onsemantics, breaking-change categories. pact-contract-testing- the consumer-driven counterpart for cases where you control consumers.contract-compatibility-gate- the gate skill that aggregates oasdiff output with Pact and Protobuf verdicts.
이 스킬의 파일
12openapi-contract-diff skill 질문
Claude Code에 openapi-contract-diff skill을 어떻게 설치하나요?
npx degit testland/qa/plugins/qa-contract-testing/skills/openapi-contract-diff ~/.claude/skills/openapi-contract-diff를 실행합니다. Claude Code는 ~/.claude/skills(모든 프로젝트) 또는 .claude/skills(한 프로젝트)에서 skills를 로드하며, 설명이 작업과 일치할 때 skill을 사용합니다.
openapi-contract-diff skill을 사용할 수 있는 클라이언트는 무엇인가요?
Agent Skills 형식을 읽는 모든 클라이언트(Claude Code, Codex, Gemini CLI, claude.ai(ZIP으로 업로드))가 사용할 수 있습니다. skill 내 스크립트는 클라이언트가 코드 실행을 허용하는 경우에만 실행됩니다.