code-inspector-init
Skill4 starsChanged 5 days agoMITView on GitHub
Set up or migrate code-inspector-plugin across modern frontend frameworks. Use when you need click-to-source IDE navigation, hotkey customization, or inspector troubleshooting.
- Reads credentials
- Installs packages
In this repository43 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- agent-symlink-initSkill
- commitSkill
- copywritingSkill
- css-tailwind-stylingSkill
- lingui-best-practicesSkill
- lingui-workflowSkill
- repo-skill-creatorSkill
- weekly-reportSkill
- agent-dispatchSkill
- agentic-review-handoffSkill
- agent-practice-auditSkill
- agent-symlink-initSkill
- architecture-hardening-loopSkill
- ardot-mcpSkill
- branch-creatorSkill
- chrome-dev-mcpSkill
- code-inspector-initSkill
- code-plugin-architectureSkill
- commit-pushSkill
- commitSkill
- decision-first-technical-writingSkill
- design-systemSkill
- desktop-agent-activitySkill
- dev-environment-roi-auditSkill
- disk-tidySkill
- figma-mcpSkill
- file-tidySkill
- goal-gateSkill
- grill-autopilotSkill
- kimi-computer-useSkill
- lingui-workflowSkill
- local-web-surfaceSkill
- open-code-review-loopSkill
- prompt-studioSkill
- review-prompt-composerSkill
- task-completion-loopSkill
- uxc-facadeSkill
- web-performance-auditSkill
- weekly-reportSkill
- workflow-gateSkill
- worktree-tidySkill
The file
Files
Code Inspector Init
Overview
在开发环境为前端项目接入或修复 code-inspector-plugin,实现按组合键后点击 DOM 跳转到源码位置。新接入默认使用插件原生开关策略:needEnvInspector: true + .env.local 中设置 CODE_INSPECTOR=true;但 Next.js >=15.3 主模板默认使用 hotKeys: ["altKey"] + needEnvInspector: false。
Scope and Intent
- 用户要求接入、迁移或修复时,检查工作树后完成对应改动;已有明确授权无需再让用户确认方案。仅询问原理、配置示例或排障原因时保持只读。
- 已安装但不生效时,先读取现有配置、实际运行模式和错误证据,再按 references/troubleshooting.md 定位。下面的安装流程用于新接入;不要为排障重装依赖、重建配置或覆盖已有开关、快捷键和插件链。
- 确认需要修改后,只改与原因相关的配置。沿用已安装版本;查明版本兼容问题后才考虑升级。新接入模板的默认值不替代用户已有选择。
Trigger Phrases
- 帮我接入
code-inspector-plugin - 帮我迁移
codeInspectorPlugin到新项目 - Next.js/Vite/Webpack 怎么配 code inspector
- 点击页面元素跳不到 IDE
- Alt+Shift 没反应 / 快捷键怎么改
Decision Tree
- 识别框架与 bundler。
- 从
package.json、配置文件名、构建命令确认是 Next.js、Vite、Webpack、Rspack、Rsbuild、Esbuild、Mako、Umi、Nuxt、Astro 中哪一种。
- 如果是 Next.js,先判断版本区间。
<=14.x:使用 webpack 插件接入。15.0.x ~ 15.2.x:使用experimental.turbo.rules。>=15.3.x(包含 16):使用turbopack.rules。
- 选择开关策略。
- 默认:
needEnvInspector: true(推荐,迁移一致性最好)。 - Next.js
>=15.3主模板特例:默认needEnvInspector: false,并使用hotKeys: ["altKey"]做最小接入。 - 用户明确要求项目自定义开关时,再补充
ENABLE_CODE_INSPECTOR等外层条件。
- 判断是否需要高级选项。
- 只有用户明确提出需求才调整
hotKeys、hideConsole、openIn、launchType、include/exclude、mappings、pathType、skipSnippets。
New Integration Workflow
- 识别项目环境。
- 确认框架、bundler、配置文件路径、是否 dev-only 配置。
- 安装依赖。
- 给出单行命令:
pnpm add -D code-inspector-plugin(如项目使用 npm/yarn,则给对应命令)。
- 注入配置。
- 从
references/bundler-recipes.md选择对应片段。 - 配置中必须包含正确的
bundler值。
- 设置
.env.local。
- 仅当模板显式使用
needEnvInspector: true时,添加CODE_INSPECTOR=true。 - 对 Next.js
>=15.3主模板(hotKeys: ["altKey"]+needEnvInspector: false)不强制配置.env.local。
- 本地验证。
- 启动 dev。
- 在页面按默认组合键(多数模板为 Mac:
Option+Shift/ Windows:Alt+Shift;Next.js>=15.3主模板为Option/Alt单键)后悬浮并点击 DOM。 - 观察浏览器控制台提示和 IDE 跳转结果。
- 故障排查。
- 出现 IDE 无法打开、快捷键无效、路径错误、端口冲突时,按
references/troubleshooting.md分步排查。
Reference Routing
- 需要框架配置代码片段时:读取
references/bundler-recipes.md。 - 需要定制参数与风险评估时:读取
references/options-cheatsheet.md。 - 需要排障步骤时:读取
references/troubleshooting.md。 - 不要一次性加载全部 references,只按当前请求场景读取对应文件。
Output Contract
- 实施或修复:说明已改内容、原因和验证结果;引用修改文件即可,不必再次输出完整配置。回退说明只针对本次改动,不能把修复的回退扩大为卸载已有插件。
- 解释或示例:直接回答原因或给出与项目版本匹配的最小片段;不要声称已经修改或验证。
- 验证区分配置检查、开发页面遮罩和 IDE 实际跳转。涉及交互修复时,在目标页面用实际配置的快捷键点击验证;无法操作浏览器或观察 IDE 时,将该层标为
UNVERIFIED,说明缺少的证据。配置正确或命令成功不能证明跳转已恢复。
Guardrails
- 默认只在开发环境启用,不在生产构建开启 inspector。
- 修改保持最小化,不顺带重构无关代码。
- 不确定框架版本时,先读取
package.json与 lockfile 再下结论。 - 涉及
node_modules源码映射时,优先使用mappings且给出风险说明。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

