writing-vite-devtools-integrations

Build custom Vite DevTools integrations for plugins with docks, views, and RPC functions.

169|3|Updated Jun 16, 2025
One-click install
npx skills add https://github.com/yuyinws/oxc-inspector --skill writing-vite-devtools-integrations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-vite-devtools-integrations
Source: https://github.com/yuyinws/oxc-inspector/tree/main/.agents/skills/writing-vite-devtools-integrations
Command: npx skills add https://github.com/yuyinws/oxc-inspector --skill writing-vite-devtools-integrations

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

DevTools integration for Vite plugins is fragmented and hard to standardize, making it difficult to expose docks, RPC surfaces, and shared state to users in a cohesive UI.

Core Features & Use Cases

  • Host static UI and docks via ctx.views and ctx.docks to expose a plugin UI inside DevTools.
  • Register RPC functions and shared state via @vitejs/devtools-kit to enable cross-context communication.
  • Provide end-to-end examples and best practices for hosting assets, client scripts, and references.

Quick Start

Create a minimal Vite plugin that implements devtools.setup(ctx) to register docks, views, and RPC surfaces.

Frequently Asked Questions about writing-vite-devtools-integrations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add custom docks and views to Vite DevTools from a plugin?

To add custom docks and views to Vite DevTools, your Vite plugin must implement the devtools.setup(ctx) lifecycle hook, exposing UI surfaces through ctx.docks and ctx.views to render your plugin interface inside the DevTools panel.

How does RPC communication work between Vite plugin backends and DevTools UI?

RPC communication in Vite DevTools integration works by registering RPC functions and shared state via the @vitejs/devtools-kit, enabling cross-context communication between the plugin backend and the DevTools UI client.

What's the best way to standardize Vite plugin DevTools integration across docks and shared state?

The best way to standardize Vite plugin DevTools integration is to use the @vitejs/devtools-kit to register shared state and RPC surfaces, hosting client scripts and static assets through a cohesive devtools.setup(ctx) implementation.

Do I need @vitejs/devtools-kit to expose plugin state to the Vite DevTools UI?

Yes, you need @vitejs/devtools-kit to expose plugin state to the Vite DevTools UI, as it provides the necessary utilities for registering RPC functions and shared state required for cross-context communication between plugin and DevTools.

Can I host static assets and client scripts inside Vite DevTools from my plugin?

You can host static assets and client scripts inside Vite DevTools by implementing devtools.setup(ctx) in your plugin, using ctx.views and ctx.docks to expose UI elements and serve assets directly within the DevTools interface.

Why is my Vite plugin not showing up in DevTools after registering docks?

If your Vite plugin is not showing up in DevTools after registering docks, ensure your plugin correctly implements the devtools.setup(ctx) hook and that shared state and RPC functions are properly registered through @vitejs/devtools-kit for cross-context communication.