AI Agent Hub
Back to skills
Next.js Documentation Updater icon

Next.js Documentation Updater

Knowledge Management Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Follow https://skillhub.cn/install/skillhub.md to install @user_e40a4360/documentation-updater.

About this skill

Problem Context

In the Next.js repository, code changes often ripple into API references, configuration pages, and guides. Maintainers reviewing PRs need to determine which docs are affected, whether a page is Pages Router shared content, and where new feature documentation should live. This skill turns that “diff-to-documentation” path into a repeatable workflow.

How It Works

  • It starts with git diff canary...HEAD --stat to inspect changed files, then maps them to docs using references/CODE-TO-DOCS-MAPPING.md and directories such as docs/01-app/03-api-reference/.
  • For existing docs, it reads the current structure, frontmatter, and router-specific content, then identifies new props, behavior changes, deprecations, and missing examples. Each proposed edit is confirmed before being applied.
  • For new features, it selects the right doc type—component, function, config, guide, or file convention—uses kebab-case naming, applies the API Reference or Guide template, and adds related frontmatter links.
  • It validates frontmatter, code block filenames, TypeScript/JavaScript switchers, props tables, and related links, and runs pnpm lint.

Scope and Caveats

This skill is aimed at Next.js documentation maintenance, especially App Router pages and shared Pages Router content. It relies on repository references such as references/DOC-CONVENTIONS.md and the code-to-docs mapping; if those files are incomplete, the output will depend on existing doc structure. It asks for confirmation before edits but still requires human judgment for API semantics and migration guidance.

Use Cases

  • When reviewing a component PR, update the component API reference after image.tsx props change.
  • When a config PR changes shared config code, update the matching App Router config documentation.
  • When adding a new function, scaffold an API reference with frontmatter, examples, and related links.
  • Before committing docs, validate frontmatter, code block filenames, TS/JS switchers, and pnpm lint.

Best For

  • Next.js documentation maintainers reviewing PRs need to identify affected API pages.
  • App Router component engineers updating props references need to add tables and examples.
  • Feature authors onboarding new APIs need to scaffold correctly formatted docs.
  • Contributors handling shared Pages Router content need to edit the right source file.