authoring-api-spec

Write fully typed API wire contracts with complete error models, auth, and versioning.

1|1|Updated May 24, 2026
One-click install
npx skills add https://github.com/bm629/agent-skills --skill authoring-api-spec-bm629
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: authoring-api-spec
Source: https://github.com/bm629/agent-skills/tree/main/skills/authoring-api-spec
Command: npx skills add https://github.com/bm629/agent-skills --skill authoring-api-spec-bm629

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? API specifications are often written as happy-path outlines with untyped fields, missing error cases, and vague auth, leaving client and server engineers guessing. This Skill guides the authoring of an API wire contract to a bar where a client can call every operation and a server can implement it from the contract alone. ## Core Features & Use Cases - Style-agnostic contract rigor: Renders the contract in the project's own notation — OpenAPI for REST, SDL for GraphQL, proto for gRPC — with every operation fully typed on both request and response sides. - Complete error model and auth: Enforces one consistent error shape (e.g. RFC 9457 Problem Details), enumerates every failure case per operation with status codes and retryability, and requires per-operation authorization scopes. - Versioned amendment workflow: Classifies changes as additive or breaking, routes breaking changes to a new version with a deprecation-to-sunset lifecycle (RFC 8594/9745) and a migration guide. - Use Case: Given an approved feature-spec for an invoicing service, produce an OpenAPI contract where POST /v1/invoices has typed fields, a 201 response with Location header, named 400/401/403/409 error cases, and an OAuth scope requirement. ## Quick Start Use authoring-api-spec to turn the approved feature-spec for the invoicing service into a complete REST API contract with typed schemas, error cases, and auth scopes.

Frequently Asked Questions about authoring-api-spec

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write an API specification from a feature spec?

Start from the approved feature-spec and map each behavior to one or more operations, then fully type every request and response with constraints and status codes. Take the section structure from an api-spec template tool and fill it with typed schemas, a complete error model, and per-operation auth scopes.

What should a complete API error model include?

A complete error model defines one consistent error shape for the whole API, such as RFC 9457 Problem Details for REST, carrying a machine-readable code, a human message, and a request id. Every operation then enumerates its named failure cases with status codes and retryability, not just the happy path.

Does this approach work for GraphQL or gRPC APIs?

Yes, the same rigor applies across styles: GraphQL contracts are rendered in SDL with typed Query, Mutation, and Subscription fields, and gRPC contracts use proto service and rpc definitions with typed messages. Only the notation changes; typed schemas, complete errors, and auth requirements stay identical.

How do I handle a breaking change to an existing API contract?

Classify the change as additive or breaking first; additive changes like new optional fields ship in-version. A breaking change such as a rename or type narrowing requires a new version, a Deprecation-to-Sunset lifecycle per RFC 9745 and RFC 8594, and a published migration guide.

When should I not use this API spec authoring skill?

Do not use it for designing the persistence data-model, writing the consumer-facing API reference documentation, implementing the service, or reviewing a finished spec. Those are separate upstream, downstream, and review concerns handled by other skills.