Skip to content

Add B10 API spec drift rule to connector review mixin - #118

Merged
Bencheng21 merged 2 commits into
mainfrom
add-api-spec-drift-rule
Sep 15, 2026
Merged

Bencheng21 merged 2 commits into
mainfrom
add-api-spec-drift-rule

Conversation

@Bencheng21

@Bencheng21 Bencheng21 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

The connector review mixin covered newly added endpoints (B7, B8) but had no criterion for an existing endpoint being changed. A version or path swap (/v1/users/v2/users), a renamed ID field, or a changed pagination style could pass review unflagged — the downstream rules (B1, B3) only catch the symptom if the reviewer connects the dots.

B10 closes that gap and ties both cases to the build-openapi-spec.md skill.

The rule

  • Trigger-gated. Fires only when the diff changes or adds an API endpoint — endpoint constants, request paths, base URL, or the request/response structs bound to a call. Explicit instruction not to raise it otherwise, so it stays quiet on unrelated PRs.
  • Endpoint changed → compare the new request/response shape against the checked-in spec/openapi.json. Any schema difference (path/version change, field added/removed/renamed/retyped, ID field change, pagination style change) is reported as blocking-correctness. If spec/openapi.json wasn't updated in the PR it is stale, and that is reported too — at suggestion severity when the schema itself looks unchanged. Either way the author is told to regenerate the spec with the skill. If no spec/openapi.json exists, it falls through to the added-endpoint branch.
  • Endpoint added → not a breaking change. Reported as a suggestion asking the author to run the skill so spec/openapi.json covers the new endpoint.

Severity names match the base prompt's vocabulary (blocking-correctness / suggestion, see base-pr-review.md), so the reviewer maps them to the right merge gate.

Note for reviewers

spec/openapi.json and the build-openapi-spec.md skill both live in the connector repos being reviewed, not here. If the skill is invoked under a different name there, the rule text should be updated to match.

🤖 Generated with Claude Code

Bencheng21 and others added 2 commits September 15, 2026 13:58
The connector mixin covered newly added endpoints (B7, B8) but had no
criterion for an existing endpoint being changed, so version/path swaps
and response shape changes could pass review unflagged.

B10 triggers only on endpoint change or addition. A changed endpoint is
diffed against the checked-in api.yaml and reported as a blocking
correctness break when the schema differs; an added endpoint is a
suggestion to regenerate the spec. Both point the author at the
build-openapi-spec.md skill.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rename the spec reference from api.yaml to the real path, spec/openapi.json.
Also require the regeneration prompt whenever an endpoint changes without a
corresponding spec update, not only when the schema visibly differs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Bencheng21
Bencheng21 merged commit 8c8b76b into main Sep 15, 2026
2 checks passed
@Bencheng21
Bencheng21 deleted the add-api-spec-drift-rule branch September 15, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants