Skill openapi-contract-diff
✓ VérifiéCompare les spécifications OpenAPI ou Swagger pour identifier les changements de rupture et bloquer les pipelines CI en fonction des niveaux de sévérité.
- Étoiles GitHub
- 13
- Fichiers
- 12
- Dernier commit
- 12 nov. 2026
- Licence
- MIT
- Outils autorisés
- —
Que fait la skill openapi-contract-diff ?
openapi-contract-diff est une agent skill. Compare les spécifications OpenAPI ou Swagger pour identifier les changements de rupture et bloquer les pipelines CI en fonction des niveaux de sévérité.
Résumé généré à partir du SKILL.md de la skill.
À propos du skill openapi-contract-diff
Cette SKILL permet aux développeurs gérant des intégrations publiques ou tierces d'identifier les changements de rupture (breaking changes) dans les spécifications d'API. Elle utilise l'outil oasdiff pour comparer deux fichiers OpenAPI ou Swagger, comme un fichier local et une URL distante, afin de détecter les modifications susceptibles de perturber les clients externes. L'outil effectue plus de 250 vérifications pour classer les résultats en trois niveaux de sévérité : ERR pour les changements de rupture confirmés, WARN pour les problèmes potentiels et INFO pour les mises à jour sans impact de rupture.
Un agent doit charger cette SKILL lorsqu'un développeur a besoin de vérifier si une pull request va impacter les consommateurs existants ou lors de la mise en place de barrières de contrôle (gates) automatisées dans la CI. En utilisant le flag --fail-on, les équipes peuvent configurer le processus pour qu'il s'arrête avec une erreur si des niveaux de sévérité spécifiques sont détectés, comme l'échec d'un build en cas de détection d'un niveau ERR. La SKILL produit différents formats de sortie, notamment JSON, YAML, markdown et HTML, ce qui la rend adaptée aussi bien à la revue humaine qu'à l'automatisation par machine dans les pipelines de déploiement.
Ce qu'un agent peut faire avec
- 1Prévenir les changements d'API de rupture dans la CIConfigurez une étape de build pour échouer automatiquement si une pull request introduit des changements de rupture de haute sévérité dans la spécification OpenAPI.
- 2Revoir un diff d'API spécifiqueAnalysez une pull request spécifique pour déterminer si la suppression d'un endpoint ou le rétrécissement d'un enum impactera les utilisateurs externes.
- 3Comparer des fichiers de spécification distantsLancez une comparaison entre une version locale d'un schéma et une version en direct hébergée sur une URL distante.
Rédigé à partir du SKILL.md du skill. Chaque cas d'utilisation est vérifié par rapport à une citation de celui-ci.
Comment installer la skill openapi-contract-diff
Chaque commande copie le dossier de la skill dans le répertoire des skills du client. Redémarrez le client ou démarrez une nouvelle session pour la charger.Installer la skill openapi-contract-diff dans Plugin
/plugin marketplace add testland/qa /plugin install qa-contract-testing@testland-qa
Installer la skill openapi-contract-diff dans Claude Code
~/.claude/skills/openapi-contract-diff/SKILL.md
$ npx degit testland/qa/plugins/qa-contract-testing/skills/openapi-contract-diff ~/.claude/skills/openapi-contract-diffInstaller la skill openapi-contract-diff dans Claude Code (project)
.claude/skills/openapi-contract-diff/SKILL.md
$ npx degit testland/qa/plugins/qa-contract-testing/skills/openapi-contract-diff .claude/skills/openapi-contract-diffInstaller la skill openapi-contract-diff dans Codex
~/.agents/skills/openapi-contract-diff/SKILL.md
$ npx degit testland/qa/plugins/qa-contract-testing/skills/openapi-contract-diff ~/.agents/skills/openapi-contract-diffInstaller la skill openapi-contract-diff dans Gemini CLI
~/.gemini/skills/openapi-contract-diff/SKILL.md
$ npx degit testland/qa/plugins/qa-contract-testing/skills/openapi-contract-diff ~/.gemini/skills/openapi-contract-diffInstaller la skill openapi-contract-diff dans Claude.ai
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
Vérifications automatisées
Exécuté le 15 nov. 2026Rapport complet →A réussi nos vérifications automatiques. Ce n'est pas un audit de sécurité : lisez les scripts avant de laisser un agent les exécuter. Fonctionnement des vérifications
- Dépôt source lié et accessibletestland/qa/plugins/qa-contract-testing/skills/openapi-contract-diff is public and reachablegithub.com/testland/qa/tree/HEAD/plugins/qa-contract-testing ↗Réussi
- Licence open source (OSI)MITspdx.org/licenses/MIT.html ↗Réussi
- Commit ou version publiée au cours de l'année écouléeLast commit 2026-11-12github.com/testland/qa/commits ↗Réussi
- Aucun téléchargement-exécution ni vol d'identifiants dans les scriptsNo scripts in the skill folderRéussi
- Aucune instruction cachée dans SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/testland/qa/blob/HEAD/plugins/qa-contract-testing ↗Réussi
- Les outils préautorisés sont limitésNo pre-approved tools; the agent asks before using onegithub.com/testland/qa/blob/HEAD/plugins/qa-contract-testing ↗Réussi
- SKILL.md respecte le format Agent SkillsValid name and description; says when to use it; 231 linesgithub.com/testland/qa/blob/HEAD/plugins/qa-contract-testing ↗Réussi
SKILL.md
Voir sur GitHubopenapi-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.
Fichiers de cette skill
12Questions sur la skill openapi-contract-diff
Comment installer la skill openapi-contract-diff dans Claude Code ?
Exécutez npx degit testland/qa/plugins/qa-contract-testing/skills/openapi-contract-diff ~/.claude/skills/openapi-contract-diff. Claude Code charge les skills depuis ~/.claude/skills (tous les projets) ou .claude/skills (un seul projet) et utilise une skill lorsque sa description correspond à la tâche.
Quels clients peuvent utiliser la skill openapi-contract-diff ?
Tout client qui lit le format Agent Skills : Claude Code, Codex, Gemini CLI et claude.ai (envoi sous forme de ZIP). Les scripts de la skill ne s'exécutent que si le client autorise l'exécution de code.