一键导入
rsdoctor-analysis
Use when analyzing Rspack/Webpack bundles from local `rsdoctor-data.json` and producing evidence-based optimization recommendations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when analyzing Rspack/Webpack bundles from local `rsdoctor-data.json` and producing evidence-based optimization recommendations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Debug Rstack ecosystem CI failures and attribute the real source PR or downstream change. Always use this skill when the user mentions Rspack eco-ci, rstack-ecosystem-ci, a suite turning red, a downstream regression, a green-to-red pivot, canary bisect, @rspack-canary/core, or daily eco-ci triage — even if they only ask "why is this suite failing", "which PR broke it", or "is this Rspack's fault". Use it to avoid over-blaming the first Rspack commit that appears red in status data.
Write or revise release blog posts for product releases. Use when the user asks to draft, polish, restructure, or adapt a release announcement.
Create or update draft GitHub release notes, or output organized Markdown when draft creation is unavailable. Use for release notes, draft releases, release PR checks, npm staged publishing checks, and optional highlights.
Generate or maintain Rspress documentation for a project. Use whenever the user wants to create a new Rspress v2 docs site, add docs for user-facing feature work or PRs, maintain a dedicated Rspress docs project in a monorepo, or prevent stale Rspress v1 scaffolds/version drift before documentation work. For full v1-to-v2 migration, hand off to the rspress-v2-upgrade skill.
Audit and modernize RstackJS/Rspack ecosystem repositories to the current shared infrastructure baseline: Rslib ESM or dual builds, Rslint recommended rules, Rstest test tooling, Node 20+ support where appropriate, TypeScript 6 and tsgo where compatible, concise README/AGENTS docs, release workflow cleanup, unused dependency removal, and infra PR commit conventions. Use when updating rstackjs repositories, copying infra patterns from maintained exemplars, or reviewing package/tooling consistency.
Use when asked to create a pull request for this repository. It helps the PR follow the repository's branch safety rules, title convention, pull request template, and concise English writing style.
| name | rsdoctor-analysis |
| description | Use when analyzing Rspack/Webpack bundles from local `rsdoctor-data.json` and producing evidence-based optimization recommendations. |
Use the globally installed rsdoctor-agent CLI from @rsdoctor/agent-cli only after a real rsdoctor-data.json path exists. Keep analysis read-only unless the user explicitly asks for install/config setup.
Response order (required): High-Priority Issues -> Proposed Solutions -> Optional Reference-Chain Follow-up Choices -> Next Deep-Dive Issue Categories (Not commands).
.rsdoctor-analysis-cache.json entries before doing new work.rsdoctor-data.json fast: user-provided path, then dist/rsdoctor-data.json, output/rsdoctor-data.json, static/rsdoctor-data.json, .rsdoctor/rsdoctor-data.json, then one bounded rg --files search excluding node_modules and .git. Treat manifest.json only as an index.rsdoctor-agent analysis commands, do not run the Analysis Gate, and either ask for the data path or run the Generation Gate below only when setup/generation is required.rsdoctor-agent data-fetch command: verify global @rsdoctor/agent-cli with npm view @rsdoctor/agent-cli version and rsdoctor-agent --version; install latest only if missing/outdated, a version-related error occurs, or the user asks to refresh.Performance rules: parallelize independent checks, cache only derived facts (dataFile, dataFileMtime, pluginName, pluginVersion, dependency/config/plugin modification times), and invalidate cache when paths disappear, modification times change, the user asks to refresh, or cached values fail. Speculative plugin checks must not trigger generation; use them only after confirming the data file is missing.
Identify pluginName (@rsdoctor/rspack-plugin or @rsdoctor/webpack-plugin) and determine pluginVersion from local files first: package.json, lockfile, then node_modules/<plugin>/package.json; use pnpm why / npm ls only as fallback.
Use this exact if/else decision tree; do not merge branches:
if pluginName is missing:
install/register the matching Rsdoctor plugin, then configure output.mode='brief' and output.options.type=['json']; build with RSDOCTOR=true only
else if pluginVersion is unknown:
resolve pluginVersion first; if still unknown, configure output.mode='brief' and output.options.type=['json']; build with RSDOCTOR=true only
else if pluginVersion >= 1.5.11:
do not edit plugin config just for JSON; build with RSDOCTOR_OUTPUT=json and RSDOCTOR=true if needed
else: # pluginVersion < 1.5.11
MUST configure output.mode='brief' and output.options.type=['json']; build with RSDOCTOR=true only
Preflight every build command: RSDOCTOR_OUTPUT=json is allowed only in the pluginVersion >= 1.5.11 branch. For missing, unknown, or < 1.5.11, it is forbidden. For < 1.5.11, generating rsdoctor-data.json requires the plugin config below:
output: {
mode: 'brief',
options: {
type: ['json'],
},
}
Default Evidence Set:
| Summary key | Evidence source | Bounds |
|---|---|---|
buildCost | build summary | filtered fields only |
assetsTop | top assets by raw/gzip size | fixed Top-N |
packagesTop | top packages by gzip size | fixed Top-N; avoid full packages list pages |
duplicatePackages | E1001 duplicate package summary | first-pass summary only |
crossChunkPackages | E1002 cross-chunk duplication summary | first-pass summary only |
retainedModulesTop | tree-shaking retained-modules --limit 10 | filtered fields only; no --compact |
Scope rules:
rsdoctor-agent for bundle data access only after rsdoctor-data.json exists; prefer parallel independent fetches; bound output with --filter, pagination, and --limit.tree-shaking retained-modules --emitted-only --category side-effects --limit 10 with narrow --filter for side-effects investigations.tree-shaking retained-modules with --emitted-only, bounded --category, --sort gzipSize, --limit, and narrow --filter; do not pass --compact.tree-shaking summary only as fallback for missing fields or aggregate context. Treat tree-shaking bailout-reasons as high-volume; run it only when explicitly requested and pass target --modules (max 100).5k tokens, 500 KB raw output, or a few hundred transcript lines, stop broad fetching and switch to targeted compact queries.Output format:
For Top-N insights, prefer a table: Name | Volume/Time | Count | Recommendation.
Recovery rules:
rsdoctor-data.json missing: do not run rsdoctor-agent; ask for the data path or run Generation Gate, then use the matching install reference if setup is needed.rsdoctor-agent.query reports unknown tool: run list and use a catalog tool name, or switch to direct <group> <subcommand> mode.install, build, global CLI installation, version checks, or rsdoctor-agent... inside sandbox. Run Rsdoctor CLI setup and data-fetch commands outside sandbox so they can access project files and dependencies normally.References: commands/options references/command-map.md; install/config/data location references/install-rsdoctor.md, references/install-rsdoctor-rspack.md, references/install-rsdoctor-webpack.md, references/install-rsdoctor-common.md; raw data fields references/rsdoctor-data-types.md; common patterns references/common-analysis-patterns.md.