add-api-endpoint

Create or modify HTTP and RPC endpoints with schema-first contracts and RFC 9457 error handling.

Updated Feb 10, 2026
One-click install
npx skills add https://github.com/vesviet/agent-skills --skill add-api-endpoint-vesviet
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: add-api-endpoint
Source: https://github.com/vesviet/agent-skills/tree/main/core/skills/backend/add-api-endpoint
Command: npx skills add https://github.com/vesviet/agent-skills --skill add-api-endpoint-vesviet

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Adding or evolving service endpoints often leads to schema drift, inconsistent error responses, missing auth checks, and tests that break in isolated environments. This Skill enforces a schema-first workflow so every endpoint is anchored to a validated OpenAPI 3.1 or JSON Schema contract with structured RFC 9457 errors, default-deny authorization, and sandbox-ready tests. ## Core Features & Use Cases - Schema-first contract binding: Author and validate OpenAPI 3.1 or JSON Schema contracts before writing handler code, with runtime boundary validators (Zod, Pydantic, TypeBox) bound strictly to the spec. - RFC 9457 Problem Details errors: Return standardized error envelopes with type, title, status, detail, instance, and invalid_params, while ensuring 5xx responses never leak stack traces or internal paths. - Security and observability wiring: Enforce default-deny auth/authz, idempotency keys, and rate limiting on mutating routes, plus OpenTelemetry spans with trace_id propagation. - Use Case: When adding a new POST /v1/orders endpoint, use this Skill to freeze the API contract, wire Zod boundary validation, add idempotency and rate limiting, and verify the handler passes integration tests inside a Level 0 air-gapped container using MSW v2 stubs. ## Quick Start Use the add-api-endpoint skill to create a new versioned POST endpoint with an OpenAPI contract, boundary validation, RFC 9457 errors, and sandbox-ready tests.

Frequently Asked Questions about add-api-endpoint

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

FAQPage Schema
How do I add a new API endpoint with schema-first validation?▼

Author and validate an OpenAPI 3.1 or JSON Schema contract before writing handler code, then bind runtime boundary validators like Zod, Pydantic, or TypeBox strictly to that spec. The handler must reject any payload that deviates from the frozen contract.

What is RFC 9457 Problem Details error handling?▼

RFC 9457 is the standard for structured HTTP API error responses containing type, title, status, detail, and instance fields, plus extensions like invalid_params. It replaces ad-hoc error envelopes and requires 5xx responses to never expose stack traces, SQL fragments, or internal paths.

How do I test API endpoints without network access?▼

Run integration tests inside a Level 0 air-gapped container with --network=none and intercept all external HTTP calls using MSW v2 mock handlers. Endpoints must not depend on ambient cloud credentials or live external services during testing.

Which boundary validation library should I use: Zod, Pydantic, or TypeBox?▼

Zod and TypeBox fit TypeScript stacks, with TypeBox aligning closely to JSON Schema, while Pydantic is the standard for Python services. All three must bind strictly to the OpenAPI or JSON Schema contract with zero deviation from the spec.

Why do mutating endpoints need idempotency keys and rate limiting?▼

State-mutating routes (POST, PUT, PATCH, DELETE) require an Idempotency-Key header so retried requests do not create duplicate side effects, and rate limiting to prevent abuse. Both are enforced as middleware on every non-public mutating endpoint.

Can I introduce breaking changes to an existing API endpoint?▼

Breaking changes are prohibited without a deprecation cycle. Preserve API versioning namespaces such as /v1/ and /v2/, and evolve request and response shapes only in backward-compatible ways within the existing version.