Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
4f0d78cb
Unverified
Commit
4f0d78cb
authored
Jan 09, 2026
by
Tim Neutkens
Committed by
GitHub
Jan 09, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agent.md: Explain where the Next.js core code lives (#88314)
## What? Explain in agent.md where the Next.js core code lives.
parent
a5f8baf4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
11 deletions
+49
-11
AGENTS.md
AGENTS.md
+49
-11
No files found.
AGENTS.md
View file @
4f0d78cb
# Next.js Development Guide
# Next.js Development Guide
## Codebase structure
### Monorepo Overview
This is a pnpm monorepo containing the Next.js framework and related packages.
```
next.js/
├── packages/ # Published npm packages
├── turbopack/ # Turbopack bundler (Rust) - git subtree
├── crates/ # Rust crates for Next.js SWC bindings
├── test/ # All test suites
├── examples/ # Example Next.js applications
├── docs/ # Documentation
└── scripts/ # Build and maintenance scripts
```
### Core Package: `packages/next`
The main Next.js framework lives in
`packages/next/`
. This is what gets published as the
`next`
npm package.
**Source code**
is in
`packages/next/src/`
.
**Key entry points:**
-
Dev server:
`src/cli/next-dev.ts`
→
`src/server/dev/next-dev-server.ts`
-
Production server:
`src/cli/next-start.ts`
→
`src/server/next-server.ts`
-
Build:
`src/cli/next-build.ts`
→
`src/build/index.ts`
**Compiled output**
goes to
`packages/next/dist/`
(mirrors src/ structure).
### Other Important Packages
-
`packages/create-next-app/`
- The
`create-next-app`
CLI tool
-
`packages/next-swc/`
- Native Rust bindings (SWC transforms)
-
`packages/eslint-plugin-next/`
- ESLint rules for Next.js
-
`packages/font/`
-
`next/font`
implementation
-
`packages/third-parties/`
- Third-party script integrations
## Git Workflow
## Git Workflow
**Use Graphite for all git operations**
instead of raw git commands:
**Use Graphite for all git operations**
instead of raw git commands:
...
@@ -221,19 +260,18 @@ pnpm test-dev-turbo test/path/to/test.ts
...
@@ -221,19 +260,18 @@ pnpm test-dev-turbo test/path/to/test.ts
pnpm test-start-turbo test/path/to/test.ts
pnpm test-start-turbo test/path/to/test.ts
```
```
## Key Directories
## Key Directories (Quick Reference)
See
[
Codebase structure
](
#codebase-structure
)
above for detailed explanations.
-
`packages/next/src/`
- Main Next.js source code
-
`packages/next/src/`
- Main Next.js source code
-
`server/`
- Server runtime (dev server, router, rendering)
-
`packages/next/src/server/`
- Server runtime (most changes happen here)
-
`client/`
- Client-side code
-
`packages/next/src/client/`
- Client-side runtime
-
`build/`
- Build tooling (webpack, turbopack configs)
-
`packages/next/src/build/`
- Build tooling
-
`cli/`
- CLI entry points
-
`test/e2e/`
- End-to-end tests
-
`packages/next/dist/`
- Compiled output
-
`test/development/`
- Dev server tests
-
`turbopack/`
- Turbopack bundler (Rust)
-
`test/production/`
- Production build tests
-
`test/`
- Test suites
-
`test/unit/`
- Unit tests (fast, no browser)
-
`development/`
- Dev server tests
-
`production/`
- Production build tests
-
`e2e/`
- End-to-end tests
## Development Tips
## Development Tips
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment