вариант

update-docs

vercel/next.js vercel/next.js

Этот навык следует использовать, когда пользователь просит «обновить документацию с учетом моих изменений», «проверить документацию для этого PR», «какую документацию нужно обновить», «синхронизировать документацию с кодом», «создать шаблон документации для этой функции», «описать эту функцию», «проверить полноту документации», «добавить документацию для этого изменения», «какая документация затронута», «влияние на документацию» или упоминает «docs/», «docs/01-app», «docs/02-pages», «MDX», «обновление документации», «справочник API», «файлы .mdx». Обеспечивает пошаговый рабочий процесс обновления документации Next.js на основе изменений в коде.

...Расширить все
32
Обновлено время 3 августа 2026 г.

Программа для обновления документации Next.js

Помогает обновлять документацию Next.js на основе изменений в коде в активной ветке. Предназначено для сопровождающих, проверяющих PR на полноту документации.

Быстрый старт

  1. Анализ изменений: запустите команду git diff canary...HEAD --stat , чтобы увидеть, какие файлы изменились
  2. Определение затронутых документов: сопоставьте изменившиеся исходные файлы с путями в документации
  3. Проверьте каждый документ: просмотрите обновления с подтверждением пользователя
  4. Проверка: запустите pnpm lint для проверки форматирования
  5. Фиксация: добавление изменений в документацию в стадию подготовки

Рабочий процесс: анализ изменений в коде

Шаг 1: Получить 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/

Шаг 2: Определить изменения, относящиеся к документации

Ищите изменения в следующих областях:

Шаг 3: Сопоставить с файлами документации

Используйте сопоставление «код-документация» в references/CODE-TO-DOCS-MAPPING.md , чтобы найти соответствующие файлы документации.

Примеры сопоставлений:

  • src/client/components/image.tsx → docs/01-app/03-api-reference/02-components/image.mdx
  • src/server/config-shared.ts → docs/01-app/03-api-reference/05-config/

Рабочий процесс: обновление существующей документации

Шаг 1: Ознакомьтесь с текущей документацией

Перед внесением изменений ознакомьтесь с существующей документацией, чтобы понять:

  • Текущую структуру и разделы
  • Используемые поля в предваряющей части
  • Используются ли / для контента, специфичного для маршрутизатора

Шаг 2: Определите, что необходимо обновить

К типичным обновлениям относятся:

  • Новые свойства/параметры: добавьте их в таблицу свойств и создайте раздел с объяснением использования
  • Изменение поведения: обновите описания и примеры
  • Устаревшие функции: добавьте уведомления об устаревании и рекомендации по миграции
  • Новые примеры: добавьте блоки кода в соответствии с соглашениями

Шаг 3: Применение обновлений с подтверждением

Для каждого изменения:

  1. Покажите пользователю, что вы планируете изменить
  2. Дождитесь подтверждения перед редактированием
  3. Примените изменения
  4. Перейдите к следующему изменению

Шаг 4: Проверьте наличие общего контента

Если в документе используется source шаблон поля (часто встречается в документах по маршрутизатору страниц), редактировать нужно исходный файл. Пример:

# docs/02-pages/... file with shared content
---
source: app/building-your-application/optimizing/images
---

Редактируйте исходный файл маршрутизатора приложений, а не файл маршрутизатора страниц.

Шаг 5: Проверка изменений

pnpm lint          # Check formatting
pnpm prettier-fix  # Auto-fix formatting issues

Рабочий процесс: создание каркаса документации по новой функции

Используйте этот шаблон при добавлении документации для совершенно новых функций.

Шаг 1: Определите тип документации

Шаг 2: Создайте файл с правильным именем

  • Используйте формат «kebab-case»: 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

Контрольный список для проверки

Перед фиксацией изменений в документации:

  • В разделе «Frontmatter» есть title и description
  • Блоки кода имеют filename атрибут
  • В примерах TypeScript используется switcher с вариантом JS
  • Таблицы пропсов имеют правильный формат
  • Ссылки указывают на действительные пути
  • pnpm lint проходит
  • Изменения отображаются правильно (если доступен предварительный просмотр)

Ссылки

  • references/DOC-CONVENTIONS.md - Полные правила оформления вступительной части и форматирования
  • references/CODE-TO-DOCS-MAPPING.md - Сопоставление исходного кода с документацией
Посмотреть на GitHub

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

  1. Analyze changes: Run git diff canary...HEAD --stat to see what files changed
  2. Identify affected docs: Map changed source files to documentation paths
  3. Review each doc: Walk through updates with user confirmation
  4. Validate: Run pnpm lint to check formatting
  5. 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.mdx
  • src/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:

  1. Show the user what you plan to change
  2. Wait for confirmation before editing
  3. Apply the edit
  4. 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 title and description
  • Code blocks have filename attribute
  • TypeScript examples use switcher with JS variant
  • Props tables are properly formatted
  • Related links point to valid paths
  • pnpm lint passes
  • Changes render correctly (if preview available)

References

  • references/DOC-CONVENTIONS.md - Complete frontmatter and formatting rules
  • references/CODE-TO-DOCS-MAPPING.md - Source code to documentation mapping

Установить 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/

Копировать Копировать
Быстрая настройка: Скопируйте папку со скиллом в каталог .claude/skills/ — Claude автоматически обнаружит и начнет использовать этот скилл
Репозиторий vercel/next.js

Похожие навыки

agentwallet
Обновлено время 7 июля 2026 г.
brightdata-cli
Обновлено время 29 июня 2026 г.
humanize
Обновлено время 7 июля 2026 г.
trello
Обновлено время 1 июля 2026 г.
OR