update-docs
vercel/next.js
このスキルは、ユーザーが「変更内容に合わせてドキュメントを更新してほしい」、「このプルリクエスト(PR)のドキュメントを確認してほしい」、「どのドキュメントを更新する必要があるか」、「ドキュメントとコードを同期してほしい」、「この機能のドキュメントの骨組みを作成してほしい」、「この機能のドキュメントを作成してください」、「ドキュメントの網羅性を確認してください」、「この変更に関するドキュメントを追加してください」、「どのドキュメントが影響を受けますか」、「ドキュメントへの影響」といった要求があった場合、または「docs/」 「docs/01-app」、「docs/02-pages」、「MDX」、「ドキュメントの更新」、「APIリファレンス」、「.mdxファイル」といったキーワードが含まれている場合。 コードの変更に基づいて Next.js のドキュメントを更新するための、ガイド付きのワークフローを提供します。
...すべて拡張しますNext.js ドキュメント更新ツール
アクティブなブランチでのコード変更に基づいて、Next.js のドキュメントを更新する手順を案内します。ドキュメントの完全性を確認するためにプルリクエスト(PR)をレビューするメンテナー向けに設計されています。
クイックスタート
- 変更内容を分析する:
git diff canary...HEAD --statを実行して、変更されたファイルを確認します - 影響を受けるドキュメントの特定:変更されたソースファイルをドキュメントのパスにマッピングします
- 各ドキュメントのレビュー:ユーザーの確認を得ながら更新内容を確認
- 検証:
pnpm lintを実行して書式を確認する - コミット:ドキュメントの変更をステージングする
ワークフロー:コードの変更を分析する
ステップ 1: 差分を取得する
# See all changed files on this branch
git diff canary...HEAD --stat# See changes in specific areas
git diff canary...HEAD -- packages/next/src/
ステップ 2: ドキュメントに関連する変更を特定する
以下の領域で変更点を探します:
ステップ3: ドキュメントファイルへのマッピング
対応するドキュメントファイルを見つけるには、 references/CODE-TO-DOCS-MAPPING.md を使用して、対応するドキュメントファイルを検索します。
マッピング例:
src/client/components/image.tsx→docs/01-app/03-api-reference/02-components/image.mdxsrc/server/config-shared.ts→docs/01-app/03-api-reference/05-config/
ワークフロー:既存のドキュメントを更新する
ステップ1:現在のドキュメントを読む
変更を加える前に、既存のドキュメントを読み、以下の点を把握してください:
- 現在の構成とセクション
- 使用されているフロントマターフィールド
- 以下を使用しているかどうか
/router-specific content
ステップ2:更新が必要な箇所を特定する
一般的な更新内容には以下が含まれます:
- 新しいプロパティ/オプション:propsテーブルに追加し、使用方法を説明するセクションを作成する
- 動作の変更:説明文と例を更新する
- 非推奨機能:非推奨の旨の通知と移行ガイドラインを追加する
- 新しい例:規約に従ってコードブロックを追加する
ステップ3: 確認を経て更新を適用する
変更点ごとに:
- 変更内容をユーザーに提示する
- 編集を行う前に確認を待つ
- 編集を適用する
- 次の変更に進む
ステップ4:共有コンテンツの確認
ドキュメントで source フィールドパターン(Pages Routerのドキュメントで一般的)を使用している場合、編集対象はソースファイルです。例:
# docs/02-pages/... file with shared content
---
source: app/building-your-application/optimizing/images
---
Pages Routerのファイルではなく、App Routerのソースを編集してください。
ステップ5:変更内容の検証
pnpm lint # Check formatting
pnpm prettier-fix # Auto-fix formatting issues
ワークフロー:新機能のドキュメント作成
まったく新しい機能のドキュメントを追加する際にこれを使用してください。
ステップ1:ドキュメントの種類を決定する
ステップ 2: 適切な命名規則に従ってファイルを作成する
- ケバブケースを使用してください:
my-new-feature.mdx - 順序が重要な場合は、数字のプレフィックスを追加してください:
05-my-new-feature.mdx - 機能の種類に応じて適切なディレクトリに配置する
ステップ 3: 適切なテンプレートを使用する
APIリファレンス用テンプレート:
---
title: Feature Name
description: Brief description of what this feature does.
---{/* The content of this doc is shared between the app and pages router. You can use the `Content ` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */}Brief introduction to the feature.## Reference### Props| Prop | Example | Type | Status |
| ----------------------- | ------------------ | ------ | -------- |
| [`propName`](#propname) | `propName="value"` | String | Required |#### `propName`Description of the prop.\`\`\`tsx filename="app/example.tsx" switcher
// TypeScript example
\`\`\`\`\`\`jsx filename="app/example.js" switcher
// JavaScript example
\`\`\`
ガイド用テンプレート:
---
title: How to do X in Next.js
nav_title: X
description: Learn how to implement X in your Next.js application.
---Introduction explaining why this guide is useful.## PrerequisitesWhat the reader needs to know before starting.## Step 1: First StepExplanation and code example.\`\`\`tsx filename="app/example.tsx" switcher
// Code example
\`\`\`## Step 2: Second StepContinue with more steps...## Next StepsRelated topics to explore.
ステップ4: 関連リンクを追加する
関連ドキュメントをフロントマターに追加:
related:
title: Next Steps
description: Learn more about related features.
links:
- app/api-reference/functions/related-function
- app/guides/related-guide
ドキュメントの記述規則
詳細な書式規則については references/DOC-CONVENTIONS.md を参照してください。
クイックリファレンス
フロントマター(必須):
---
title: Page Title (2-3 words)
description: One or two sentences describing the page.
---
コードブロック:
\`\`\`tsx filename="app/page.tsx" switcher
// TypeScript first
\`\`\`\`\`\`jsx filename="app/page.js" switcher
// JavaScript second
\`\`\`
ルーター固有のコンテンツ:
Content only for App Router docs. Content only for Pages Router docs.
注意事項:
> **Good to know**: Single line note.> **Good to know**:
>
> - Multi-line note point 1
> - Multi-line note point 2
検証チェックリスト
ドキュメントの変更をコミットする前に:
- フロントマターには
titleとdescription - コードブロックには
filename属性 - TypeScriptの例では
switcherJS バリアントでは - プロパティテーブルは適切にフォーマットされています
- 関連リンクは有効なパスを指しています
-
pnpm lint合格 - 変更内容が正しくレンダリングされる(プレビューが利用可能な場合)
参考文献
references/DOC-CONVENTIONS.md- フロントマターおよび書式設定ルールの完全な記述references/CODE-TO-DOCS-MAPPING.md- ソースコードとドキュメントの対応関係
Next.js Documentation Updater
Guides you through updating Next.js documentation based on code changes on the active branch. Designed for maintainers reviewing PRs for documentation completeness.
Quick Start
- Analyze changes: Run
git diff canary...HEAD --statto see what files changed - Identify affected docs: Map changed source files to documentation paths
- Review each doc: Walk through updates with user confirmation
- Validate: Run
pnpm lintto check formatting - Commit: Stage documentation changes
Workflow: Analyze Code Changes
Step 1: Get the diff
# See all changed files on this branch
git diff canary...HEAD --stat# See changes in specific areas
git diff canary...HEAD -- packages/next/src/
Step 2: Identify documentation-relevant changes
Look for changes in these areas:
Step 3: Map to documentation files
Use the code-to-docs mapping in references/CODE-TO-DOCS-MAPPING.md to find corresponding documentation files.
Example mappings:
src/client/components/image.tsx→docs/01-app/03-api-reference/02-components/image.mdxsrc/server/config-shared.ts→docs/01-app/03-api-reference/05-config/
Workflow: Update Existing Documentation
Step 1: Read the current documentation
Before making changes, read the existing doc to understand:
- Current structure and sections
- Frontmatter fields in use
- Whether it uses
<AppOnly>/<PagesOnly>for router-specific content
Step 2: Identify what needs updating
Common updates include:
- New props/options: Add to the props table and create a section explaining usage
- Changed behavior: Update descriptions and examples
- Deprecated features: Add deprecation notices and migration guidance
- New examples: Add code blocks following conventions
Step 3: Apply updates with confirmation
For each change:
- Show the user what you plan to change
- Wait for confirmation before editing
- Apply the edit
- Move to the next change
Step 4: Check for shared content
If the doc uses the source field pattern (common for Pages Router docs), the source file is the one to edit. Example:
# docs/02-pages/... file with shared content
---
source: app/building-your-application/optimizing/images
---
Edit the App Router source, not the Pages Router file.
Step 5: Validate changes
pnpm lint # Check formatting
pnpm prettier-fix # Auto-fix formatting issues
Workflow: Scaffold New Feature Documentation
Use this when adding documentation for entirely new features.
Step 1: Determine the doc type
Step 2: Create the file with proper naming
- Use kebab-case:
my-new-feature.mdx - Add numeric prefix if ordering matters:
05-my-new-feature.mdx - Place in the correct directory based on feature type
Step 3: Use the appropriate template
API Reference Template:
---
title: Feature Name
description: Brief description of what this feature does.
---{/* The content of this doc is shared between the app and pages router. You can use the `<PagesOnly>Content</PagesOnly>` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */}Brief introduction to the feature.## Reference### Props<div style={{ overflowX: 'auto', width: '100%' }}>| Prop | Example | Type | Status |
| ----------------------- | ------------------ | ------ | -------- |
| [`propName`](#propname) | `propName="value"` | String | Required |</div>#### `propName`Description of the prop.\`\`\`tsx filename="app/example.tsx" switcher
// TypeScript example
\`\`\`\`\`\`jsx filename="app/example.js" switcher
// JavaScript example
\`\`\`
Guide Template:
---
title: How to do X in Next.js
nav_title: X
description: Learn how to implement X in your Next.js application.
---Introduction explaining why this guide is useful.## PrerequisitesWhat the reader needs to know before starting.## Step 1: First StepExplanation and code example.\`\`\`tsx filename="app/example.tsx" switcher
// Code example
\`\`\`## Step 2: Second StepContinue with more steps...## Next StepsRelated topics to explore.
Step 4: Add related links
Update frontmatter with related documentation:
related:
title: Next Steps
description: Learn more about related features.
links:
- app/api-reference/functions/related-function
- app/guides/related-guide
Documentation Conventions
See references/DOC-CONVENTIONS.md for complete formatting rules.
Quick Reference
Frontmatter (required):
---
title: Page Title (2-3 words)
description: One or two sentences describing the page.
---
Code blocks:
\`\`\`tsx filename="app/page.tsx" switcher
// TypeScript first
\`\`\`\`\`\`jsx filename="app/page.js" switcher
// JavaScript second
\`\`\`
Router-specific content:
<AppOnly>Content only for App Router docs.</AppOnly><PagesOnly>Content only for Pages Router docs.</PagesOnly>
Notes:
> **Good to know**: Single line note.> **Good to know**:
>
> - Multi-line note point 1
> - Multi-line note point 2
Validation Checklist
Before committing documentation changes:
- Frontmatter has
titleanddescription - Code blocks have
filenameattribute - TypeScript examples use
switcherwith JS variant - Props tables are properly formatted
- Related links point to valid paths
-
pnpm lintpasses - Changes render correctly (if preview available)
References
references/DOC-CONVENTIONS.md- Complete frontmatter and formatting rulesreferences/CODE-TO-DOCS-MAPPING.md- Source code to documentation mapping
すべてのファイル
3件のファイルupdate-docsをインストール
スキルファイルをダウンロードし、.claude/skills/ ディレクトリに解凍してください。
ZIPをダウンロードリポジトリをクローンし、スキルファイルをプロジェクトにコピーしてください。
git clone https://github.com/vercel/next.js/tree/canary/.agents/skills/update-docs # Copy the skill folder to .claude/skills/ or .codex/skills/
コピー





家
