next.js / test
AGENTS.md144k starsChanged 7 months agoMITView on GitHub
Tests for behavior that affects deployed applications must live in test/e2e/ and exercise the real deployment path. This applies to new features and regressions. Reserve test/production/ for behavior inherently specific to self-hosted servers or the local CLI. Simulating minimal mode is an exception. Use private switches such as NEXT_PRIVATE_MINIMAL_MODE and NEXT_PRIVATE_TEST_HEADERS only when a real deployment cannot exercise the protocol invariant under test. Explain that constraint in the test. A simulation must not replace real deployment coverage of behavior that…
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
- turbopack/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
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Use the deployment log support first:
- Distinctive: line 28
Keep response status, body, and other deployment-compatible assertions active.
- Distinctive: line 32
All newly created e2e tests must work with Cache Components both enabled and disabled.
- Very specific: line 37
Write fixtures that conform to Cache Components rules by default: put uncached or request-time work behind appropriate <Suspense> …
- Very specific: line 41
Do not pin cacheComponents: false or skip the enabled variant just to make an otherwise compatible test pass.
- Distinctive: line 45
Only exclude the Cache Components variant when the feature under test is explicitly unsupported, such as Edge Runtime or another …
- Very specific: line 76
Always use LinkAccordion to control when prefetches happen inside act scopes.
- Very specific: line 83
Cache Components enables PPR by default: When __NEXT_CACHE_COMPONENTS=true, most app-dir pages use PPR implicitly.
≈ “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
Test instructions
Deployment coverage
Tests for behavior that affects deployed applications must live in test/e2e/
and exercise the real deployment path. This applies to new features and
regressions. Reserve test/production/ for behavior inherently specific to
self-hosted servers or the local CLI.
Simulating minimal mode is an exception. Use private switches such as
NEXT_PRIVATE_MINIMAL_MODE and NEXT_PRIVATE_TEST_HEADERS only when a real
deployment cannot exercise the protocol invariant under test. Explain that
constraint in the test. A simulation must not replace real deployment coverage
of behavior that deployed applications can observe.
Log assertions do not justify excluding a whole test or suite from deploy mode. Use the deployment log support first:
next.cliOutputexposes deployment build logs, including failed-build diagnostics.NextDeployInstance.getRuntimeLogs({ since, query, deadline })reads runtime logs for deployments made or inspected through the Vercel CLI. Poll withretry()because runtime logs become available with a delay.
The runtime log helper is unavailable for custom deploy scripts. Custom deploy
scripts provide build logs through NEXT_TEST_DEPLOY_LOGS_SCRIPT_PATH. If a
deployment cannot provide a particular diagnostic, gate only that assertion.
Keep response status, body, and other deployment-compatible assertions active.
Cache Components compatibility
All newly created e2e tests must work with Cache Components both enabled and
disabled. The test infrastructure runs both variants. In the enabled variant,
__NEXT_CACHE_COMPONENTS=true enables Cache Components even when the fixture's
next.config does not declare cacheComponents.
- Write fixtures that conform to Cache Components rules by default: put
uncached or request-time work behind appropriate
<Suspense>boundaries, and use"use cache"for work that should be cached. Preserve what the test is intended to cover when adapting the fixture. - Do not pin
cacheComponents: falseor skip the enabled variant just to make an otherwise compatible test pass. If behavior legitimately differs, keep meaningful assertions in both variants; use the resolved-config runtimegate()helper rather than checking environment variables. Only exclude the Cache Components variant when the feature under test is explicitly unsupported, such as Edge Runtime or another incompatible feature. Explain the incompatibility in a comment and use a test gate. For a fixture that cannot build or run with Cache Components, put the gate directly above the suite's
describe:// Edge Runtime is not supported with Cache Components. // @force-gate !cacheComponents describe('edge runtime', () => { // ... })@force-gateskips the incompatible variant;@gateinstead runs the test with an expected failure and detects stale gates. ThecacheComponentscondition reads the fixture's resolved config, not just the environment. See the gate reference and$gate-testsfor directive selection, build-skipping limitations, and verification guidance.
Client router tests
Tests of client navigations, prefetching, and router caches must trigger
requests through the client router. Use createRouterAct and LinkAccordion
to control and assert on those requests. Do not synthesize prefetch requests
with next.fetch() and internal RSC or router headers, or call fetch() in
the browser as a substitute. Let the router produce the request headers,
router state, and prefetch stage. Ordinary HTTP requests are appropriate for
fixture setup, such as revalidation. See the
router-act skill for the patterns.
Always use LinkAccordion to control when prefetches happen inside act
scopes. Never use browser.back() to return to a page where accordion links
are already visible. BFCache restores state and triggers uncontrolled
re-prefetches.
Test gotchas
- Cache Components enables PPR by default. When
__NEXT_CACHE_COMPONENTS=true, most app-dir pages use PPR implicitly. The dedicatedppr-full/andppr/suites are mostlydescribe.skipwhile they migrate to Cache Components. To test PPR code paths, run normal app-dir e2e tests with__NEXT_CACHE_COMPONENTS=true. - Mode-specific tests need
skipStart: trueand a manualnext.start()inbeforeAllafter the mode check. - Don't rely on exact log messages. Filter by content patterns, and find sequences rather than positions.
- Show full stack traces with
__NEXT_SHOW_IGNORE_LISTED=true. By default the dev server collapses internal frames toat ignore-listed frames, which hides framework internals. Seepackages/next/src/server/patch-error-inspect.ts. - For bootstrapping, CI env flags, smoke tests, flaky tests and ignored fixture
files, use
$run-tests.
Code review
- During code review, enforce the deployment coverage rules above. Flag new
test/production/tests for deployable behavior, simulated minimal-mode setups,skipDeployment: true, andisNextDeployexclusions. Require a concrete reason for each exception and keep deployment-compatible assertions active. - During code review, flag any new hardcoded cache tag or any
revalidatePath('/')(including('/', 'layout')) in a deploy-active fixture. Revalidation invalidates at Vercel project scope and every deploy suite shares one project per matrix dimension, so suites using the same tag or path purge each other's cache. Tags (cacheTag/revalidateTag/updateTag/next.tags) get a suite-slug prefix, e.g.app-static:thankyounext. Paths must name a real route, so a fixture that needs to revalidate/moves its page to a suite-unique route first (seeparallel-routes-revalidation's/prr). A revalidation route handler that takes the tag/path from a request parameter is fine as long as the values the tests pass are suite-unique. - During code review, flag any fetch URL a fixture shares with another fixture when a test depends on the cached value. Fetch cache entries are keyed by URL across deployments, so two fixtures fetching the same URL share one entry, and either fixture's writes or revalidations change the value the other sees. Give the data endpoint suite-unique query params, e.g.
api/random?app-static-pageinstead ofapi/random?page.
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.

