next.js / turbopack
AGENTS.md144k starsChanged 7 months agoMITView on GitHub
Turbopack is a general-purpose bundler that is built and designed for Next.js, but is not necessarily Next.js-specific. Keep Next.js concepts out of it. These apply to all Rust code in this directory tree. For building, testing, snapshot updates, and benchmarking, use $rust-turbopack. These rules apply throughout this directory tree when developing with turbo_tasks:
Trending
Less talk lately.about the whole repository
Who's talking about vercel/next.js
- A Hacker News story“RCE Vulnerability in React and Next.js”Hacker News · Dec 3, 2025 · 628 points
- getsentry/sentry-javascript“Next.js Turbopack Support”GitHub · May 11, 2023 · 365 reactions
- react/react“eslint-plugin-react-hooks & "Flat Config" (ESLint 9)”GitHub · Feb 13, 2024 · 296 reactions
- sveltejs/kit“Add incremental static regeneration”GitHub · Mar 25, 2021 · 183 reactions
- payloadcms/payload“feat: next.js 16 support”GitHub · Nov 3, 2025 · 163 reactions
The biggest 5 of 92 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 92
Talked about on Bluesky, GitHub and Hacker News (92 times).
On Bluesky · 50
- Jan 17, 2025📦 vercel / next.js ⭐ 128,623 (+39) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social6 likes and reposts
- Apr 27, 2025📦 vercel / next.js ⭐ 131,376 (+38) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social5 likes and reposts
- Dec 2, 2024📦 vercel / next.js ⭐ 127,482 (+35) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social5 likes and reposts
- Oct 8, 2026You can also follow security advisories through GitHub or a dependency monitoring service. On the Next.js repository, choose Watch → Custom… — @nextjs.org4 likes and reposts
- Jun 4, 2026📦 vercel / next.js ⭐ 139,667 (+32) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social4 likes and reposts
45 more on Bluesky
- Jan 12, 2025📦 vercel / next.js ⭐ 128,495 (+43) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social4 likes and reposts
- Nov 15, 2024📦 vercel / next.js ⭐ 127,010 (+42) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social4 likes and reposts
- May 17, 2025📦 vercel / next.js ⭐ 131,846 (+36) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social3 likes and reposts · 1 reply
- Apr 2, 2025📦 vercel / next.js ⭐ 130,747 (+38) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social3 likes and reposts
- Mar 22, 2025📦 vercel / next.js ⭐ 130,452 (+45) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social3 likes and reposts
- Jan 8, 2025📦 vercel / next.js ⭐ 128,373 (+39) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social3 likes and reposts
- Sep 14, 2024📦 vercel / next.js ⭐ 124,905 (+46) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social3 likes and reposts
- Oct 23, 2026📦 vercel / next.js ⭐ 143,195 (+78) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Sep 26, 2026📦 vercel / next.js ⭐ 142,463 (+31) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Sep 17, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 vercel / next.js ⭐ 142,336 (+129) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Aug 4, 2026📦 vercel / next.js ⭐ 141,327 (+45) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Jul 30, 2026📦 vercel / next.js ⭐ 141,186 (+43) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Jul 4, 2026📦 vercel / next.js ⭐ 140,320 (+54) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Jun 29, 2026📦 vercel / next.js ⭐ 140,437 (+36) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Jun 24, 2026📦 vercel / next.js ⭐ 140,207 (+94) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Jun 17, 2026📦 vercel / next.js ⭐ 140,037 (+34) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Dec 14, 2025📦 vercel / next.js ⭐ 136,507 (+34) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Dec 4, 2025📦 vercel / next.js ⭐ 136,067 (+71) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Nov 8, 2025📦 vercel / next.js ⭐ 135,508 (+32) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Sep 16, 2025📦 vercel / next.js ⭐ 134,471 (+46) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Jun 13, 2025📦 vercel / next.js ⭐ 132,413 (+32) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- May 10, 2025📦 vercel / next.js ⭐ 131,707 (+35) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Apr 16, 2025📦 vercel / next.js ⭐ 131,086 (+41) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Mar 18, 2025📦 vercel / next.js ⭐ 130,300 (+50) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Mar 14, 2025📦 vercel / next.js ⭐ 130,174 (+37) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Feb 23, 2025📦 vercel / next.js ⭐ 129,609 (+43) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Feb 14, 2025📦 vercel / next.js ⭐ 129,307 (+47) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Feb 1, 2025📦 vercel / next.js ⭐ 128,951 (+38) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Dec 24, 2024📦 vercel / next.js ⭐ 128,052 (+37) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Dec 20, 2024📦 vercel / next.js ⭐ 127,957 (+39) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Dec 12, 2024📦 vercel / next.js ⭐ 127,744 (+34) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Dec 7, 2024📦 vercel / next.js ⭐ 127,618 (+32) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Oct 15, 2024📦 vercel / next.js ⭐ 125,776 (+44) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Sep 6, 2024📦 vercel / next.js ⭐ 124,675 (+50) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts
- Aug 31, 2024📦 vercel / next.js ⭐ 124,487 (+39) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social2 likes and reposts · 1 reply
- Nov 19, 2026📦 vercel / next.js ⭐ 143,721 (+68) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social1 likes and repost
- Oct 7, 2026📦 vercel / next.js ⭐ 143,230 (+38) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social1 likes and repost
- Sep 26, 2026📦 vercel / next.js ⭐ 142,463 (+31) 🗒 JavaScript The React Framework — @github-trending.bsky.social1 likes and repost
- Aug 27, 2026📦 vercel / next.js ⭐ 141,963 (+38) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social1 likes and repost
- Jul 10, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 vercel / next.js ⭐ 140,578 (+176) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social1 likes and repost
- May 13, 2026📦 vercel / next.js ⭐ 139,406 (+31) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social1 likes and repost
- Apr 10, 2026📦 vercel / next.js ⭐ 138,815 (+63) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social1 likes and repost
- Apr 5, 2026📦 vercel / next.js ⭐ 138,637 (+41) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social1 likes and repost
- Mar 28, 2026📦 vercel / next.js ⭐ 138,508 (+38) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social1 likes and repost
- Mar 22, 2026📦 vercel / next.js ⭐ 138,434 (+32) 🗒 JavaScript The React Framework — @github-trending-js.bsky.social1 likes and repost
On GitHub · 26
- May 11, 2023Next.js Turbopack Support — getsentry/sentry-javascript365 reactions · 92 comments
- Feb 13, 2024eslint-plugin-react-hooks & "Flat Config" (ESLint 9) — react/react296 reactions · 108 comments
- Mar 25, 2021Add incremental static regeneration — sveltejs/kit183 reactions · 75 comments
- Nov 3, 2025feat: next.js 16 support — payloadcms/payload163 reactions · 25 comments
- Feb 25, 2021Make initial incremental/watch builds as fast normal builds — microsoft/TypeScript140 reactions · 31 comments
21 more on GitHub
- Oct 19, 2022[system] Support new style engine that generates static CSS files at build time — mui/material-ui96 reactions · 32 comments
- Nov 24, 2023Deprecate `setRequestLocale` in favor of `next/root-params` — amannn/next-intl95 reactions · 45 comments
- Feb 8, 2024📈 Tracking: Flat Config support — eslint/eslint91 reactions · 100 comments
- Jan 22, 2024add next.js app router example — mswjs/examples53 reactions · 61 comments
- May 11, 2023feat(client): esm support draft — prisma/orm35 reactions · 5 comments
- Apr 24, 2023RFC: The Next.js "App Router", React Server Component & "SSR with Suspense" story — apollographql/apollo-client-integrations28 reactions · 8 comments
- Jan 9, 2025feat: Key isolation — 47ng/nuqs24 reactions · 6 comments
- Jan 27, 2022fix(nextjs): TypeError: res.once is not a function — getsentry/sentry-javascript22 reactions · 1 comment
- May 2, 2024fix(next-auth): Add support for Next.js basePath configuration — nextauthjs/next-auth18 reactions · 27 comments
- Mar 9, 2024[labs/nextjs, labs/ssr-react, lit/react] Add support for Next.js v14 and App Router — lit/lit18 reactions · 3 comments
- Apr 16, 2021update Next.js example — bugsnag/bugsnag-js18 reactions · 3 comments
- Mar 20, 2026feat(next): prevent admin panel errors when cacheComponents is enabled — payloadcms/payload17 reactions · 11 comments
- Sep 7, 2020Modernize example for nextjs. Adds support for fast refresh, native p… — tailwindlabs/tailwindcss-setup-examples17 reactions · 4 comments
- Jun 24, 2022fix: don't fallback on rendering the html when the page is not found — serverless-nextjs/serverless-next.js15 reactions · 2 comments
- Mar 6, 2025Fix for next 15.2 and renderHTML should not be called in minimal mode — opennextjs/opennextjs-cloudflare12 reactions · 2 comments
- Dec 20, 2024fix: Deprecate `setRequestLocale` and add blog post on `next/root-params` — amannn/next-intl12 reactions · 13 comments
- Jan 28, 2022fix(nextjs): Unwrap `req` and `res` if necessary when instrumenting server — getsentry/sentry-javascript12 reactions · 5 comments
- Aug 12, 2021fix(nextjs): Next 11.1.0 compatibility — nrwl/nx12 reactions · 13 comments
- Oct 4, 2024Update auth.ts to await `params` in NextJS 15 — auth0/nextjs-auth010 reactions · 2 comments
- Mar 16, 2024Turbopack support for Blitz — blitz-js/blitz10 reactions · 12 comments
- Jan 27, 2023feat: bring action up to date — github/issue-labeler10 reactions
On Hacker News · 16
- Dec 3, 2025RCE Vulnerability in React and Next.js628 points · 259 comments
- May 31, 2025Next.js: The "Versatile" React Framework That Can't Handle Dynamic Routes17 points · 20 comments
- Mar 21, 2025Authorization Bypass in Next.js Middleware8 points
- May 7, 2026Six New High Severity CVEs for Next.js and 1 for React4 points · 2 comments
- May 15, 2026Next.js – Server-side request forgery in applications using WebSocket upgrades3 points
11 more on Hacker News
- May 7, 2026New security vulnerabilities disclosed in Next.js (patches released)3 points
- Apr 2, 2025RFC: Deployment Adapters API for Next.js3 points
- Aug 7, 2024Vercel/Next.js memory leak in Fetch API3 points
- Dec 29, 2025Next.js makes many tiny serverless requests for all visible links2 points · 1 comment
- Sep 17, 2025Next.js GET Cache Bypass via Multipart POST – Reproduces on Vercel.com2 points · 1 comment
- May 26, 2025How hardware identifiers work on a PC2 points
- Apr 9, 2025Next.js with Rspack1 point
- Jul 3, 2023Is server component default always a performance win? Or should it be opt-in?1 point
- Mar 29, 2022Next.js: Support SSG (one-time SSR) during runtime1 point
- Nov 3, 2021What libraries do you recommend for a Node.js CRUD web app?1 point · 1 comment
- Jan 19, 2021Unconfigured next.js application with TypeScript does not work in IE111 point
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- apps/bundle-analyzer/AGENTS.mdAGENTS.md
- crates/AGENTS.mdAGENTS.md
- evals/AGENTS.mdAGENTS.md
- evals/evals/agent-062-pokedex-dev-loop/AGENTS.mdAGENTS.md
- evals/next-upgrade/apps/member-dashboard/next-13/AGENTS.mdAGENTS.md
- evals/next-upgrade/apps/member-dashboard/next-15/AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- packages/next/AGENTS.mdAGENTS.md
- test/AGENTS.mdAGENTS.md
- evals/next-upgrade/apps/member-dashboard/next-13/CLAUDE.mdCLAUDE.md
- evals/next-upgrade/apps/member-dashboard/next-15/CLAUDE.mdCLAUDE.md
- authoring-skillsSkill
- backport-prSkill
- create-prSkill
- dce-edgeSkill
- deploy-release-testSkill
- docs-diagramsSkill
- flagsSkill
- gate-testsSkill
- gh-stackSkill
- insight-error-pageSkill
- next-rspackSkill
- pr-status-triageSkill
- react-syncSkill
- react-vendoringSkill
- rebase-prSkill
- router-actSkill
- run-testsSkill
- runtime-debugSkill
- rust-turbopackSkill
- sandbox-benchSkill
- update-docsSkill
- v8-jitSkill
- write-api-referenceSkill
- write-guideSkill
- next-bundle-optimizerSkill
- next-cache-components-adoptionSkill
- next-cache-components-optimizerSkill
- next-dev-loopSkill
- next-partial-prefetching-adoptionSkill
- next-partial-prefetching-optimizerSkill
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Run cargo fmt rather than ordering imports by hand: it uses ASCII order (uppercase before lowercase).
- Very specific: line 12
Avoid adding new super:: imports except in inline mod blocks (e.g.
- Distinctive: line 19
Keep task cache keys narrow: pass only the inputs the task needs.
- Very specific: line 20
Avoid .cell() and Vc::cell() unless you know the current function is already called by functions with fine-grained cache keys.
- Very specific: line 22
When task inputs need to be cells to preserve fine-grained caching, arrange for them to already be cells returned by …
- Very specific: line 23
Do not blindly introduce "interning" task functions that only wrap values, such as Vec<T> -> Vc<Vec<T>>.
- Distinctive: line 25
Put maps containing information for a large part of the build (for example, a map from modules to analysis results) into separate cells.
- Very specific: line 26
Read keyed cells through keyed access, such as map.get(&key).await?, so invalidation depends only on the entries actually read.
- Distinctive: line 29
When changing task boundaries, check the intended invalidation behavior.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Turbopack Development Guide
Turbopack is a general-purpose bundler that is built and designed for Next.js, but is not necessarily Next.js-specific. Keep Next.js concepts out of it.
- Do NOT mention Next.js config options (e.g. anything under
next.config.js,experimental.*, or otherNextConfigfields) insideturbopack/code, comments, or docs. Refer to Turbopack's own options/inputs instead, and let the Next.js (inpackages/next/) do the translation from Next.js config to Turbopack options. (This only applies toturbopack/— the Next.js-specific crates incrates/andpackages/next/may reference Next.js config options.)
Rust conventions
These apply to all Rust code in this directory tree. For building, testing, snapshot updates, and benchmarking, use $rust-turbopack.
- Run
cargo fmtrather than ordering imports by hand: it uses ASCII order (uppercase before lowercase). - Avoid adding new
super::imports except in inlinemodblocks (e.g.mod tests { ... }). Prefercrate::-rooted paths, which keep imports consistent and easier to grep for. - In JavaScript generated with Rust
format!, escape literal braces as{{and}}.
turbo_tasks caching and invalidation
These rules apply throughout this directory tree when developing with turbo_tasks:
- Keep task cache keys narrow: pass only the inputs the task needs. Avoid build-wide state or large collections when a per-module or per-entry input would suffice.
- Avoid
.cell()andVc::cell()unless you know the current function is already called by functions with fine-grained cache keys. Inspect the callers and task boundaries before creating cells. - Pass booleans, enums, and similar small values directly as
TaskInputwhere appropriate instead of wrapping them in cells. - When task inputs need to be cells to preserve fine-grained caching, arrange for them to already be cells returned by
#[turbo_tasks::function]functions. - Do not blindly introduce "interning" task functions that only wrap values, such as
Vec<T> -> Vc<Vec<T>>. Only add such a task when you are certain it is beneficial in that particular situation. - Existing
.cell()calls or wrapping tasks are not automatically good precedent. Verify their caller and cache-key assumptions before copying the pattern. - Put maps containing information for a large part of the build (for example, a map from modules to analysis results) into separate cells. Use
cell = "keyed"on their value types, for example#[turbo_tasks::value(transparent, cell = "keyed")]for a map wrapper. - Read keyed cells through keyed access, such as
map.get(&key).await?, so invalidation depends only on the entries actually read. Awaiting the entire map and then looking up a key creates a dependency on the whole map instead. - When a task reads many keys of the same keyed cell, use
let map = map.keyed_reader().await?;and then the synchronousmap.get(&key)/map.contains_key(&key). It reads the cell once and, when theKeyedReadRefis dropped, narrows the dependency to the accessed keys in one batch. TheKeyedReadRef(and thekeyed_reader()future) must be dropped within the task execution that calledkeyed_reader(): don't return, store, leak, or move them to other threads or tasks. Otherwise completing the task execution panics, which aborts the process. - When a task only needs a cell's value in some cases, and only finds out in synchronous code, use
let value = vc.lazy_reader().await?;and access it withvalue.get(). When theLazyReadRefis dropped withoutget()ever being called, the read is canceled: the task no longer depends on the cell through it. The same lifetime rules as forKeyedReadRefapply. - When changing task boundaries, check the intended invalidation behavior. An unrelated module change should not invalidate consumers of unchanged keyed entries; correct output alone does not demonstrate good cache granularity.
- Cell equality must include every observable distinction: comparison can retain the old value when the new value compares equal. In particular,
IndexSethas deterministic iteration order but order-insensitive equality. UseVecor an order-sensitive comparison when order is semantic or another cell stores positional indices into the collection; otherwise a reorder can leave old data paired with new indices even after recomputation settles. - A
#[turbo_tasks::value_impl]block should contain task functions. Put plain helpers in free functions. - Task functions receive clones of their inputs. Don't infer the capacity of a stored input from the value inside the function.
- In
#[turbo_tasks::function]functions, if an argument needs to be resolved unconditionally, acceptResolvedVc<T>instead of acceptingVc<T>and calling.to_resolved().await?on it. The task macro automatically resolves arguments declared asResolvedVc<T>, so callers do not need to manually resolve them before passing them in.
Eventual consistency
- Reads of separate cells can observe different executions during recomputation, even when the cells are produced by the same task or referenced through
ResolvedVc. Do not assume a parent cell and its child/index cells form an atomic snapshot. - For cross-cell indices and lookups, handle transient mismatches with
bail!or otherResult::Errreturns. Do not use panicking indexing,unwrap/expector assertions. - Bounds checks prevent panics, not torn reads: an in-range index can still select the wrong value from another execution, for example leading to unexpected enum variants.
Turbopack
These rules apply specifically to the turbopack-* crates and wherever they are used.
AssetContextidentity directly influences module identity. Avoid creating a slightly different context for a single module or import: the same source can become distinct modules under different contexts, potentially producing duplicate modules with colliding module IDs.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

