AI-powered frontend development assistant — select any DOM element, ask Claude to help.
| Feature | Description |
|---|---|
| 🎯 Visual DOM Selection | Click any element on the page; automatically resolves data-insp-path to the source file and line number |
| 💬 AI Chat Panel | Floating chat window with multi-turn conversation, streaming output, and session memory |
| ⚡ Direct Claude Integration | Bridges the local claude CLI (or Anthropic API) with zero latency |
| 🔌 Vite Plugin | Zero-config integration — injects path attributes at build time and starts a WebSocket bridge during development |
┌─────────────────── Browser ─────────────────────────────────────┐
│ │
│ <koyi-overlay> ── Shadow DOM ──────────────────────────────┐ │
│ │ ┌────────────────────────────────────────────────────┐ │ │
│ │ │ Header (⚡ Koyi) [—] [✕] │ │ │
│ │ ├────────────────────────────────────────────────────┤ │ │
│ │ │ Messages (streaming Markdown) │ │ │
│ │ ├────────────────────────────────────────────────────┤ │ │
│ │ │ [Button.tsx:12] × | [+DOM] │ │ │
│ │ ├────────────────────────────────────────────────────┤ │ │
│ │ │ textarea [↑ Send] │ │ │
│ │ └────────────────────────────────────────────────────┘ │ │
│ └──────────────────────────────────────────────────────────┘ │
│ │
│ DOM Inspector (transparent overlay when picker active) │
│ hover → highlight element click → capture data-insp-path │
│ │
│ WebSocket ws://localhost:5173/__koyi_ws │
└──────────────────────────┬──────────────────────────────────────┘
│
┌──────────────── Vite Dev Server (Node.js) ──────────────────────┐
│ │
│ KoyiServer (upgrade handler) │
│ │ │
│ ├── Read source files from disk (±25 lines around cursor) │
│ └── ClaudeBridge │
│ ├── mode: 'cli' → spawn `claude --print <prompt>` │
│ └── mode: 'api' → @anthropic-ai/sdk streaming │
│ │
│ transformPlugin (Vite transform hook) │
│ └── @code-inspector/core transformCode() │
│ Injects data-insp-path="file:line:col" into every │
│ JSX/Vue/Svelte element at build time │
└──────────────────────────────────────────────────────────────────┘
pnpm installpnpm build:clientThis compiles the React overlay UI into a single IIFE bundle (
dist/client.iife.js). The Vite plugin injects it into every HTML page automatically.
pnpm playgroundOpen http://localhost:5173 — the ⚡ Koyi panel appears in the bottom-right corner.
Option A: Local Claude Code CLI (recommended)
npm install -g @anthropic-ai/claude-code
claude auth loginOption B: Anthropic API
export ANTHROPIC_API_KEY=sk-ant-...Switch in vite.config.ts:
KoyiPlugin({ claudeMode: 'api', apiKey: process.env.ANTHROPIC_API_KEY })pnpm add vite-plugin-koyi -D// vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { KoyiPlugin } from 'vite-plugin-koyi'
export default defineConfig({
plugins: [
...KoyiPlugin({
claudeMode: 'cli', // or 'api'
hotkey: 'ctrl+shift+k',
position: { x: 'right', y: 'bottom' },
}),
react(),
],
})- During development, open the page — the ⚡ Koyi floating panel appears in the bottom-right corner.
- Click 🎯 Pick Element in the panel to enter selection mode.
- Hover over any DOM element → blue highlight + filename tooltip.
- Click the target element → source context is read from disk; a chip tag appears.
- Type your question (e.g. "How do I add a hover effect to this button?") and send.
- Koyi sends the source snippet + HTML + your question to Claude and streams back the answer.
- Press
Ctrl+Shift+Kat any time to toggle the panel.
koyi/
├── packages/
│ ├── vite-plugin-koyi/ # The Vite plugin package
│ │ └── src/
│ │ ├── shared/types.ts # Shared types (WS protocol, DOM Context)
│ │ ├── node/
│ │ │ ├── index.ts # Plugin entry point, exports KoyiPlugin()
│ │ │ ├── server.ts # WebSocket server
│ │ │ └── claude-bridge.ts # Claude CLI/API bridge
│ │ └── client/
│ │ ├── index.ts # Web Component registration
│ │ ├── App.tsx # Floating panel root component
│ │ ├── components/
│ │ │ ├── ChatPanel.tsx # Chat interface
│ │ │ ├── DomInspector.tsx # DOM selector
│ │ │ ├── MessageItem.tsx # Message renderer (with code highlighting)
│ │ │ └── ContextTag.tsx # DOM context chip
│ │ └── hooks/
│ │ ├── useWebSocket.ts # WS connection management
│ │ └── useDrag.ts # Panel drag
│ └── playground/ # Test React application
└── README.md
# In one terminal — watch client changes
pnpm dev:plugin
# In another terminal — start the playground
pnpm playground