跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 react-devtools-plus

React Devtools Plus

倒入 Vite/ Webpack 镜像插件 React Fiber 树,配置文件制作,并为 React 16-19 apps 提供可视调试覆盖.

193 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

倒入 Vite/ Webpack 镜像插件 React Fiber 树,配置文件制作,并为 React 16-19 apps 提供可视调试覆盖.

何时用

官方 description 未单独写出 Use when。按规范,代理会在用户任务与这段 description 的关键词匹配时激活本技能。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:React DevTools Plus、What It Does、Installation、For Vite Projects、For Webpack Projects、Configuration。

文件分析

文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。

官方 description(原文)

Drop-in Vite/Webpack plugin that mirrors React Fiber trees, profiles renders, and provides visual debugging overlay for React 16-19 apps.

React DevTools PlusWhat It DoesInstallationFor Vite ProjectsFor Webpack ProjectsConfigurationBasic ConfigurationAdvanced ConfigurationWebpack ConfigurationUsage PatternsAccessing DevToolsComponent Tree Inspection

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
react-devtools-plus
description
Drop-in Vite/Webpack plugin that mirrors React Fiber trees, profiles renders, and provides visual debugging overlay for React 16-19 apps.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「react-devtools-plus」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-dd4dae3789e80d82-%E5%8F%8D%E5%BA%94-Devtools-Plus.html
请存为 .cursor/skills/react-devtools-plus/SKILL.md 或 .claude/skills/react-devtools-plus/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/reason-machines/devtools-skills' --list

npx skills add 'https://github.com/reason-machines/devtools-skills' --skill 'react-devtools-plus'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版

name: react-devtools-plus description: Drop-in Vite/Webpack plugin that mirrors React Fiber trees, profiles renders, and provides visual debugging overlay for React 16-19 apps. triggers:

  • add react devtools plus to my project
  • set up react debugging overlay
  • configure react devtools plus plugin
  • profile react component renders
  • inspect react fiber tree
  • debug react components in development
  • add react devtools to vite
  • integrate react debugging tools

React DevTools Plus

Skill by ara.so — Devtools Skills collection.

React DevTools Plus is an open-source build tool plugin that provides visual debugging for React applications. It mirrors your React Fiber tree in real-time, profiles component renders, and offers a keyboard-first overlay—all with zero impact on production builds.

What It Does

  • Fiber Tree Mirroring: Automatically instruments React Fiber roots to visualize component hierarchies
  • Timeline Profiling: Tracks component renders and performance metrics
  • Floating Overlay: Toggle with Alt/Option + Shift + D for inline debugging
  • Asset Inspection: Browse and inspect project assets (images, fonts, etc.)
  • Editor Integration: Click-to-open components in your IDE
  • React 16-19 Support: Works with React 16.8+, 17, 18, and 19
  • Dev-Only: Completely removed from production bundles

Installation

For Vite Projects

pnpm add -D react-devtools-plus
// vite.config.ts
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { reactDevToolsPlus } from 'react-devtools-plus/vite'

export default defineConfig({
  plugins: [
    react(),
    reactDevToolsPlus(),
  ],
})

For Webpack Projects

npm install -D react-devtools-plus
// webpack.config.js
const { reactDevToolsPlus } = require('react-devtools-plus/webpack')

module.exports = {
  plugins: [
    reactDevToolsPlus(),
  ],
}

Configuration

Basic Configuration

// vite.config.ts
import { reactDevToolsPlus } from 'react-devtools-plus/vite'

export default defineConfig({
  plugins: [
    react(),
    reactDevToolsPlus({
      // Enable/disable overlay (default: true in dev mode)
      overlay: true,
      
      // Custom DevTools route (default: '/__react_devtools__')
      base: '/__react_devtools__',
      
      // Editor integration (auto-detected by default)
      launchEditor: 'code', // 'code' | 'webstorm' | 'cursor' | 'vim' | etc.
    }),
  ],
})

Advanced Configuration

// vite.config.ts
import { reactDevToolsPlus } from 'react-devtools-plus/vite'

export default defineConfig({
  plugins: [
    react(),
    reactDevToolsPlus({
      // Disable overlay, use only the dedicated route
      overlay: false,
      
      // Custom base path
      base: '/__debug__',
      
      // Specific editor with custom launch command
      launchEditor: 'webstorm',
    }),
  ],
})

Webpack Configuration

// webpack.config.js
const { reactDevToolsPlus } = require('react-devtools-plus/webpack')

module.exports = {
  mode: 'development',
  plugins: [
    reactDevToolsPlus({
      overlay: true,
      base: '/__react_devtools__',
      launchEditor: 'code',
    }),
  ],
}

Usage Patterns

Accessing DevTools

Method 1: Keyboard Shortcut Press Alt + Shift + D (Windows/Linux) or Option + Shift + D (macOS) to toggle the floating overlay.

Method 2: Direct URL Navigate to http://localhost:5173/__react_devtools__/ (adjust port/base as configured).

Method 3: Toggle Overlay Visibility Press Alt + Shift + R (Windows/Linux) or Option + Shift + R (macOS) to toggle overlay visibility.

Press Escape to close the overlay.

Component Tree Inspection

Once DevTools is open:

  1. View Component Hierarchy: The left panel shows your React component tree in real-time
  2. Inspect Props/State: Click any component to view its props, state, and hooks
  3. Open in Editor: Click the "Open in Editor" button to jump to source code
  4. Search Components: Use the search bar to filter components by name

Timeline Profiling

  1. Switch to the Timeline tab
  2. Click "Start Recording" to begin profiling
  3. Interact with your app (trigger renders)
  4. Click "Stop Recording" to analyze performance
  5. Review render durations, commit phases, and component updates

Asset Inspection

  1. Switch to the Assets tab
  2. Browse images, fonts, and other project assets
  3. Click assets to view details and usage
  4. Copy asset paths for use in your code

Real-World Examples

Example 1: Next.js App with Vite

// next.config.mjs (with Vite plugin via next-with-vite)
import { defineConfig } from 'vite'
import { reactDevToolsPlus } from 'react-devtools-plus/vite'

export default defineConfig({
  plugins: [
    reactDevToolsPlus({
      overlay: true,
      base: '/__devtools__',
    }),
  ],
})

Example 2: React SPA with Custom Editor

// vite.config.ts
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { reactDevToolsPlus } from 'react-devtools-plus/vite'

export default defineConfig({
  plugins: [
    react(),
    reactDevToolsPlus({
      overlay: true,
      launchEditor: 'cursor', // Open components in Cursor AI
    }),
  ],
})

Example 3: Monorepo with Multiple React Apps

// apps/admin/vite.config.ts
import { defineConfig } from 'vite'
import { reactDevToolsPlus } from 'react-devtools-plus/vite'

export default defineConfig({
  plugins: [
    reactDevToolsPlus({
      base: '/__admin_devtools__', // Unique base per app
    }),
  ],
})

// apps/customer/vite.config.ts
import { defineConfig } from 'vite'
import { reactDevToolsPlus } from 'react-devtools-plus/vite'

export default defineConfig({
  plugins: [
    reactDevToolsPlus({
      base: '/__customer_devtools__', // Unique base per app
    }),
  ],
})

Example 4: Conditional DevTools (Environment-based)

// vite.config.ts
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { reactDevToolsPlus } from 'react-devtools-plus/vite'

export default defineConfig(({ mode }) => ({
  plugins: [
    react(),
    // Only enable in development and staging
    (mode === 'development' || mode === 'staging') && reactDevToolsPlus({
      overlay: mode === 'development', // Overlay only in dev
      base: '/__devtools__',
    }),
  ].filter(Boolean),
}))

Example 5: Webpack with React and TypeScript

// webpack.config.js
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { reactDevToolsPlus } = require('react-devtools-plus/webpack')

module.exports = {
  mode: 'development',
  entry: './src/index.tsx',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'bundle.js',
  },
  module: {
    rules: [
      {
        test: /\.tsx?$/,
        use: 'ts-loader',
        exclude: /node_modules/,
      },
    ],
  },
  resolve: {
    extensions: ['.tsx', '.ts', '.js'],
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: './public/index.html',
    }),
    reactDevToolsPlus({
      overlay: true,
      launchEditor: 'code',
    }),
  ],
  devServer: {
    port: 3000,
    hot: true,
  },
}

Key Features & API

Plugin Options

interface ReactDevToolsPlusOptions {
  /**
   * Enable/disable the floating overlay
   * @default true in development mode
   */
  overlay?: boolean

  /**
   * Custom base path for DevTools UI
   * @default '/__react_devtools__'
   */
  base?: string

  /**
   * Editor to launch when clicking "Open in Editor"
   * Auto-detected by default
   * @default auto-detected
   */
  launchEditor?: 'code' | 'webstorm' | 'cursor' | 'vim' | 'atom' | 'sublime' | string
}

Keyboard Shortcuts

| Shortcut | Action | |----------|--------| | Alt/Option + Shift + D | Toggle DevTools overlay | | Alt/Option + Shift + R | Toggle overlay visibility | | Escape | Close overlay |

DevTools UI Tabs

  1. Component Tree: Real-time React Fiber tree visualization
  2. Timeline: Render profiling and performance metrics
  3. Assets: Project asset browser and inspector
  4. Settings: DevTools configuration and preferences

Troubleshooting

DevTools Not Appearing

Issue: Pressing the keyboard shortcut or navigating to the URL shows nothing.

Solutions:

  • Ensure you're running in development mode (NODE_ENV=development)
  • Check that the plugin is correctly added to your Vite/Webpack config
  • Verify your dev server is running and the port is correct
  • Check browser console for errors

Overlay Blocks UI Elements

Issue: The floating overlay is interfering with app interaction.

Solutions:

// Disable overlay, use dedicated route only
reactDevToolsPlus({
  overlay: false,
})

Or toggle visibility with Alt/Option + Shift + R.

"Open in Editor" Not Working

Issue: Clicking components doesn't open them in your editor.

Solutions:

// Explicitly specify your editor
reactDevToolsPlus({
  launchEditor: 'code', // or 'cursor', 'webstorm', etc.
})

Ensure your editor's command-line tool is installed:

  • VS Code: Install code command via Command Palette → "Shell Command: Install 'code' command in PATH"
  • Cursor: Similar to VS Code
  • WebStorm: Ensure webstorm command is in PATH

Components Not Showing in Tree

Issue: Some components are missing from the DevTools tree.

Solutions:

  • Ensure you're using React 16.8+ (Hooks required)
  • Check that components are mounted and rendered
  • Verify React DevTools is instrumenting Fiber roots (check console for initialization logs)
  • Try refreshing the DevTools panel

DevTools Affecting Production Build

Issue: DevTools code appears in production bundle.

Solutions: The plugin should automatically exclude itself from production builds. Verify:

// vite.config.ts
export default defineConfig(({ mode }) => ({
  plugins: [
    react(),
    // Plugin is dev-only by default
    reactDevToolsPlus(),
  ],
}))

If issues persist:

// Explicitly guard
export default defineConfig(({ mode }) => ({
  plugins: [
    react(),
    mode === 'development' && reactDevToolsPlus(),
  ].filter(Boolean),
}))

Custom Base Path Not Working

Issue: DevTools not accessible at custom path.

Solutions:

// Ensure base includes leading and trailing slashes
reactDevToolsPlus({
  base: '/__custom_path__', // Correct
  // NOT: base: 'custom_path' or base: '/custom_path'
})

Then navigate to: http://localhost:5173/__custom_path__/

Project Structure

React DevTools Plus is a monorepo with the following key packages:

  • react-devtools - Main Vite/Webpack plugin
  • react-devtools-client - DevTools UI client
  • react-devtools-core - Core functionality and plugin system
  • react-devtools-kit - State management and messaging
  • react-devtools-overlay - Floating overlay component
  • react-devtools-scan - Render scanning utilities

Development

If you need to contribute or debug the plugin itself:

# Clone the repository
git clone https://github.com/wzc520pyfm/react-devtools-plus.git
cd react-devtools-plus

# Install dependencies
pnpm install

# Start development mode
pnpm dev

# Run Vite playground
pnpm play

# Run Webpack playground
pnpm play:webpack

# Build all packages
pnpm build

# Run tests
pnpm test

# Lint code
pnpm lint

Resources

  • Documentation: https://react-devtools-plus.netlify.app/
  • GitHub: https://github.com/wzc520pyfm/react-devtools-plus
  • Issues: https://github.com/wzc520pyfm/react-devtools-plus/issues
  • License: MIT

相关技能

Agent 工作流

Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…