Skip to content
Back to skills

Api Contract Review

ASecurity

Reviews HTTP API behavior and compatibility for routes, request/response schemas, status codes, errors, pagination, versioning, and OpenAPI. Use for consumer-facing contract questions; do not use for a full .NET code review (use dotnet-code-review) or implementation-only endpoint work.

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
ai-agentsc#testingcode-reviewapisecurity

Works with

  • cursor
  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add k4ndev/claude-code-dotnet --skill api-contract-review --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Api Contract Review?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Api Contract Review
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/k4ndev-api-contract-review/badge)](https://www.skillsdirectory.com/skills/k4ndev-api-contract-review)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: api-contract-review
description: Reviews HTTP API behavior and compatibility for routes, request/response schemas, status codes, errors, pagination, versioning, and OpenAPI. Use for consumer-facing contract questions; do not use for a full .NET code review (use dotnet-code-review) or implementation-only endpoint work.
---

# API Contract Review

## Purpose
Protect API consumers by identifying observable HTTP changes and proposing a compatible evolution path.

## Scope
HTTP methods/routes, request and response schemas, serialization, status/error semantics, pagination, idempotency, OpenAPI, and versioning.

## When to use
- User asks whether an HTTP change is backward-compatible or how to evolve a public/internal API contract.
- Consumer behavior depends on serialization, status codes, or error payload shape.

## Do not use for
- Full code quality/security guideline review: use `dotnet-code-review`.
- Building an endpoint: use `minimal-api-patterns` or `aspnetcore-patterns`.
- gRPC/protobuf schema changes unless HTTP gateway contract is the focus: use `dotnet-code-review` with RPC rules.

## Required context
Identify consumers, API versioning policy, serializer settings, OpenAPI generation, route/method, current and proposed schema, compatibility window, and tests/specs.

## Workflow
1. Compare route, method, request, response, status, headers, error format, and semantics before/after.
2. Inspect required/nullable fields, default values, enum/string/number handling, naming policy, date/decimal formats, and serializer options.
3. Check authorization, validation, idempotency, pagination maximums/cursor order, sorting/filter semantics, and caching headers where changed.
4. Classify consumers and compatibility impact as additive, behaviorally changing, or breaking; do not assume serializer/versioning behavior.
5. Recommend additive transition, explicit versioning, deprecation window, or consumer migration as appropriate.
6. Add contract/integration tests and generated OpenAPI diff for important guarantees.

## Decision rules
- A nullable/optional field may still be incompatible with strict clients; inspect actual consumers and serializer config.
- Removing enum values, changing meanings/statuses, or weakening validation can be breaking even when schema shape is unchanged.
- Do not call a change breaking solely because source declarations changed; establish wire behavior.

## Severity classification
For contract findings, classify as Breaking/Behavior change/Compatible when that vocabulary is useful; if a repo severity scheme exists, use it and describe affected consumers and migration urgency.

## Expected output format
Summarize affected contract surface, compatibility classification, evidence/configuration assumptions, impacted consumers, migration recommendation, and regression contract tests.

## Common mistakes
- Inferring wire shape from C# types alone, ignoring nullability/enum converters, assuming all clients tolerate additive fields, or recommending versioning for every change.

## Edge cases
- OpenAPI output can differ from serializer/runtime behavior; test both when contract fidelity matters.
- `204` vs `200` with empty body and `404` vs `403` can alter client control flow.
- Pagination cursor/order and default sort changes alter semantics without changing schema.

## Examples
See [API contract examples](examples.md) for an enum compatibility change and a stable additive response.

## Test scenarios
- Positive: “Will replacing numeric enum JSON with strings break existing mobile clients?”
- Negative: “Find a race condition inside a background queue” routes to `async-concurrency`.
- Boundary: “Review a Minimal API route change for compatibility” selects this skill and `dotnet-code-review` only when full review is requested.

## Related skills
`dotnet-code-review`, `minimal-api-patterns`, `aspnetcore-patterns`, `testing-quality`, `security-audit`.

Files in this skill

  • SKILL.md3.9 KB
  • examples.md1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.