next-dev-loop

Verifies Next.js code changes at runtime using the /_next/mcp endpoint and a browser automation CLI.

Updated Aug 5, 2024
One-click install
npx skills add https://github.com/SethyRung/movie-next --skill next-dev-loop-sethyrung
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-dev-loop
Source: https://github.com/SethyRung/movie-next/tree/main/.agents/skills/next-dev-loop
Command: npx skills add https://github.com/SethyRung/movie-next --skill next-dev-loop-sethyrung

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires agent-browser.

What problem does it solve? Code that compiles and type-checks can still fail at runtime. This Skill closes that gap by verifying edits against a live next dev server, cross-checking Next.js's own introspection endpoint with a real browser session so you confirm actual behavior, not just build health. ## Core Features & Use Cases - Dual-view verification: Combines the /_next/mcp HTTP endpoint (routes, RSC, server actions, compilation issues, server logs) with agent-browser (DOM, console, network, React fiber, vitals) to cross-check the same running app. - Four-mode failure checks: After each edit, verifies the app compiles via get_compilation_issues, runs without errors, behaves as intended in the browser, and behaves correctly at the React level (render counts, server/client boundaries, suspense fallbacks). - Session-persistent browser testing: Uses worktree-scoped session ids with --restore so login state persists across loops, and includes recovery steps for stale sessions and blank pages. - Use Case: After editing a movie details page in a Next.js 16 app, run the loop to confirm Turbopack compiled cleanly, the route renders without server errors, the cast section appears in the DOM, and no extra React renders were introduced. ## Quick Start Start next dev, then ask the agent to verify your last edit works at runtime using the next-dev-loop skill against http://localhost:3000.

Frequently Asked Questions about next-dev-loop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify Next.js changes actually work at runtime?

Run next dev, then probe the /_next/mcp endpoint with get_compilation_issues and get_errors while driving a real browser with agent-browser to assert DOM and React behavior. Cross-checking both views confirms the change works beyond compiling.

What is the /_next/mcp endpoint in Next.js?

It is an HTTP endpoint Next.js 16.3+ exposes about itself during development, listing tools like get_routes, get_errors, get_page_metadata, and get_compilation_issues. Call tools/list to see the current surface; replies are SSE, so read JSON off the data: line.

Does this workflow require Turbopack or work with webpack?

Turbopack is required. The get_compilation_issues tool returns a "Turbopack project is not available" error on webpack, and the skill refuses to continue rather than falling back to weaker probes.

Why does agent-browser return a blank page or no session error?

A blank read or about:blank after open or a click usually means a stale browser session, not a broken route. Reopen with the same --session and --restore flags, or close and reopen the session; avoid falling back to curl since it bypasses the browser under test.

What versions of Next.js and agent-browser are required?

Next.js 16.3 or later with Turbopack is required for /_next/mcp and get_compilation_issues, and agent-browser 0.31.1 or later for React introspection and worktree-scoped sessions. Upgrade with npx next upgrade and npm i -g agent-browser@latest.