Skip to content
Back to skills

Rust Api Contract

ASecurity

Observable contract. Use when a REST or OpenAPI change can alter status, body shape, error code, security, or client compatibility.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 15, 2026
developmentrustapisecuritydocumentation

Works with

  • cli
  • api

Security analysis

A100/100

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

Scanned November 20, 2026

npx -y skills add Dankosik/rust-service-template-rest --skill rust-api-contract --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rust Api Contract?

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

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

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: rust-api-contract
description: "Observable contract. Use when a REST or OpenAPI change can alter status, body shape, error code, security, or client compatibility."
---

# Rust API Contract

**Observable contract.** Identify every client-visible distinction—success and failure status, body shape or absence, media type, headers, defaults, security, ordering, and retry outcome—and trace the change through both runtime execution and the published OpenAPI document.

**Code-first authority.** Keep `utoipa` annotations and types composed in `crates/service/src/api.rs` as the single source of truth, regenerate `api/openapi/service.yaml` with `just openapi-generate`, and inspect the schema diff alongside the drift test. Align operation and schema doc comments with actual served behavior because they ship as product documentation.

**Security declarations.** Evaluate security across inherited defaults and explicit route overrides, verifying both the OpenAPI scheme and the runtime enforcement path under the active authentication profile. Preserve intentionally public operations and route unsupported or ambiguous auth combinations through the existing finalizer.

**Pre-handler and handler errors.** Trace rejections across extractors, admission, authentication, timeouts, fallbacks, and streaming as well as handler `Result` paths. Keep status, Problem media type, schema, stable code, field omission versus `null`, and sanitized details aligned between `crates/service-failure` and `crates/infra-http`, documenting every reachable changed outcome.

**Compatibility and evidence.** Judge breaking risk from consumer impact—remembering that new response variants can break exhaustive clients—while preserving ordering, defaults, absence semantics, and idempotency replay rules. Validate compatibility through the repository's breaking-change checker (recording any approved exception with its owner and removal condition), keep the API surface scoped to consumer needs, and report schema checks separately from runtime and consumer proof.

Files in this skill

  • LICENSE1 KB
  • SKILL.md2.8 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 development →

Comments

Loading comments…

Newsletter

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