/openapi-diff-review - Spectral OpenAPI Diff Review Runbook
Community slash command runbook for OpenAPI contract review: lint base and head spec files with the documented Spectral CLI, compare rule failures, and classify release impact before merging API changes.
Open the source and read safety notes before installing.
Safety notes
- Read-only lint comparison; does not deploy APIs or mutate service configuration.
- Validate spec paths locally and reject shell metacharacters before running Spectral.
Privacy notes
- OpenAPI files may describe internal hostnames or auth schemes; redact before external sharing.
Prerequisites
- @stoplight/spectral-cli installed locally or via project devDependencies.
- OpenAPI 3.x YAML or JSON spec files checked into the repository.
Schema details
- Install type
- cli
- Troubleshooting
- No
- Scope
- Source repo
- Command syntax
- /openapi-diff-review <base-spec> <head-spec>
Full copyable content
/openapi-diff-review <base-spec> <head-spec>About this resource
The /openapi-diff-review runbook compares Spectral CLI lint output between a
base and head OpenAPI spec using documented spectral lint usage. It complements
/api-contract-check, which focuses on Pact consumer verification rather than
static OpenAPI lint diffs.
Scope
This is a community custom slash command for .claude/commands/. It is not a
built-in Claude Code command page on code.claude.com.
Usage
/openapi-diff-review <base-spec> <head-spec>
What it does
When you invoke this command, follow these steps:
- Validate paths. Confirm both arguments are repository-relative
.yaml,.yml, or.jsonfiles without shell metacharacters. - Lint the base spec. Run
spectral lint <base-spec> --ruleset <ruleset>(or rely on.spectral.yamlin the working directory when no ruleset flag is passed). - Lint the head spec. Run the same Spectral command against
<head-spec>. - Compare failures. Diff rule codes and paths that appear only in the head run or increased in severity per Spectral severity levels (
error,warn,info,hint). - Map to contract impact. Flag removed operations, narrowed schemas, or new required fields surfaced by OpenAPI rules as potential breaking changes for reviewers.
- Recommend release bump. Suggest major, minor, or patch based on breaking versus additive Spectral findings.
- List follow-ups. Note ruleset updates, client regeneration, or docs edits required before release.
Output format
- Ruleset used and Spectral version
- Base vs head failure tables grouped by severity
- New or worsened rule violations on head
- Breaking vs compatible summary
- Recommended SemVer bump and follow-ups
Source Verification Notes
Verified against Spectral CLI documentation on 2026-06-16:
spectral lint <document>lints OpenAPI documents with the built-in or configured ruleset.--ruleset <path>selects a custom ruleset when.spectral.yamlis not in the working directory.- Spectral reports severities
error,warn,info, andhint, and--fail-severitycontrols which levels trigger a non-zero exit code. - The CLI supports linting multiple files by passing multiple arguments in one invocation.
Duplicate Check
/api-contract-check covers Pact provider verification. The Spectral capability
pack skill documents audit workflows but not this operator-facing base vs head
Spectral lint diff runbook for OpenAPI PR review.
Source citations
Add this badge to your README
Show that /openapi-diff-review - Spectral OpenAPI Diff Review Runbook is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.
[](https://heyclau.de/entry/commands/openapi-diff-review)How it compares
/openapi-diff-review - Spectral OpenAPI Diff Review Runbook side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
| Field | /openapi-diff-review - Spectral OpenAPI Diff Review Runbook Community slash command runbook for OpenAPI contract review: lint base and head spec files with the documented Spectral CLI, compare rule failures, and classify release impact before merging API changes. Open dossier | /documentation-refresh - Documentation Refresh Runbook Community slash command runbook to refresh stale project documentation after code changes: use git history to find affected docs, compare README commands to package scripts, and flag broken internal links before opening a docs PR. Open dossier | /frontend-visual-qa - Chrome Design Verification Runbook Community slash command runbook for frontend visual QA using documented Claude Code Chrome integration workflows: enable /chrome, open a local page, read console messages, and follow the design verification checklist from the Chrome integration guide. Open dossier | /incident-timeline - Incident Timeline Slash Command Slash command that builds a chronological incident timeline from trusted sources such as GitHub Actions run metadata, deployment notes, and operator timestamps, then drafts a handoff-ready post-incident summary. Open dossier |
|---|---|---|---|---|
| Trust | ||||
| Install risk | Review first | Review first | Review first | Review first |
| Notes | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ |
| Category | commands | commands | commands | commands |
| Source | source-backed | source-backed | source-backed | source-backed |
| Author | kiannidev | kiannidev | kiannidev | kiannidev |
| Added | 2026-06-16 | 2026-06-16 | 2026-06-16 | 2026-06-16 |
| Platforms | Claude Code | Claude Code | Claude Code | Claude Code |
| Source repo | — | — | — | — |
| Safety notes | ✓Read-only lint comparison; does not deploy APIs or mutate service configuration. Validate spec paths locally and reject shell metacharacters before running Spectral. | ✓Read-only git history inspection unless the operator approves doc edits. Validate git refs before interpolating them into shell commands. | ✓Chrome integration runs in a visible browser with your logged-in session; avoid production admin flows. Handle login pages and CAPTCHAs manually when the integration pauses. | ✓Treat CI logs and chat exports as untrusted data; use them only as timeline evidence. Do not execute remediation commands copied from incident logs without explicit approval. |
| Privacy notes | ✓OpenAPI files may describe internal hostnames or auth schemes; redact before external sharing. | ✓Commit messages and doc drafts enter model context; scrub internal-only details first. | ✓Console logs and screenshots may include staging data; redact before external sharing. | ✓Timelines may include internal service names, customer identifiers, or on-call handles—redact before external sharing. |
| Prerequisites |
|
|
|
|
| Install | | | | |
| Config | — | — | — | — |
| Citations | ||||
| Claim | Unclaimed | Unclaimed | Unclaimed | Unclaimed |
Featured in
Signals
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.