api-first-design

Enforce contract-first API design using OpenAPI specs for NestJS, Next.js, and Expo projects.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/monicajeon28/GMcruise --skill api-first-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-first-design
Source: https://github.com/monicajeon28/GMcruise/tree/main/.claude/skills/api-first-design
Command: npx skills add https://github.com/monicajeon28/GMcruise --skill api-first-design

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

API 설계에서 스펙 우선 접근이 필요하며, 계약-우선 원칙에 따라 엔드포인트, DTO, 오류 코드, 응답 포맷을 표준화하고 자동화합니다.

Core Features & Use Cases

  • Contract-First 원칙 채택 및 스펙 중심 개발
  • OpenAPI/Swagger 기반 API 설계, DTO/응답 포맷 자동 생성
  • 표준 응답 포맷, 에러 코드 체계, 버전 관리 가이드

Quick Start

OpenAPI 스펙 정의 → 프런트엔드/백엔드 간 타입 생성 → 컨트롤러/DTO 구현

Frequently Asked Questions about api-first-design

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

FAQPage Schema
How do I prevent API drift between backend and frontend in a monorepo?

Contract-first API design enforces a single source of truth using OpenAPI specs. Define endpoints, DTOs, and response formats upfront in Swagger, then auto-generate types across NestJS backend, Next.js frontend, and Expo mobile clients to keep contracts synchronized and eliminate misalignment.

What's the best way to standardize API responses and error codes across teams?

Establish standardized response formats and error code mappings in your OpenAPI specification before implementation. Document these contracts centrally so backend, frontend, and mobile teams follow the same structure, reducing integration bugs and simplifying error handling across the monorepo.

Can I auto-generate TypeScript types from OpenAPI specs in a NestJS and Next.js project?

Yes. Tools like Orval read your OpenAPI specification and generate TypeScript DTOs, types, and client code automatically. This ensures frontend and backend types stay in sync without manual duplication, eliminating type inconsistencies in NestJS and Next.js environments.

How do I implement API versioning with OpenAPI and contract-first design?

Version your OpenAPI specification explicitly and include version identifiers in endpoint paths or response headers. Document breaking changes in the spec upfront so all teams—backend, frontend, and mobile—prepare migrations before deployment, reducing surprise integrations.

Why should I use Swagger-driven development instead of writing code first?

Spec-first development catches design issues before coding, prevents API drift, and generates accurate documentation automatically. It forces alignment between teams on contracts, reduces rework, and enables faster type generation with tools like Orval compared to reverse-engineering types from implemented code.