mern-api-docs

Generate OpenAPI 3.0 specs from Zod schemas and Next.js API routes.

3|1|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/edfenton/claude-skills --skill mern-api-docs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mern-api-docs
Source: https://github.com/edfenton/claude-skills/tree/main/mern/mern-api-docs
Command: npx skills add https://github.com/edfenton/claude-skills --skill mern-api-docs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

OpenAPI documentation generation for MERN-like projects by extracting endpoints from Next.js routes and schemas from Zod definitions.

Core Features & Use Cases

  • Auto-discovers API routes and Zod schemas to produce a single OpenAPI 3.0 document that documents requests, responses, and parameters.
  • Supports serving a Swagger UI at /api/docs for interactive exploration.
  • Suitable for CI pipelines by exporting to openapi.json for versioned API docs.

Quick Start

Point your project at the codebase and run the skill to generate and expose the OpenAPI docs.

Frequently Asked Questions about mern-api-docs

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

FAQPage Schema
How do I auto-generate OpenAPI documentation from Zod schemas in Next.js?

You can auto-generate OpenAPI documentation by extracting endpoints from Zod schemas and Next.js API routes to produce an OpenAPI 3.0 spec file, a Swagger UI at /api/docs, and an optional openapi.json export.

Can I serve a Swagger UI route for interactive API exploration in a MERN-like stack?

Yes, you can serve a Swagger UI route at /api/docs for interactive exploration, which is automatically generated by extracting endpoints and schemas from your Next.js API routes and Zod definitions.

Does this approach extract request bodies, responses, and path/query parameters from Zod definitions?

Yes, extracting endpoints from Zod schemas and Next.js API routes auto-documents REST APIs by capturing request bodies, responses, and path/query parameters into a single OpenAPI 3.0 document.

What is the best way to export versioned API docs for CI pipelines using Next.js and Zod?

The best way to export versioned API docs is to run an export script that generates an openapi.json file from your Zod schemas and Next.js API routes, suitable for integration into CI pipelines.

Do I need Zod and Next.js to auto-document REST APIs with this approach?

Yes, this approach applies to MERN-like stacks and requires using Zod for schema definitions and Next.js for API routes to successfully auto-discover and generate the OpenAPI documentation.