openapi-first
Generate API code, types, validators, mock servers, and client SDKs from a single OpenAPI 3.1 specification.
Skill by MILTONADINA
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/miltonadina-openapi-first
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, design, backend
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/openapi-first
What's inside
- Skill name
openapi-first- Description
- Generate API code, types, validators, mock servers, and client SDKs from a single OpenAPI 3.1 specification. Use whenever building or modifying an HTTP API endpoint. The OpenAPI doc is source of truth - drift between doc and code is a contract violation caught by tests. Triggers on requests involving REST endpoints, API design, or client/server contracts.
- License
- MIT
- Instructions
- 153 lines in SKILL.md · view on GitHub
Files (3)
- SKILL.md
- SKILL.md.bundle
- SKILL.md.sig
SKILL.md (first lines)
# OpenAPI First
> The API contract is the source of truth. Code derives from it, not the other
> way around.
**Tradeoff:** Adds an upfront OpenAPI authoring step. Worth it: free types,
free validators, free client SDKs, free mocks, and contract testing comes for
free.
---
## When to invoke
- New API endpoint requested
- Existing endpoint being modified (request/response shape changes)
- Client SDK needed for an existing API
- Migration from undocumented API to documented
---
## Workflow
1. **Write or update the OpenAPI 3.1 spec** at `openapi/<service>.yml`.
2. **Generate types** for both server and client.
3. **Generate validators** so runtime requests are checked against the schema.
4. **Implement the handler** to satisfy the spec (the test is "the
schema-validator passes against real requests/responses").
5. **Generate the mock server** for frontend development.
6. **Add a contract test** that exercises every operation against the spec.
---
## Recommended tooling (TypeScript)
- **`openapi-typescript`** — type generation
- **`zod-openapi`** or **`@asteasolutions/zod-to-openapi`** — write schemas in
Zod, derive OpenAPI from them
- **`@hono/zod-openapi`** or **`fastify-openapi-glue`** — server framework
integration
- **`orval`** or **`@kubb/swagger-client`** — typed client SDK generation
- **`@stoplight/prism`** — mock server
- **`schemathesis`** or **`dredd`** — contract testing
---
## For Python (FastAPI)
FastAPI generates OpenAPI from typed handlers — the spec is derived from code.
This works in reverse to "OpenAPI first." If you have an existing FastAPI app,
treat its `/openapi.json` output as authoritative and treat the docs export as
the canonical spec for client generation.
---
## For Rust
- **`utoipa`** — Rust code annotations generate OpenAPI
- **`paperclip`** — alternative annotation-based generator
- **`progenitor`** — generate Rust client from OpenAPI
---
## Quality gates
A change is done when all five hold:
1. The OpenAPI spec validates against the OpenAPI 3.1 schema.
2. `spectral lint openapi/<service>.yml` passes with the default ruleset
(extend with `.spectral.yaml` for project rules).
3. Generated types are checked into the repo and re-generated by CI on
schema changes. Drift = build failure.
4. Contract tests run on every PR.
5. `oasdiff` detects breaking changes, and a breaking change requires a major
version bump.
---
## Anti-patterns
**Hand-writing types after the schema**: defeats the purpose. Always generate.
**Schema-after**: writing the handler and then describing it in OpenAPI. Don't.
The schema is the design artifact.
**Optional everywhere**: if a field is always required in practice, mark it
required. Schema laxity becomes runtime errors.
**Missing error responses**: every operation should document 4xx and 5xx
responses with `Problem Details` (RFC 9457) bodies.
**No versioning strategy**: pick header-based (`Accept: application/vnd.api+json;
version=2`) or path-based (`/v2/`) and stick to it.
---
## Worked example
`openapi/auth.yml`:
```yaml
openapi: 3.1.0
info:
title: Auth Service
version: 1.0.0
paths:
/auth/reset:
post:
operationId: requestPasswordReset
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ResetRequest'
responses:
'200':
description: Reset link sent
'422':
description: Invalid email
content:From MILTONADINA/DevOPs, MIT.
More from MILTONADINA/DevOPs
- 0.565score
ears-spec-writing
MILTONADINA
Write requirement specifications in EARS (Easy Approach to Requirements Syntax) notation.
SkillAFreshness: AClaude Code +9 - 0.565score
proof-of-work
MILTONADINA
Produce structured proof artifacts for every completed claim.
SkillAFreshness: AClaude Code +9 - 0.565score
plan-decomposition
MILTONADINA
Break an approved spec into atomic, ordered, verifiable tasks before any code is written.
SkillAFreshness: AClaude Code +9 - 0.565score
multi-tool-failover
MILTONADINA
Manage session continuity when switching between Claude Code, Codex CLI, Cursor, Antigravity, Kiro, or local LLMs (OpenCode, Aider).
SkillAFreshness: AClaude Code +9 - 0.565score
goal-loop
MILTONADINA
Execute the spec-tests-implement-verify cycle for one atomic task at a time.
SkillAFreshness: AClaude Code +9 - 0.565score
baton-handoff
MILTONADINA
Write a complete handoff document at session end so the next agent (Claude Code, Codex, Cursor, Antigravity, Kiro, or local LLM) resumes exactly where this…
SkillAFreshness: AClaude Code +9 - 0.565score
observability-instrument
MILTONADINA
Add OpenTelemetry spans with user_id and tenant_id in baggage to any new code path that handles requests, runs agents, or performs billable operations.
SkillAFreshness: AClaude Code +9 - 0.565score
cost-attribution
MILTONADINA
Track per-client and per-feature LLM and cloud spend with cryptographic audit trail.
SkillAFreshness: AClaude Code +9 - 0.561score
session-summary
MILTONADINA
Generate the end-of-session human-reviewable report.
SkillAFreshness: AClaude Code +9 - 0.561score
coppa-audit
MILTONADINA
Audit code, data flows, and UI for COPPA (Children's Online Privacy Protection Act) compliance.
SkillAFreshness: AClaude Code +9 - 0.560score
supabase-rpc-functions
MILTONADINA
Supabase RPC function security patterns -- SECURITY DEFINER with `SET search_path` discipline, `REVOKE EXECUTE FROM public` for least-privilege exposure…
SkillAFreshness: AClaude Code +9 - 0.560score
rust-error-handling
MILTONADINA
Rust error-handling patterns and anti-patterns -- `unwrap()` in request hot paths, `panic!` instead of returning a `Result`, leaking error internals via…
SkillAFreshness: AClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 12
- Last commit (this folder)
- Oct 12, 2026 (17 days ago)
- Last release
- Sep 23, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/MILTONADINA/DevOPs
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from MILTONADINA
- 0.565score
goal-loop
MILTONADINA
Execute the spec-tests-implement-verify cycle for one atomic task at a time.
SkillAFreshness: AClaude Code +9 - 0.565score
baton-handoff
MILTONADINA
Write a complete handoff document at session end so the next agent (Claude Code, Codex, Cursor, Antigravity, Kiro, or local LLM) resumes exactly where this…
SkillAFreshness: AClaude Code +9 - 0.565score
cost-attribution
MILTONADINA
Track per-client and per-feature LLM and cloud spend with cryptographic audit trail.
SkillAFreshness: AClaude Code +9 - 0.565score
ears-spec-writing
MILTONADINA
Write requirement specifications in EARS (Easy Approach to Requirements Syntax) notation.
SkillAFreshness: AClaude Code +9 - 0.565score
observability-instrument
MILTONADINA
Add OpenTelemetry spans with user_id and tenant_id in baggage to any new code path that handles requests, runs agents, or performs billable operations.
SkillAFreshness: AClaude Code +9 - 0.565score
multi-tool-failover
MILTONADINA
Manage session continuity when switching between Claude Code, Codex CLI, Cursor, Antigravity, Kiro, or local LLMs (OpenCode, Aider).
SkillAFreshness: AClaude Code +9
Cite this page
openapi-first skill. Agent Mart. https://agentmart.dev/skills/miltonadina-openapi-first (last updated 2026-10-24)