next-cache-components-…
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache…
Verify Next.js runtime behavior after editing app code. Use this skill to confirm a change actually works in a running app — not just that it compiles or type-checks. Combines /_next/mcp (Next.js's view) with agent-browser (the browser's view). Requires a running `next dev`.
$ npx -y skills add vercel/next.js --skill next-dev-loop --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/next-dev-loopContext preview
The summary Claude sees to decide when to auto-load this skill.
Verify Next.js runtime behavior after editing app code. Use this skill to confirm a change actually works in a running app — not just that it compiles or type-checks. Combines /_next/mcp (Next.js's view) with agent-browser (the browser's view). Requires a running `next dev`.
name: next-dev-loop description: > Verify Next.js runtime behavior after editing app code. Use this skill to confirm a change actually works in a running app — not just that it compiles or type-checks. Combines /_next/mcp (Next.js's view) with agent-browser (the browser's view). Requires a running `next dev`.
The edit/verify rhythm during `next dev` — make a change, then confirm it actually works at runtime, not only that the types or the build are happy.
You verify through two views of the same running app:
Knows framework-specific things: routes, segments, RSC, server actions, server logs, and errors as Next.js saw them. Call `tools/list` for the current surface.
framework-agnostic browser things: DOM, console, network, React fiber, vitals. Before driving it, run `agent-browser skills get core` once for the version-matched usage guide — don't guess subcommands from memory.
The two views cross-check each other.
proactive compile check via `get_compilation_issues`.
`session id`, idempotent `--restore`, and launch flag reconciliation.
These are hard floors, not soft preferences. If anything is missing, tell the user how to upgrade and stop. Don't fall back to grepping source or to a weaker probe — this skill assumes both views are live at the versions above.
Docs: https://nextjs.org/docs/app/getting-started/upgrading (version-16 guide: https://nextjs.org/docs/app/guides/upgrading/version-16)
If the CLI isn't on `PATH`, install it before continuing — preflight expects to invoke it directly.
Once per session, confirm both views are live.
1. **Open `agent-browser` at the target URL, restoring saved login state when present.** First derive one stable session id for this checkout and use it for every `agent-browser` command:
SESSION="$(agent-browser session id --scope worktree --prefix next-dev-loop)" export AGENT_BROWSER_SESSION="$SESSION" export AGENT_BROWSER_RESTORE="$SESSION"
Then open the target URL:
agent-browser --session "$SESSION" --restore --headed --enable react-devtools open <url>
`--scope worktree` keeps parallel worktrees and copied checkouts from colliding. Bare `--restore` uses the session id as the persistence key, loads saved cookies/localStorage before navigation when present, and auto-saves state on close. Always pass the desired launch flags on `open`; agent-browser will reuse, relaunch, or restart its scoped background state as needed.
The browser is the user's. If state was not restored (first run, expired session) and the page is gated, the user drives the login — pause until they confirm. After login, continue using the same session and restore context; `agent-browser close` saves the cookie state so the next `open` restores it.
2. Probe `/_next/mcp` (`tools/list`) — confirm it's reachable and lists `get_compilation_issues`. First read the port off the `next dev` banner; if it isn't 3000, set `NEXT_MCP_URL=http://localhost:<port>/_next/mcp` before probing:
below 16.3. Check `package.json` to disambiguate, then refuse.
Refuse and tell the user to upgrade. 3. `get_compilation_issues` doubles as a Turbopack probe. An error response of `"Turbopack project is not available..."` means the user is on webpack. Refuse — Turbopack is required. 4. `get_routes` → your route map for the rest of the session.
Ask the running app, not the codebase. `/_next/mcp` knows which files rendered the current route; use those as your search scope. Runtime introspection stays cheap as the codebase grows; agentic search doesn't.
Four failure modes. Check each:
browser errors both surface here).
what the user actually sees.
enabled exposes the component tree, props, state, and render counts. Anchor framework-level checks here (extra renders, server/client boundary shifts, suspense fallbacks) — DOM asserts alone miss them.
Pick the specific tool from `tools/list` or the agent-browser manual rather than from memory.
deleting it disconnects the server from its generated state and discards incremental caches. Moving it to a backup is still a reset. If a production build needs isolated output, configure a separate `distDir`.
key, or it may use an empty default browser or fail to save login state.** Easiest: export both `AGENT_BROWSER_SESSION="$SESSION"` and `AGENT_BROWSER_RESTORE="$SESSION"` at the top of each shell you run agent-browser in. If you do not export them, pass `--session "$SESSION" --restore` on every command.
`agent-browser` says a route is broken but `/_next/mcp` and the server say it rendered cleanly, a stale or misdirected browser session is the likelier cause than a real bug — reconcile the views before debugging the app.
Repo: vercel/next.js
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache…
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side…
Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip…
Optimize what selected Next.js client navigations include before the click under Partial Prefetching. Use after Cache Components and Partial Prefetching are…