
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.
- Installs
- 22.4K
- Last 24h
- +212
- Trending rank
- #1216
- Security
- Pass
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/vercel/next.js --skill next-dev-loop- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads next-dev-loop automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
Security audits
Independent scans of the skill's instructions and bundled files.
SKILL.md
The instructions your agent reads when the skill is triggered.
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. Calltools/listfor 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, runagent-browser skills get coreonce 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/mcpplus the proactive compile check viaget_compilation_issues. agent-browser>= 0.31.1 — React introspection, worktree-scopedsession 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(ornpx 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 onPATH, install it before continuing — preflight expects to invoke it directly.
preflight
Once per session, confirm both views are live.
-
Open
agent-browserat the target URL, restoring saved login state when present. First derive one stable session id for this checkout and use it for everyagent-browsercommand: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 worktreekeeps parallel worktrees and copied checkouts from colliding. Bare--restoreuses 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 onopen; 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-browserstate 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.
-
Probe
/_next/mcp(tools/list) — confirm it's reachable and listsget_compilation_issues. First read the port off thenext devbanner; if it isn't 3000, setNEXT_MCP_URL=http://localhost:<port>/_next/mcpbefore probing:- Unreachable → either
next devisn't running, or Next.js is below 16.3. Checkpackage.jsonto disambiguate, then refuse. get_compilation_issuesnot in the list → Next.js below 16.3. Refuse and tell the user to upgrade.
- Unreachable → either
-
get_compilation_issuesdoubles as a Turbopack probe. An error response of"Turbopack project is not available..."means the user is on webpack. Refuse — Turbopack is required. -
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-browserdrives the page; assert what the user actually sees. - React-level behavior —
agent-browserwith 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.
Pick the specific tool from tools/list or the agent-browser
manual rather than from memory.
gotchas
- Preserve
.nextwhile 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 separatedistDir. - Every
agent-browsercommand must know your session and restore key, or it may use an empty default browser or fail to save login state. Easiest: export bothAGENT_BROWSER_SESSION="$SESSION"andAGENT_BROWSER_RESTORE="$SESSION"at the top of each shell you run agent-browser in. If you do not export them, pass--session "$SESSION" --restoreon every command. - When the two views disagree, suspect the tooling first. If
agent-browsersays a route is broken but/_next/mcpand 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. - Confirming a click or navigation: the page settles a beat later, so
wait with
wait --load networkidle(no path to get wrong), then snapshot/read to confirm the page. Avoidwait --urlunless you pass the link's exact href — a guessed or placeholder path won't match the real URL and times out after 25s. - A blank read, empty snapshot,
about:blank, or a "no browser session" error — right afteropenor after a click (even ifopenreported the page) — is the browser dropping the page (a stale session), not a broken route. Reopen your session at the URL with the same launch flags as the active loop, then re-snapshot. If still blank, runagent-browser --session "$SESSION" --restore close, then reopen with those same flags. Don't fall back tocurl; it bypasses the browser you're testing. - React introspection output is stale after navigation. Re-run.
/_next/mcpreplies are SSE — read the JSON off thedata:line withsed -n 's/^data: //p'(a plainsed 's/^data: //'leaves theevent:line and the parse fails).get_errorsandget_page_metadataneed at least one navigation to populate.
reference
All tools below are present once preflight passes. If tools/list
is missing any of them, preflight should have refused — re-check.
# /_next/mcp notes
get_project_metadata projectPath, devServerUrl, bundler
get_routes fs-scan; no browser session needed
get_errors runtime + build; needs a browser session;
includes browser-side errors caught by the
dev server
get_page_metadata segment trie + routerType; needs a browser
session; use as a discovery shortcut for
which files power a route
get_logs returns logFilePath
get_server_action_by_id hashed id → file + functionName
get_compilation_issues Turbopack only; errors on webpack
("Turbopack project is not available")
teardown
Close the session with the same session and restore context:
agent-browser --session "$SESSION" --restore close. close saves
that session's cookies and storage so the next loop's --restore open
keeps the user logged in. Leave next dev up for the next loop.
Report Next.js friction
Only participate in agent feedback when managed Next.js feedback instructions are already loaded for the project. Their presence means the feature is enabled; their absence means it is disabled.
When enabled, add qualifying feedback candidates found during verification to the feedback candidate queue for the current user request, then continue verification. Do not run the feedback command or open review forms during the loop or at this Skill's teardown.
The managed instructions own the single reporting pass immediately before the final response. If they are absent, do not queue or report feedback.
FAQ
What does the next-dev-loop skill do?
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.
How do I install next-dev-loop?
Run npx skills add https://github.com/vercel/next.js --skill next-dev-loop in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/next-dev-loop/ (personal) or .claude/skills/next-dev-loop/ (project).
Which AI agents can use next-dev-loop?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is next-dev-loop safe to install?
Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk passed. As with any skill, read the SKILL.md and bundled scripts before installing.
Who maintains next-dev-loop?
It is published by vercel in vercel/next.js, and it is an official skill from the maker of the technology it covers. It has 22,391 recorded installs.
More from vercel/next.js
next-cache-components-adoption
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 Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or decide between opting routes out with export const instant = false and fixing them in place.
next-cache-components-optimizer
vercel/next.js
Optimize the meaningful UI available immediately from a Next.js route on an initial load (hard navigation) or named client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route and entry point at a time; the shipped test then guards against regression. Use when asked to grow a static shell, fix a slow first paint or non-instant navigation, diagnose which Suspense boundary blocks useful UI, or add instant() regression coverage. Requires Next.js 16.3+ with Cache Components already adopted.
next-partial-prefetching-adoption
vercel/next.js
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 the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with instant() tests, or resolve the instant-link-prefetch-partial and instant-shell-url-data insights.
next-partial-prefetching-optimizer
vercel/next.js
Optimize what selected Next.js client navigations include before the click under Partial Prefetching. Use after Cache Components and Partial Prefetching are adopted when the user wants selected URL-specific UI to be instant, wants reusable content to wait for navigation, or needs to choose between default, viewport, and intent prefetching. Requires Next.js 16.3+.
next-bundle-optimizer
vercel/next.js
Audit and reduce Next.js browser initial-load work. Use for slow route startup, oversized client bundles, duplicate browser dependencies, or features that can wait for interaction.
docs-diagrams
vercel/next.js
Open the skill to read its SKILL.md instructions.
Popular frontend & design skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.