Agent skill

Writing Vite Devtools Integrations

by yuyinws in yuyinws/oxc-inspector

Creates devtools integrations for Vite using @vitejs/devtools-kit.

MITAuto-check passedDevelopment

Install Writing Vite Devtools Integrations

skills CLI
$ npx skills add yuyinws/oxc-inspector --skill writing-vite-devtools-integrations -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install yuyinws/oxc-inspector writing-vite-devtools-integrations --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/yuyinws/oxc-inspector.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/writing-vite-devtools-integrations .claude/skills/writing-vite-devtools-integrations && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
writing-vite-devtools-integrations
GitHub stars
169
Token cost
~2k tokens
SKILL.md length
263 words
Files
5 (incl. references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Creates devtools integrations for Vite using @vitejs/devtools-kit.

  • Works in 6 steps: Always namespace - Prefix all… → Use type augmentation - Extend… → Keep state serializable - No functions… → …
  • Building Vite plugins with devtools panels
  • SKILL.md covers Core Concepts, Quick Start: Minimal Plugin, Quick Start: Full Integration and Namespacing Convention, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Writing Vite Devtools Integrations is an agent skill from yuyinws/oxc-inspector. Creates devtools integrations for Vite using @vitejs/devtools-kit. Use when building Vite plugins with devtools panels, RPC functions, dock entries, shared state, or any devtools-related functionality. Applies to files importing from @vitejs/devtools-kit or containing devtools.setup hooks in Vite plugins.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/dock-entry-types.md`, `references/project-structure.md` and `references/rpc-patterns.md`).

It sits in Development. It works with Vite. The repository describes itself as: Inspect and understand the Oxc toolchain with ease. The licence is MIT.

When your agent uses it

  • Building Vite plugins with devtools panels
  • Any devtools-related functionality

Example prompts

  • “Use the writing-vite-devtools-integrations skill to create devtools integrations for Vite using @vitejs/devtools-kit”
  • “/writing-vite-devtools-integrations”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Always namespace - Prefix all identifiers with your plugin name
  2. Use type augmentation - Extend DevToolsRpcServerFunctions for type-safe RPC
  3. Keep state serializable - No functions or circular references in shared state
  4. Batch mutations - Use single mutate() call for multiple changes
  5. Host static files - Use ctx.views.hostStatic() for your UI assets
  6. Use Iconify icons - Prefer ph:* (Phosphor) icons: icon: 'ph:chart-bar-duotone'

What it can do on your machine

Read from SKILL.md and the folder at commit d00072a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript and json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Writing Vite Devtools Integrations loads about 2k tokens when it runs, and up to ~7.2k if it reads all its reference files. Until then it costs about 85 tokens; SKILL.md has 263 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~85
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from yuyinws/oxc-inspector at commit d00072a, republished under its MIT licence (© yuyinws). 263 words, ~2,043 tokens.

Download SKILL.mdSave it as .claude/skills/writing-vite-devtools-integrations/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
writing-vite-devtools-integrations
description
Creates devtools integrations for Vite using @vitejs/devtools-kit. Use when building Vite plugins with devtools panels, RPC functions, dock entries, shared state, or any devtools-related functionality. Applies to files importing from @vitejs/devtools-kit or containing devtools.setup hooks in Vite plugins.

Vite DevTools Kit

Build custom developer tools that integrate with Vite DevTools using @vitejs/devtools-kit.

Core Concepts

A DevTools plugin extends a Vite plugin with a devtools.setup(ctx) hook. The context provides:

PropertyPurpose
ctx.docksRegister dock entries (iframe, action, custom-render)
ctx.viewsHost static files for UI
ctx.rpcRegister RPC functions, broadcast to clients
ctx.rpc.sharedStateSynchronized server-client state
ctx.viteConfigResolved Vite configuration
ctx.viteServerDev server instance (dev mode only)
ctx.mode'dev' or 'build'

Quick Start: Minimal Plugin

ts
/// <reference types="@vitejs/devtools-kit" />
import type { Plugin } from 'vite'

export default function myPlugin(): Plugin {
  return {
    name: 'my-plugin',
    devtools: {
      setup(ctx) {
        ctx.docks.register({
          id: 'my-plugin',
          title: 'My Plugin',
          icon: 'ph:puzzle-piece-duotone',
          type: 'iframe',
          url: 'https://example.com/devtools',
        })
      },
    },
  }
}

Quick Start: Full Integration

ts
/// <reference types="@vitejs/devtools-kit" />
import type { Plugin } from 'vite'
import { fileURLToPath } from 'node:url'
import { defineRpcFunction } from '@vitejs/devtools-kit'

export default function myAnalyzer(): Plugin {
  const data = new Map<string, { size: number }>()

  return {
    name: 'my-analyzer',

    // Collect data in Vite hooks
    transform(code, id) {
      data.set(id, { size: code.length })
    },

    devtools: {
      setup(ctx) {
        // 1. Host static UI
        const clientPath = fileURLToPath(new URL('../dist/client', import.meta.url))
        ctx.views.hostStatic('/.my-analyzer/', clientPath)

        // 2. Register dock entry
        ctx.docks.register({
          id: 'my-analyzer',
          title: 'Analyzer',
          icon: 'ph:chart-bar-duotone',
          type: 'iframe',
          url: '/.my-analyzer/',
        })

        // 3. Register RPC function
        ctx.rpc.register(
          defineRpcFunction({
            name: 'my-analyzer:get-data',
            type: 'query',
            setup: () => ({
              handler: async () => Array.from(data.entries()),
            }),
          }),
        )
      },
    },
  }
}

Namespacing Convention

CRITICAL: Always prefix RPC functions, shared state keys, and dock IDs with your plugin name:

ts
// Good - namespaced
'my-plugin:get-modules'
'my-plugin:state'

// Bad - may conflict
'get-modules'
'state'

Dock Entry Types

TypeUse Case
iframeFull UI panels, dashboards (most common)
actionButtons that trigger client-side scripts (inspectors, toggles)
custom-renderDirect DOM access in panel (framework mounting)
Iframe Entry
ts
ctx.docks.register({
  id: 'my-plugin',
  title: 'My Plugin',
  icon: 'ph:house-duotone',
  type: 'iframe',
  url: '/.my-plugin/',
})
Action Entry
ts
ctx.docks.register({
  id: 'my-inspector',
  title: 'Inspector',
  icon: 'ph:cursor-duotone',
  type: 'action',
  action: {
    importFrom: 'my-plugin/devtools-action',
    importName: 'default',
  },
})
Custom Render Entry
ts
ctx.docks.register({
  id: 'my-custom',
  title: 'Custom View',
  icon: 'ph:code-duotone',
  type: 'custom-render',
  renderer: {
    importFrom: 'my-plugin/devtools-renderer',
    importName: 'default',
  },
})

RPC Functions

Server-Side Definition
ts
import { defineRpcFunction } from '@vitejs/devtools-kit'

const getModules = defineRpcFunction({
  name: 'my-plugin:get-modules',
  type: 'query', // 'query' | 'action' | 'static'
  setup: ctx => ({
    handler: async (filter?: string) => {
      // ctx has full DevToolsNodeContext
      return modules.filter(m => !filter || m.includes(filter))
    },
  }),
})

// Register in setup
ctx.rpc.register(getModules)
Client-Side Call (iframe)
ts
import { getDevToolsRpcClient } from '@vitejs/devtools-kit/client'

const rpc = await getDevToolsRpcClient()
const modules = await rpc.call('my-plugin:get-modules', 'src/')
Client-Side Call (action/renderer script)
ts
import type { DevToolsClientScriptContext } from '@vitejs/devtools-kit/client'

export default function setup(ctx: DevToolsClientScriptContext) {
  ctx.current.events.on('entry:activated', async () => {
    const data = await ctx.current.rpc.call('my-plugin:get-data')
  })
}
Broadcasting to Clients
ts
// Server broadcasts to all clients
ctx.rpc.broadcast({
  method: 'my-plugin:on-update',
  args: [{ changedFile: '/src/main.ts' }],
})

Type Safety

Extend the DevTools Kit interfaces for full type checking:

ts
// src/types.ts
import '@vitejs/devtools-kit'

declare module '@vitejs/devtools-kit' {
  interface DevToolsRpcServerFunctions {
    'my-plugin:get-modules': (filter?: string) => Promise<Module[]>
  }

  interface DevToolsRpcClientFunctions {
    'my-plugin:on-update': (data: { changedFile: string }) => void
  }

  interface DevToolsRpcSharedStates {
    'my-plugin:state': MyPluginState
  }
}

Shared State

Server-Side
ts
const state = await ctx.rpc.sharedState.get('my-plugin:state', {
  initialValue: { count: 0, items: [] },
})

// Read
console.log(state.value())

// Mutate (auto-syncs to clients)
state.mutate(draft => {
  draft.count += 1
  draft.items.push('new item')
})
Client-Side
ts
const client = await getDevToolsRpcClient()
const state = await client.rpc.sharedState.get('my-plugin:state')

// Read
console.log(state.value())

// Subscribe to changes
state.on('updated', newState => {
  console.log('State updated:', newState)
})

Client Scripts

For action buttons and custom renderers:

ts
// src/devtools-action.ts
import type { DevToolsClientScriptContext } from '@vitejs/devtools-kit/client'

export default function setup(ctx: DevToolsClientScriptContext) {
  ctx.current.events.on('entry:activated', () => {
    console.log('Action activated')
    // Your inspector/tool logic here
  })

  ctx.current.events.on('entry:deactivated', () => {
    console.log('Action deactivated')
    // Cleanup
  })
}

Export from package.json:

json
{
  "exports": {
    ".": "./dist/index.mjs",
    "./devtools-action": "./dist/devtools-action.mjs"
  }
}

Best Practices

  1. Always namespace - Prefix all identifiers with your plugin name
  2. Use type augmentation - Extend DevToolsRpcServerFunctions for type-safe RPC
  3. Keep state serializable - No functions or circular references in shared state
  4. Batch mutations - Use single mutate() call for multiple changes
  5. Host static files - Use ctx.views.hostStatic() for your UI assets
  6. Use Iconify icons - Prefer ph:* (Phosphor) icons: icon: 'ph:chart-bar-duotone'

Further Reading

© yuyinws, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in .agents/skills/writing-vite-devtools-integrations of yuyinws/oxc-inspector.

  • SKILL.md
  • references/dock-entry-types.md
  • references/project-structure.md
  • references/rpc-patterns.md
  • references/shared-state-patterns.md

Open the folder on GitHubat commit d00072a

Compare with similar skills

Writing Vite Devtools Integrations next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Writing Vite Devtools Integrations compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Writing Vite Devtools Integrations this skillyuyinws/oxc-inspector169—~2kAutomated safety check: PassMIT
LangBot Core Developmentlangbot-app/LangBot18k—~1.4kAutomated safety check: NotesApache-2.0
Dev Serverlablup/backend.ai-webui133—~7.5kAutomated safety check: NotesLGPL-3.0
Faasjs Project Workflowfaasjs/faasjs121—~577Automated safety check: PassMIT
Claimable Postgreshenryalouf/ruflow157—~2.4kAutomated safety check: NotesMIT
Power Apps Code App Scaffoldgithub/awesome-copilot40k1 repos~1.8kAutomated safety check: PassMIT

Similar skills

  • LangBot Core Development

    langbot-app/LangBot

    Covers developing the LangBot core backend and web UI: dev setup, repo layout, API auth types, adding endpoints, migrations and keeping the MCP server in step.

    18k GitHub stars~1.4k tokensUpdated today
    DevelopmentAuto-check: notes
  • Dev Server

    lablup/backend.ai-webui

    Start the project's development server (pnpm dev for backend.ai-webui; discovered from README/package.json elsewhere), deriving the header color, app name, default backend endpoint and login…

    133 GitHub stars~7.5k tokensUpdated today
    DevelopmentAuto-check: notes
  • A skill your agent uses when creating, configuring, reviewing, or onboarding a FaasJS project; working with create-faas-app, vp CLI, TypeScript or Vite config, feature folders, file and naming…

    121 GitHub stars~577 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Claimable Postgres

    henryalouf/ruflow

    Provision instant temporary Postgres databases via Claimable Postgres by Neon (pg.new).

    157 GitHub stars~2.4k tokensUpdated 4 mo ago
    DevelopmentAuto-check: notes
  • Power Apps Code App Scaffold

    github/awesome-copilot

    Official

    Scaffold a complete Power Apps Code App project with PAC CLI setup, SDK integration, and connector configuration

    40k GitHub starsUsed in 1 repo~1.8k tokens
    DevelopmentAuto-check passed
  • Starts a Dozzle dev server on a port derived from the current worktree so you can test by hand in a browser, without disturbing instances started elsewhere.

    15k GitHub stars~747 tokensUpdated today
    DevelopmentAuto-check passed

Works with

Questions about Writing Vite Devtools Integrations

What does Writing Vite Devtools Integrations do?

Creates devtools integrations for Vite using @vitejs/devtools-kit. Writing Vite Devtools Integrations is an agent skill from yuyinws/oxc-inspector. Creates devtools integrations for Vite using @vitejs/devtools-kit.

When should I use Writing Vite Devtools Integrations?

Writing Vite Devtools Integrations fits situations like: building Vite plugins with devtools panels; any devtools-related functionality.

How do I install Writing Vite Devtools Integrations in Claude Code?

Run `npx skills add yuyinws/oxc-inspector --skill writing-vite-devtools-integrations -a claude-code`. Or copy the skill folder (.agents/skills/writing-vite-devtools-integrations in yuyinws/oxc-inspector) into .claude/skills/writing-vite-devtools-integrations in your project. Claude Code loads it when a task matches its description.

How do I install Writing Vite Devtools Integrations in Codex?

Run `npx skills add yuyinws/oxc-inspector --skill writing-vite-devtools-integrations -a codex`. Or copy the skill folder (.agents/skills/writing-vite-devtools-integrations in yuyinws/oxc-inspector) into .agents/skills/writing-vite-devtools-integrations in your project. Codex loads it when a task matches its description.

Can I use Writing Vite Devtools Integrations in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add yuyinws/oxc-inspector --skill writing-vite-devtools-integrations -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/writing-vite-devtools-integrations, .gemini/skills/writing-vite-devtools-integrations, .github/skills/writing-vite-devtools-integrations and .opencode/skills/writing-vite-devtools-integrations in your project.

What does Writing Vite Devtools Integrations need to run?

SKILL.md names no scripts, command-line tools or credentials: Writing Vite Devtools Integrations is instructions for the agent only.

Does Writing Vite Devtools Integrations access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Writing Vite Devtools Integrations safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Writing Vite Devtools Integrations use?

Writing Vite Devtools Integrations is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Writing Vite Devtools Integrations use?

About 2k tokens (SKILL.md is roughly 8.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.1k tokens, read only when the agent opens those files.

What are the alternatives to Writing Vite Devtools Integrations?

Skills that share tags, products or a category with Writing Vite Devtools Integrations: LangBot Core Development (langbot-app/LangBot, 18k stars), Dev Server (lablup/backend.ai-webui, 133 stars), Faasjs Project Workflow (faasjs/faasjs, 121 stars) and Claimable Postgres (henryalouf/ruflow, 157 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Writing Vite Devtools Integrations?

yuyinws (a GitHub user) maintains it in yuyinws/oxc-inspector, which has 169 GitHub stars. The repository was last updated on July 15, 2026.

Source: yuyinws/oxc-inspector on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.