write-api-reference
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
- Function (
cookies,fetch,generateStaticParams): signature, params/returns, methods table, examples - Component (
Link,Image,Script): props summary table, individual prop docs, examples - File convention (
page,layout,route): definition, code showing the convention, props, behavior, examples - Directive (
use client,use cache): definition, usage, serialization/boundary rules, reference - Config option (
basePath,images, etc.): definition, config code, behavioral sections
More from vercel/next.js
update-docs
This skill should be used when the user asks to "update documentation for my changes", "check docs for this PR", "what docs need updating", "sync docs with code", "scaffold docs for this feature", "document this feature", "review docs completeness", "add docs for this change", "what documentation is affected", "docs impact", or mentions "docs/", "docs/01-app", "docs/02-pages", "MDX", "documentation update", "API reference", ".mdx files". Provides guided workflow for updating Next.js documentation based on code changes.
2.4Kauthoring-skills
>
982runtime-debug
>
949react-vendoring
>
909flags
>
867dce-edge
>
810