Agent skill · writing content · vercel

write-api-reference

Produces API reference documentation for Next.js APIs: functions, components, file conventions, directives, and config options. **Auto-activation:** User asks to write, create, or draft an API reference page. Also triggers on paths like `docs/01-app/03-api-reference/`, or keywords like "API reference", "props", "parameters", "returns", "signature". **Input sources:** Next.js source code, existing API reference pages, or user-provided specifications. **Output type:** A markdown (.mdx) API reference page with YAML frontmatter, usage example, reference section, behavior notes, and examples.

Why this skill is useful

Provides a structured template and guidelines for generating API reference documentation specific to Next.js, which the AI wouldn't reliably create on its own.

What it needs

About 5k tokens when loaded. Last updated 2026-08-07. 141,663 stars on the source repository.

What this skill does

Writing API Reference Pages Goal Produce an API reference page that documents a single API surface (function, component, file convention, directive, or config option). The page should be concise, scannable, and example-driven. Each page documents one API. If the API has sub-methods (like cookies.set()), document them on the same page. If two APIs are independent, they get separate pages. Structure Identify which category the API belongs to, then follow the corresponding template. Categories 1. Function (cookies, fetch, generateStaticParams): signature, params/returns, methods table, examples 2. Component (Link, Image, Script): props summary table, individual prop docs, examples 3. File convention (page, layout, route): definition, code showing the convention, props, behavior, examples 4. Directive (use client, use cache): definition, usage, serialization/boundary rules, reference 5. Config option (basePath, images, etc.): definition, config code, behavioral sections Template tsx filename="path/to/file.tsx" switcher // Minimal working usage jsx filename="path/to/file.js" switcher // Same example in JS tsx filename="path/to/file.tsx" switcher // Complete working example jsx filename="path/to/file.js" switcher // Same example in JS Category-specific notes: Functions: Lead with the function signature and await if async. Document methods in a table if the return value has methods (like cookies). Document options in a separate table if applicable. Components: Start with a props summary table ( Prop Example Type Required ). Then document each prop under #### propName with description, code example, and value table where useful. File conventions: Show the default export signature with TypeScript types. Document each prop (params, searchParams, etc.) under #### propName with a route/URL/value example table. Directives: No ## Reference section. Use ## Usage instead, showing correct placement. Document serialization constraints and boundary rules. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills vercel/write-api-reference

View the source on GitHub

Browse the @skills marketplace