Best for
- Upgrade @rspack/core npm package version
- Upgrade rspack crate dependency versions
- Upgrade Rust version in rspack/rust-toolchain.toml (rspack directory only)
vercel/next.js/.agents/skills/next-rspack/SKILL.md
Maintain @next/rspack-core and @next/rspack-binding packages. Use when editing rspack/package.json, rspack/crates/binding/Cargo.toml, rspack/rust-toolchain.toml, or packages/next-rspack/package.json. Covers upgrading @rspack/core npm version, rspack_* crate versions, Rust toolchain version, building and linking for local testing, and NEXT_RSPACK environment variable usage. Does NOT apply to root rust-toolchain.toml (that's for Turbopack).
Decision brief
Maintain @next/rspack-core and @next/rspack-binding packages. json, rspack/crates/binding/Cargo.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/vercel/next.js --skill ".agents/skills/next-rspack"Inspect the Agent Skill "next-rspack" from https://github.com/vercel/next.js/blob/1cb20a1d1431f9216f44230a1e5a698c23ba9f70/.agents/skills/next-rspack/SKILL.md at commit 1cb20a1d1431f9216f44230a1e5a698c23ba9f70. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Query https://github.com/web-infra-dev/rspack to obtain:
Query https://github.com/web-infra-dev/rspack to obtain:
Edit rspack/package.json:
Edit rspack/crates/binding/Cargo.toml, update all rspack crate versions:
Edit rspack/rust-toolchain.toml:
Permission review
The documentation includes network, browsing, or remote request actions.
Query https://github.com/web-infra-dev/rspack to obtain:The documentation asks the agent to run terminal commands or scripts.
cargo checkThe documentation asks the agent to run terminal commands or scripts.
pnpm buildEvidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 90/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 141,971 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Use this skill when you need to:
@rspack/core npm package versionrspack/rust-toolchain.toml (rspack directory only)⚠️ Scope Limitation: This skill only applies to code and configuration under the
rspack/directory. Therust-toolchain.tomlin the repository root is for Turbopack and is outside the scope of this skill.
rspack/ # Independent workspace (separate rust toolchain and npm releases)
├── Cargo.toml # Rust workspace configuration
├── rust-toolchain.toml # Rust version configuration
├── package.json # @next/rspack-core package definition
├── lib/
│ ├── index.js # Exports @rspack/core + custom plugins
│ └── index.d.ts # Type definitions
└── crates/
└── binding/
├── Cargo.toml # Rust crate dependencies (rspack_* crates)
└── package.json # @next/rspack-binding package definition
packages/
└── next-rspack/
└── package.json # References @next/rspack-core
packages/next-rspack
└── @next/rspack-core (rspack/package.json)
├── @rspack/core (npm dependency)
└── @next/rspack-binding (rspack/crates/binding)
└── rspack_* crates (Cargo.toml dependencies)
| @rspack/core npm version | rspack crate version | Notes |
|---|---|---|
2.0.0-rc.0 | 0.100.0-rc.0 | npm major.minor maps to crate 0.(major*50+minor) |
1.3.x | 0.53.x | e.g., 1.3 → 0.53 |
1.2.x | 0.52.x | e.g., 1.2 → 0.52 |
Query https://github.com/web-infra-dev/rspack to obtain:
@rspack/core npm versionrust-toolchain.tomlEdit rspack/package.json:
{
"dependencies": {
"@rspack/core": "<new version>",
"@next/rspack-binding": "workspace:*"
}
}
Edit rspack/crates/binding/Cargo.toml, update all rspack crate versions:
[dependencies]
rspack_binding_builder = { version = "=<new crate version>" }
rspack_binding_builder_macros = { version = "=<new crate version>" }
rspack_core = { version = "=<new crate version>" }
rspack_error = { version = "=<new crate version>" }
rspack_hook = { version = "=<new crate version>" }
rspack_plugin_externals = { version = "=<new crate version>" }
rspack_regex = { version = "=<new crate version>" }
# rspack_sources version is managed separately, may not follow the main version
[target.'cfg(...)'.dependencies]
rspack_binding_builder = { version = "=<new crate version>", features = ["plugin"] }
[build-dependencies]
rspack_binding_build = { version = "=<new crate version>" }
Edit rspack/rust-toolchain.toml:
[toolchain]
profile = "default"
components = ["rust-src"]
channel = "<nightly version matching upstream rspack>"
# Execute in rspack directory
cd rspack
# Check Rust code
cargo check
# Build binding (requires Rust installed)
pnpm build
rspack/ is an independent workspace not included in the root pnpm-workspace, manual linking is required:
# Execute from repository root
cd packages/next-rspack
# Link locally built @next/rspack-core
pnpm link ../../rspack
Or modify packages/next-rspack/package.json to use local path (for local testing only, do not commit):
{
"dependencies": {
"@next/rspack-core": "link:../../rspack"
}
}
Important: After linking, run
pnpm installin the root directory to update dependency relationships.
# Execute from repository root
pnpm test-rspack
Files to check/modify during upgrade:
| File Path | Modification |
|---|---|
rspack/package.json | @rspack/core version, package version |
rspack/crates/binding/Cargo.toml | rspack_* crate versions |
rspack/crates/binding/package.json | binding package version |
rspack/rust-toolchain.toml | Rust nightly version |
packages/next-rspack/package.json | @next/rspack-core version reference (update on release, use link for local testing) |
Before running pnpm test-rspack, you must build and link @next/rspack-core:
# 1. Build @next/rspack-core
cd rspack
pnpm install
pnpm build
# 2. Link to packages/next-rspack
cd ../packages/next-rspack
pnpm link ../../rspack
# 3. Return to root and update dependencies
cd ../..
pnpm install
# 4. Run tests
pnpm test-rspack
Note: After modifying Rust code under
rspack/, you need to re-runpnpm buildfrom step 1.
# Full test suite (using Rspack compiler)
pnpm test-rspack
# Development mode tests
pnpm test-dev-rspack
# Production mode tests
pnpm test-start-rspack
# Run specific tests only
pnpm run with-rspack pnpm testonly -- <test-pattern>
All test commands set environment variables via with-rspack:
cross-env NEXT_RSPACK=1 NEXT_TEST_USE_RSPACK=1
Use the NEXT_RSPACK environment variable to differentiate compilers in packages/next/ code:
// Check if using Rspack
const isRspack = Boolean(process.env.NEXT_RSPACK)
if (process.env.NEXT_RSPACK) {
// Rspack-specific logic
} else {
// Webpack logic
}
packages/next/src/lib/bundler.tspackages/next/src/build/webpack-config.tspackages/next/src/build/webpack/loaders/@next/rspack-core exports = @rspack/core + custom plugins:
NextExternalsPlugin - externals handling plugin implemented in RustRelease via GitHub Actions workflow:
.github/workflows/release-next-rspack.ymlexamples/with-rspack/Frequently asked questions
Maintain @next/rspack-core and @next/rspack-binding packages. json, rspack/crates/binding/Cargo.
The source record exposes this install command: npx skills add https://github.com/vercel/next.js --skill ".agents/skills/next-rspack". Inspect the command and pinned source before running it.
Static rules flagged network, exec-script in the source; the page lists the matching lines and excerpts.
Alternatives
vercel/next.js
Validate a commit-specific Next.js preview package and manually trigger the entire Next.js deployment test suite through the test_e2e_deploy_release.yml GitHub Actions workflow. Use only when asked to run the full deploy test suite or this workflow specifically from an internal vercel/next.js PR branch. Do not use for focused deployment-test sanity checks; run the relevant tests locally with pnpm test-deploy instead. Covers resolving the latest branch SHA, waiting for vercel-packages, preserving
vasilyu1983/AI-Agents-public
Guides iOS testing with XCTest, XCUITest, Swift Testing, simctl, and xcresult. Use when choosing destinations, controlling flakes, or parsing test artifacts for native apps.
steipete/agent-scripts
REQUIRED before ANY `op` command or whenever a task needs an API key, token, password, credential, or secret (OPENAI_API_KEY, ANTHROPIC_API_KEY, deploy tokens, live-test keys). Prompt-free 1Password service-account reads; wrong invocations spam macOS dialogs.
microsoft/Sico
Execute Android UI workflows on a sandbox device, review results, and produce a structured execution report.