Skip to content

/next-dev-loop

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`.

From plugin
nextjs
143k6 skills

Claude Code

$ npx -y skills add vercel/next.js --skill next-dev-loop --agent claude-code

SKILL.md

next-dev-loop.SKILL.md
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`.

next-dev-loop

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:

  • **`/_next/mcp`** — an HTTP endpoint Next.js exposes about itself.

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.

  • **`agent-browser`** — a CLI that drives a real Chrome. Knows

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.

requires

  • Next.js **16.3+** with **Turbopack** — `/_next/mcp` plus the

proactive compile check via `get_compilation_issues`.

  • `agent-browser` **>= 0.31.1** — React introspection, worktree-scoped

`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.

  • Upgrade Next.js: `pnpm next upgrade` (or `npx next upgrade`).

Docs: https://nextjs.org/docs/app/getting-started/upgrading (version-16 guide: https://nextjs.org/docs/app/guides/upgrading/version-16)

  • Install or upgrade `agent-browser`: `npm i -g agent-browser@latest`.

If the CLI isn't on `PATH`, install it before continuing — preflight expects to invoke it directly.

preflight

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 --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.

Keep routine verification headless. If the user asks to see the UI, open the current URL in the coding harness's inline browser. It is a separate browser context, so do not assume state carries over. When login or existing `agent-browser` state must carry over, reopen that session headed instead:

   agent-browser --session "$SESSION" --restore --headed --enable react-devtools open <url>

Pause while the user drives login, then continue with the same session and keep it headed for the rest of the loop.

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:

  • Unreachable → either `next dev` isn't running, or Next.js is

below 16.3. Check `package.json` to disambiguate, then refuse.

  • `get_compilation_issues` not in the list → Next.js below 16.3.

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.

loop

before the edit — narrow the scope

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.

after the edit — verify

Four failure modes. Check each:

  • **Compiles** — `get_compilation_issues`.
  • **Runs without errors** — `/_next/mcp` (server and bubbled-up

browser errors both surface here).

  • **Behaves as intended** — `agent-browser` drives the page; assert

what the user actually sees.

  • **React-level behavior** — `agent-browser` with react-devtools

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. Use `agent-browser react tree --json` to get the tree rather than a bare acknowledgement.

Pick the specific tool from `tools/list` or the agent-browser manual rather than from memory.

gotchas

  • **Preserve `.next` while the development server is running.** Moving or

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`.

  • Before running production tests, give their app and API servers ports

distinct from dev, or stop dev first. Otherwise readiness checks may reach the wrong server.

  • **Every `agent-browser` command must know your session and restore

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 to

Read more
@vercel
Ships withnextjs

The React Framework

Stars on GitHub

Momentum

stars in total
143.5k
Star history of vercel/next.js on GitHub, a chart by star-history.com

Other skills on nextjs.

next-bundle-optimizer
Auto-invoked

next-bundle-optimizer

Audit and reduce Next.js browser initial-load work. Use for slow route startup, oversized client bundles, duplicate browser…

@vercel@vercelInstall Skill
next-cache-components-adoption
Auto-invoked

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,…

@vercel@vercelInstall Skill
next-cache-components-optimizer
Auto-invoked

next-cache-components-…

Optimize the meaningful UI available immediately from a Next.js route on an initial load (hard navigation) or named client-side…

@vercel@vercelInstall Skill

More skills from other plugins.

migrate-radix-to-base

migrate-radix-to-base

Migrates React projects and components from Radix UI to Base UI. Use when asked to migrate from radix, move to base-ui, convert…

ui2w127k
@shadcn-ui@shadcn-uiInstall Skill
chrome-release-cls

chrome-release-cls

Given a Chrome Releases blog post URL (chromereleases.googleblog.com), extract every CVE/bug and find the underlying Gerrit CL…

electron5d124k
@electron@electronInstall Skill
taste-skill
Auto-invoked

taste-skill

tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One…

angular-developer

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, services, or HTTP…

angular2w101k
@angular@angularInstall Skill

Questions about next-dev-loop.

Which coding agents can use next-dev-loop?
next-dev-loop installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.