Senior QA
nicepkg/auto-company
Comprehensive QA and testing skill for quality assurance, test automation, and testing strategies for ReactJS, NextJS, NodeJS applications.
How to write end-to-end tests using createRouterAct and LinkAccordion.
$ npx skills add vercel/next.js --skill router-act -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install vercel/next.js router-act --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/vercel/next.js.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/router-act .claude/skills/router-act && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "router-act" agent skill from https://github.com/vercel/next.js/tree/canary/.agents/skills/router-act into .claude/skills/router-act/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "router-act", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/vercel/next.js/tree/canary/.agents/skills/router-actType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add vercel/next.js --skill router-act -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install vercel/next.js router-act --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/vercel/next.js.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/router-act .agents/skills/router-act && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "router-act" agent skill from https://github.com/vercel/next.js/tree/canary/.agents/skills/router-act into .agents/skills/router-act/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "router-act", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add vercel/next.js --skill router-act -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install vercel/next.js router-act --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/vercel/next.js.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/router-act .cursor/skills/router-act && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "router-act" agent skill from https://github.com/vercel/next.js/tree/canary/.agents/skills/router-act into .cursor/skills/router-act/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "router-act", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/vercel/next.js.git --path .agents/skills/router-act--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add vercel/next.js --skill router-act -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install vercel/next.js router-act --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/vercel/next.js.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/router-act .gemini/skills/router-act && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "router-act" agent skill from https://github.com/vercel/next.js/tree/canary/.agents/skills/router-act into .gemini/skills/router-act/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "router-act", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install vercel/next.js router-actInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add vercel/next.js --skill router-act -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/vercel/next.js.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/router-act .github/skills/router-act && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "router-act" agent skill from https://github.com/vercel/next.js/tree/canary/.agents/skills/router-act into .github/skills/router-act/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "router-act", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add vercel/next.js --skill router-act -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install vercel/next.js router-act --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/vercel/next.js.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/router-act .opencode/skills/router-act && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "router-act" agent skill from https://github.com/vercel/next.js/tree/canary/.agents/skills/router-act into .opencode/skills/router-act/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "router-act", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
router-actHow to write end-to-end tests using createRouterAct and LinkAccordion.
Router Act is an agent skill from vercel/next.js, published by the product's own GitHub organization. How to write end-to-end tests using createRouterAct and LinkAccordion. Use when writing or modifying tests that need to control the timing of internal Next.js requests (like prefetches) or assert on their responses. Covers the act API, fixture patterns, prefetch control via LinkAccordion, fake clocks, and avoiding flaky testing patterns.
Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Testing & QA, covering Test strategy. It works with Next.js. The licence is MIT.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit a32ddfd. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Router Act loads about 3.1k tokens when it runs. Until then it costs about 88 tokens; SKILL.md has 1,113 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from vercel/next.js at commit a32ddfd, republished under its MIT licence (© vercel). 1,113 words, ~3,132 tokens.
.claude/skills/router-act/SKILL.md (or your agent's skills folder).Use this skill when writing or modifying tests that involve prefetch requests, client router navigations, or the segment cache. The createRouterAct utility from test/lib/router-act.ts lets you assert on prefetch and navigation responses in an end-to-end way without coupling to the exact number of requests or the protocol details. This is why most client router-related tests use this pattern.
actDon't bother with act if you don't need to instrument the network responses — either to control their timing or to assert on what's included in them. If all you're doing is waiting for some part of the UI to appear after a navigation, regular Playwright helpers like browser.elementById(), browser.elementByCss(), and browser.waitForElementByCss() are sufficient.
LinkAccordion to control when prefetches happen. Never let links be visible outside an act scope.'no-requests' whenever the data should be served from cache. This is the strongest assertion — it proves the cache is working.act utility exists specifically to replace inherently flaky patterns like retry() loops or setTimeout waits for network activity. If you find yourself wanting to poll, you're probably not using act correctly.block feature. It's prone to false negatives. Prefer includes and 'no-requests' assertions instead.// Assert NO router requests are made (data served from cache).
// Prefer this whenever possible — it's the strongest assertion.
await act(async () => { ... }, 'no-requests')
// Expect at least one response containing this substring
await act(async () => { ... }, { includes: 'Page content' })
// Expect multiple responses (checked in order)
await act(async () => { ... }, [
{ includes: 'First response' },
{ includes: 'Second response' },
])
// Assert the same content appears in two separate responses
await act(async () => { ... }, [
{ includes: 'Repeated content' },
{ includes: 'Repeated content' },
])
// Expect at least one request, don't assert on content
await act(async () => { ... })includes Matching Worksincludes substring is matched against the HTTP response body. Use text content that appears literally in the rendered output (e.g. 'Dynamic content (stale time 60s)').includes assertion are silently ignored — you only need to assert on the responses you care about. This keeps tests decoupled from the exact number of requests the router makes.includes expectation claims exactly one response. If the same substring appears in N separate responses, provide N separate { includes: '...' } entries.When App Shells are enabled (the default when Cache Components is on), a prefetch is split into two phases: an App Shell prefetch — the param/searchParam-independent chrome of the route (layouts, loading boundaries, static shell) — and a separate per-link/per-page data prefetch. The App Shell is conceptually part of the route, not prefetch data, so act ignores App Shell requests for all assertion purposes (they carry a next-router-prefetch: '3' header).
This means you generally do not need to account for the extra App Shell response in your assertions. If a Loading... fallback now arrives in both the App Shell prefetch and the per-link prefetch, you still write a single { includes: 'Loading...' } — the App Shell copy is invisible to matching. Likewise, 'no-requests' still passes even if an App Shell prefetch fires, and block: 'reject' won't match content that appears only in the App Shell.
App Shell requests are still intercepted, fulfilled, and awaited (so the shell is cached and no requests are left in flight) — they just don't participate in includes matching, no-requests, block: 'reject', or the "at least one request" check. An App Shell response that returns an error status (4xx/5xx) still fails the test.
To assert on App Shell responses directly — for tests specifically about App Shell behavior — opt in at the act instance level:
const act = createRouterAct(page, { includeAppShellRequests: true })With this option, App Shell requests are treated like any other router request. Prefer expressing App Shell behavior through observable outcomes (e.g. an instant navigation rendering the cached shell before the data response arrives) rather than asserting on prefetch content where practical. See test/e2e/app-dir/segment-cache/prefetch-app-shell/prefetch-app-shell.test.ts for the canonical example.
act Does Internallyact intercepts all router requests — prefetches, navigations, and Server Actions — made during the scope:
requestIdleCallback (captures IntersectionObserver-triggered prefetches)Responses are buffered and only forwarded to the browser after the scope function returns. This means you cannot navigate to a new page and wait for it to render within the same scope — that would deadlock. Trigger the navigation (click the link) and let act handle the rest. Read destination page content after act returns:
await act(
async () => {
/* toggle accordion, click link */
},
{ includes: 'Page content' }
)
// Read content after act returns, not inside the scope
expect(await browser.elementById('my-content').text()).toBe('Page content')LinkAccordion controls when <Link> components enter the DOM. A Next.js <Link> triggers a prefetch when it enters the viewport (via IntersectionObserver). By hiding the Link behind a checkbox toggle, you control exactly when prefetches happen — only when you explicitly toggle the accordion inside an act scope.
// components/link-accordion.tsx
'use client'
import Link from 'next/link'
import { useState } from 'react'
export function LinkAccordion({ href, children, prefetch }) {
const [isVisible, setIsVisible] = useState(false)
return (
<>
<input
type="checkbox"
checked={isVisible}
onChange={() => setIsVisible(!isVisible)}
data-link-accordion={href}
/>
{isVisible ? (
<Link href={href} prefetch={prefetch}>
{children}
</Link>
) : (
`${children} (link is hidden)`
)}
</>
)
}Always toggle the accordion and click the link inside the same act scope:
await act(
async () => {
// 1. Toggle accordion — Link enters DOM, triggers prefetch
const toggle = await browser.elementByCss(
'input[data-link-accordion="/target-page"]'
)
await toggle.click()
// 2. Click the now-visible link — triggers navigation
const link = await browser.elementByCss('a[href="/target-page"]')
await link.click()
},
{ includes: 'Expected page content' }
)browser.back() with open accordionsDo not use browser.back() to return to a page where accordions were previously opened. BFCache restores the full React state including useState values, so previously-opened Links are immediately visible. This triggers IntersectionObserver callbacks outside any act scope — if the cached data is stale, uncontrolled re-prefetches fire and break subsequent no-requests assertions.
The only safe use of browser.back()/browser.forward() is when testing BFCache behavior specifically.
Fix: navigate forward to a fresh hub page instead. See Hub Pages.
<Link> components outside act scopesAny <Link> visible in the viewport can trigger a prefetch at any time via IntersectionObserver. If this happens outside an act scope, the request is uncontrolled and can interfere with subsequent assertions. Always hide links behind LinkAccordion and only toggle them inside act.
retry(), setTimeout, or any polling pattern to wait for prefetches or navigations to settle is inherently flaky. act deterministically waits for all router requests to complete before returning.
act scopeResponses are buffered until the scope exits. Clicking a link then reading destination content in the same scope deadlocks. Read page content after act returns instead.
When you need to navigate away from a page and come back to test staleness, use "hub" pages instead of browser.back(). Each hub is a fresh page with its own LinkAccordion components that start closed.
Hub pages use connection() to ensure they are dynamically rendered. This guarantees that navigating to a hub always produces a router request, which lets act properly manage the navigation and wait for the page to fully render before continuing.
Hub page pattern:
// app/my-test/hub-a/page.tsx
import { Suspense } from 'react'
import { connection } from 'next/server'
import { LinkAccordion } from '../../components/link-accordion'
async function Content() {
await connection()
return <div id="hub-a-content">Hub a</div>
}
export default function Page() {
return (
<>
<Suspense fallback="Loading...">
<Content />
</Suspense>
<ul>
<li>
<LinkAccordion href="/my-test/target-page">Target page</LinkAccordion>
</li>
</ul>
</>
)
}Target pages link to hubs via LinkAccordion too:
// On target pages, add LinkAccordion links to hub pages
<LinkAccordion href="/my-test/hub-a">Hub A</LinkAccordion>Test flow:
// 1. Navigate to target (first visit)
await act(
async () => {
/* toggle accordion, click link */
},
{ includes: 'Target content' }
)
// 2. Navigate to hub-a (fresh page, all accordions closed)
await act(
async () => {
const toggle = await browser.elementByCss(
'input[data-link-accordion="/my-test/hub-a"]'
)
await toggle.click()
const link = await browser.elementByCss('a[href="/my-test/hub-a"]')
await link.click()
},
{ includes: 'Hub a' }
)
// 3. Advance time
await page.clock.setFixedTime(startDate + 60 * 1000)
// 4. Navigate back to target from hub (controlled prefetch)
await act(async () => {
const toggle = await browser.elementByCss(
'input[data-link-accordion="/my-test/target-page"]'
)
await toggle.click()
const link = await browser.elementByCss('a[href="/my-test/target-page"]')
await link.click()
}, 'no-requests') // or { includes: '...' } if data is staleSegment cache staleness tests use Playwright's clock API to control Date.now():
async function startBrowserWithFakeClock(url: string) {
let page!: Playwright.Page
const startDate = Date.now()
const browser = await next.browser(url, {
async beforePageLoad(p: Playwright.Page) {
page = p
await page.clock.install()
await page.clock.setFixedTime(startDate)
},
})
const act = createRouterAct(page)
return { browser, page, act, startDate }
}setFixedTime changes Date.now() return value but timers still run in real timeDate.now() for staleness checkssetFixedTime does NOT fire pending setTimeout/setInterval callbackscreateRouterAct: test/lib/router-act.tsLinkAccordion: test/e2e/app-dir/segment-cache/staleness/components/link-accordion.tsxtest/e2e/app-dir/segment-cache/staleness/© vercel, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/router-act of vercel/next.js.
Open the folder on GitHubat commit a32ddfd
Router Act next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Router Act this skillvercel/next.js | 143k | — | ~3.1k | Automated safety check: Pass | MIT | |
| Senior QAnicepkg/auto-company | 192 | 3 repos | ~1.1k | Automated safety check: Notes | None | |
| Senior QAalirezarezvani/claude-skills | 28k | 1 repos | ~2.1k | Automated safety check: Pass | MIT | |
| Testing Best Practicesanonaddy/anonaddy | 4.9k | 5 repos | ~1k | Automated safety check: Pass | MIT | |
| Golang Testingantoniopaya22/go-rest-template | 172 | 9 repos | ~4.2k | Automated safety check: Pass | None | |
| Testing OpenLogi UIAprilNEA/OpenLogi | 23k | — | ~1.1k | Automated safety check: Pass | Apache-2.0 |
nicepkg/auto-company
Comprehensive QA and testing skill for quality assurance, test automation, and testing strategies for ReactJS, NextJS, NodeJS applications.
alirezarezvani/claude-skills
Generates unit tests, integration tests, and E2E tests for React/Next.js applications.
anonaddy/anonaddy
Laravel test design and review. An agent skill from anonaddy/anonaddy.
antoniopaya22/go-rest-template
Go testing patterns including table-driven tests, subtests, benchmarks, fuzzing, and test coverage.
AprilNEA/OpenLogi
Verifies OpenLogi's native GPUI interface with focused tests, the component gallery and a mock agent, choosing the evidence that fits each change.
AprilNEA/OpenLogi
Plans the smallest check that could disprove a code change in the OpenLogi project, then escalates through reproduction, focused tests and a final gate before a push.
vercel/next.js
Manages stacked PRs and splits multi-part work into reviewable branches with gh-stack.
vercel/next.js
Benchmark React or Next.js changes on Vercel Sandbox VMs with paired A/B statistics: react PR/commit vs base, or Next.js PR/commit vs base, measured end-to-end through the bench/render-pipeline app…
vercel/next.js
Verify Next.js runtime behavior after editing app code. An agent skill from vercel/next.js.
vercel/next.js
Draw diagrams for the Next.js docs in the style of the ones already published there: the light/dark PNGs an mdx references with <Image srcLight="/docs/light/<name.png" srcDark="/docs/dark/<name.png".
vercel/next.js
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces.
vercel/next.js
Build local React changes in the bundle variants consumed by Next.js, sync them into a local Next.js checkout, and test the resulting integration.
Works with
Categories
How to write end-to-end tests using createRouterAct and LinkAccordion. js, published by the product's own GitHub organization. How to write end-to-end tests using createRouterAct and LinkAccordion.
Router Act fits situations like: modifying tests that need to control the timing of internal Next.js requests (like prefetches); assert on their responses.
Run `npx skills add vercel/next.js --skill router-act -a claude-code`. Or copy the skill folder (.agents/skills/router-act in vercel/next.js) into .claude/skills/router-act in your project. Claude Code loads it when a task matches its description.
Run `npx skills add vercel/next.js --skill router-act -a codex`. Or copy the skill folder (.agents/skills/router-act in vercel/next.js) into .agents/skills/router-act in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add vercel/next.js --skill router-act -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/router-act, .gemini/skills/router-act, .github/skills/router-act and .opencode/skills/router-act in your project.
SKILL.md names no scripts, command-line tools or credentials: Router Act is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Router Act is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.1k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Router Act: Senior QA (nicepkg/auto-company, 192 stars), Senior QA (alirezarezvani/claude-skills, 28k stars), Testing Best Practices (anonaddy/anonaddy, 4.9k stars) and Golang Testing (antoniopaya22/go-rest-template, 172 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
vercel (a GitHub organization, an official publisher) maintains it in vercel/next.js, which has 143,241 GitHub stars. The repository holds 27 skills in this directory. The repository was last updated on October 8, 2026.
Source: vercel/next.js on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.