[Plugin] Add experimental next-dev Claude Code plugin#92429
Draft
[Plugin] Add experimental next-dev Claude Code plugin#92429
Conversation
Adds a new `next-dev` plugin to the Next.js Claude Code marketplace
that wires the dev server's MCP endpoint into Claude Code via two
skill-scoped hooks:
- UserPromptSubmit: pings the dev server and calls `pause_compilation`
so intermediate edits don't trigger HMR.
- Stop: calls `compile_and_resume` (one batch compile) followed by
`get_compilation_issues`, blocking the agent from finishing if
compilation errors exist.
State files (`.claude/port`, `.claude/dismissed-issues.json`) are
project-local; hook scripts live under `${CLAUDE_PLUGIN_ROOT}`.
Marked experimental in the manifest, marketplace, and README — depends
on `pause_compilation`/`compile_and_resume` MCP tools that are still
landing in #92410. The activation script verifies the tools are
present and refuses to enable hooks otherwise.
Comment on lines
+75
to
+76
| lines.push( | ||
| `${issues.length} issue(s). Fix them or dismiss non-actionable ones with: node "./scripts/dismiss-errors.mjs"` |
Contributor
There was a problem hiding this comment.
Suggested change
| lines.push( | |
| `${issues.length} issue(s). Fix them or dismiss non-actionable ones with: node "./scripts/dismiss-errors.mjs"` | |
| const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT || '.' | |
| lines.push( | |
| `${issues.length} issue(s). Fix them or dismiss non-actionable ones with: node "${pluginRoot}/skills/next-dev/scripts/dismiss-errors.mjs"` |
Stop hook message contains wrong path to dismiss-errors.mjs, causing the agent to receive a non-working command when compilation errors block it.
| @@ -0,0 +1,88 @@ | |||
| #!/usr/bin/env node | |||
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
next-devplugin to the Next.js Claude Code marketplace at.claude-plugin/plugins/next-dev/. It wires the dev server's MCP endpoint into Claude Code so agents editing Next.js code get real-time Turbopack compilation feedback instead of discovering all errors at the finalpnpm build.Two skill-scoped hooks fire while the
/next-dev <port>skill is active:UserPromptSubmit→ pings the dev server, then callspause_compilation. Intermediate edits within a turn no longer trigger HMR. Silent no-op if the port file is missing or the server is unreachable.Stop→ callscompile_and_resume(drains all buffered tasks in one batch), thenget_compilation_issues. If issues are found, returnsdecision: blockwith formatted errors, forcing the agent to fix them.stop_hook_activeis checked to prevent infinite loops.State files (
.claude/port,.claude/dismissed-issues.json) are project-local via$CLAUDE_PROJECT_DIR. Hook scripts and skill scripts are plugin-local via${CLAUDE_PLUGIN_ROOT}.The agent can also dismiss non-actionable errors (
node_modulesresolution failures, Turbopack empty-module stubs) for the rest of the session viadismiss-errors.mjs.Status: experimental
This plugin depends on MCP tools that are not yet in stable Next.js:
get_compilation_issuespause_compilation/compile_and_resumeThe activation script verifies the tools are present at
localhost:<port>/_next/mcpand refuses to enable hooks otherwise — installing against an unsupported Next.js version produces a clear error rather than broken hooks. The plugin is marked experimental inplugin.json, the marketplace entry, the plugins index, and the README.Files
Test plan
/plugin marketplace add vercel/next.js+/plugin install next-dev@nextjsagainst a Next.js dev server built from Add manual compile mode to pause Turbopack scheduling during batched edits #92410/next-dev 3000activates cleanly; activation fails with a clear message when tools are missingstop_hook_active=true