references/CODE-TO-DOCS-MAPPING.md
references/CODE-TO-DOCS-MAPPING.mdBrowse 3 files
1,665 tokens
7,694 bytes
Token encoding: o200k_base
Snapshot bfcf687
← Back to SKILL.md
Code to Documentation Mapping
Maps Next.js source code directories to their corresponding documentation files.
Core Mappings
Components
| Source Path | Documentation Path |
|---|---|
packages/next/src/client/components/image.tsx | docs/01-app/03-api-reference/02-components/image.mdx |
packages/next/src/client/components/link.tsx | docs/01-app/03-api-reference/02-components/link.mdx |
packages/next/src/client/components/script.tsx | docs/01-app/03-api-reference/02-components/script.mdx |
packages/next/src/client/components/form.tsx | docs/01-app/03-api-reference/02-components/form.mdx |
Functions
| Source Path | Documentation Path |
|---|---|
packages/next/src/server/request/ | docs/01-app/03-api-reference/04-functions/ |
packages/next/src/server/lib/metadata/ | docs/01-app/03-api-reference/04-functions/generate-metadata.mdx |
packages/next/src/client/components/navigation.tsx | docs/01-app/03-api-reference/04-functions/use-router.mdx |
packages/next/src/client/components/navigation.tsx | docs/01-app/03-api-reference/04-functions/use-pathname.mdx |
packages/next/src/client/components/navigation.tsx | docs/01-app/03-api-reference/04-functions/use-search-params.mdx |
File Conventions
| Source Path | Documentation Path |
|---|---|
packages/next/src/build/webpack/loaders/ | docs/01-app/03-api-reference/03-file-conventions/ |
packages/next/src/server/app-render/ | docs/01-app/03-api-reference/03-file-conventions/layout.mdx |
packages/next/src/server/app-render/ | docs/01-app/03-api-reference/03-file-conventions/page.mdx |
Configuration
| Source Path | Documentation Path |
|---|---|
packages/next/src/server/config-shared.ts | docs/01-app/03-api-reference/05-config/01-next-config-js/ |
packages/next/src/server/config.ts | docs/01-app/03-api-reference/05-config/01-next-config-js/ |
packages/next/src/build/webpack-config.ts | docs/01-app/03-api-reference/05-config/01-next-config-js/ |
Directives
| Source Path | Documentation Path |
|---|---|
packages/next/src/server/use-cache/ | docs/01-app/03-api-reference/01-directives/use-cache.mdx |
packages/next/src/client/use-client.ts | docs/01-app/03-api-reference/01-directives/use-client.mdx |
packages/next/src/server/use-server.ts | docs/01-app/03-api-reference/01-directives/use-server.mdx |
Metadata File Conventions
| Source Path | Documentation Path |
|---|---|
packages/next/src/lib/metadata/ | docs/01-app/03-api-reference/03-file-conventions/01-metadata/ |
| Metadata icons handling | docs/01-app/03-api-reference/03-file-conventions/01-metadata/app-icons.mdx |
| Open Graph images | docs/01-app/03-api-reference/03-file-conventions/01-metadata/opengraph-image.mdx |
| Sitemap generation | docs/01-app/03-api-reference/03-file-conventions/01-metadata/sitemap.mdx |
Directory Pattern Mappings
By Feature Area
| Source Directory | Documentation Area | Notes |
|---|---|---|
packages/next/src/client/ | docs/01-app/03-api-reference/02-components/ | Client-side components |
packages/next/src/server/ | docs/01-app/03-api-reference/04-functions/ | Server functions |
packages/next/src/build/ | docs/01-app/03-api-reference/05-config/ | Build configuration |
packages/next/src/shared/lib/router/ | docs/01-app/02-guides/ | Routing guides |
packages/next/src/lib/metadata/ | docs/01-app/02-guides/metadata/ | Metadata guides |
CLI Commands
| Source Path | Documentation Path |
|---|---|
packages/next/src/cli/next-dev.ts | docs/01-app/03-api-reference/06-cli/next-dev.mdx |
packages/next/src/cli/next-build.ts | docs/01-app/03-api-reference/06-cli/next-build.mdx |
packages/next/src/cli/next-start.ts | docs/01-app/03-api-reference/06-cli/next-start.mdx |
Finding Related Documentation
Step 1: Identify the changed export
Look at what's exported from the changed file:
- Public API exports → API Reference docs
- Internal utilities → Usually no docs needed
- Configuration types → Config docs
Step 2: Search for existing docs
Use Claude's built-in tools for searching:
- Find docs mentioning a term: Use the Grep tool with the pattern and
docs/as the path - List docs in a directory: Use the Glob tool with pattern like
docs/01-app/03-api-reference/04-functions/*.mdx
Step 3: Check for shared content
If editing App Router docs, check if Pages Router has a corresponding file with source field:
- Find source references: Use the Grep tool with pattern
source: app/api-referenceindocs/02-pages/
Common Patterns
New API Function
- Export added to
packages/next/src/server/ - Create doc at
docs/01-app/03-api-reference/04-functions/function-name.mdx - Update index/listing pages if applicable
New Component Prop
- Prop added to component in
packages/next/src/client/components/ - Update the props table in corresponding doc
- Add a section explaining the new prop with examples
New Config Option
- Option added to
packages/next/src/server/config-shared.ts - Find the relevant config doc in
docs/01-app/03-api-reference/05-config/01-next-config-js/ - Add the option with description and example
Behavioral Change
- Logic changed in any source file
- Find all docs that describe this behavior
- Update descriptions and examples to match new behavior
- Add migration notes if breaking change
Quick Search Commands
Use Claude's built-in tools for efficient searching:
- Find all docs mentioning a term: Use the Grep tool with your search pattern and
docs/as the path, filtering to*.mdxfiles - List all API reference docs: Use the Glob tool with pattern
docs/01-app/03-api-reference/**/*.mdx - Find docs by filename pattern: Use the Glob tool with pattern like
docs/**/*image*.mdx - Read a doc's frontmatter: Use the Read tool with a line limit to check the
sourcefield
Referenced from SKILL.md
SKILL.mdView in source ↗
Source excerpt starting at line 46.SKILL.mdView in source ↗46Use the code-to-docs mapping in `references/CODE-TO-DOCS-MAPPING.md` to find corresponding documentation files.
Source excerpt starting at line 265.265- `references/DOC-CONVENTIONS.md` - Complete frontmatter and formatting rules266- `references/CODE-TO-DOCS-MAPPING.md` - Source code to documentation mapping