webview-ui
БесплатноБез исполняемых скриптовНе проверенThis skill should be used when the user asks to "create a web UI", "add a WebView", "build an HTML interface", "use Svelte", "use p5.js", "use three.js", "use…
от iPlug2★ 2 458 звёзд на GitHubОб этом скилле
WebView UI Authoring
Guidance for building WebView-based UIs in iPlug2 plugins. Covers integration mode selection, C++/JS messaging, web framework setup, resource loading, hot reloading, and audio-to-UI visualization.
Core Pattern
Every full-WebView plugin sets up its editor in the constructor via mEditorInitFunc:
// In plugin constructor
#ifdef DEBUG
SetEnableDevTools(true);
#endif
SetCustomUrlScheme("iplug2"); // optional, needed for some frameworks
mEditorInitFunc = [&]() {
LoadIndexHtml(__FILE__, GetBundleID());
// OR for hot-reload development:
// LoadURL("http://localhost:5173/");
EnableScroll(false);
};
The plugin class inherits from Plugin. The build configuration must define WEBVIEW_EDITOR_DELEGATE and NO_IGRAPHICS so the delegate selection header (IPlugDelegate_select.h) routes to WebViewEditorDelegate.
On the web side, provide resources/web/index.html as the entry point. The C++ side automatically injects IPlugSendMsg() as the JS-to-native bridge function.
Reference examples: Examples/IPlugWebUI/ (minimal), Examples/IPlugSvelteUI/ (modern framework), Examples/IPlugP5js/ (creative coding).
Choosing an Integration Mode
| Scenario | Mode | Key Setup |
|---|---|---|
| Entire UI is web content | Full WebView (WebViewEditorDelegate) |
Define WEBVIEW_EDITOR_DELEGATE + NO_IGRAPHICS, use mEditorInitFunc |
| Mix of native IGraphics + embedded web panel | Embedded (IWebViewControl) |
Normal IGraphics setup, attach IWebViewControl in layout lambda |
| Quick HTML display (logs, status) | Embedded (IWebViewControl) with LoadHTML() |
Attach IWebViewControl, call LoadHTML(str) directly |
Choosing a Web Framework
| Need | Framework | Build Step | Example |
|---|---|---|---|
| Simplest, no tooling | Raw HTML/CSS/JS + Web Components | None | Examples/IPlugWebUI/ |
| Creative coding / shaders | p5.js (bundled directly) | None | Examples/IPlugP5js/ |
| Modern reactive UI, TypeScript | Svelte + Vite | npm run build |
Examples/IPlugSvelteUI/ |
| Component-heavy UI | React / Vue + Vite | npm run build |
Follow Svelte pattern |
| 3D visualization | three.js (bundled or via npm) | Optional | Follow p5.js or Svelte pattern |
For detailed framework setup and hot reloading, consult references/framework-selection.md.
JavaScript Bridge Functions
JS to C++ (send via IPlugSendMsg(jsonObj)):
| Function | Purpose | Key Fields |
|---|---|---|
SPVFUI(paramIdx, value) |
Send parameter value (normalized 0-1) | paramIdx, value |
BPCFUI(paramIdx) |
Begin parameter change gesture | paramIdx |
EPCFUI(paramIdx) |
End parameter change gesture | paramIdx |
SAMFUI(msgTag, ctrlTag, data) |
Send arbitrary message (base64 data) | msgTag, ctrlTag, data |
SMMFUI(statusByte, d1, d2) |
Send MIDI message | statusByte, dataByte1, dataByte2 |
C++ to JS (called automatically via EvaluateJavaScript):
| Function | Purpose | Called By |
|---|---|---|
SPVFD(paramIdx, normalizedValue) |
Parameter value changed | SendParameterValueFromDelegate |
SCVFD(ctrlTag, value) |
Control value changed | SendControlValueFromDelegate |
SCMFD(ctrlTag, msgTag, dataSize, base64) |
Control message (ISender data) | SendControlMsgFromDelegate |
SAMFD(msgTag, dataSize, base64) |
Arbitrary message (incl. params init) | SendArbitraryMsgFromDelegate |
SMMFD(statusByte, d1, d2) |
MIDI message | SendMidiMsgFromDelegate |
For the complete messaging protocol, JSON schemas, and binary data exchange, consult references/messaging-protocol.md.
Parameter Handling from JavaScript
Parameters require a three-step gesture protocol for proper DAW undo/automation:
// 1. Begin gesture (e.g. on mousedown)
BPCFUI(paramIdx);
// 2. Send values during drag (normalized 0-1)
SPVFUI(paramIdx, normalizedValue);
// 3. End gesture (e.g. on mouseup)
EPCFUI(paramIdx);
On page load, WebViewEditorDelegate automatically sends all parameter info as a JSON blob via SAMFD with msgTag == -1. Decode it in your SAMFD handler:
function SAMFD(msgTag, dataSize, msg) {
if (msgTag == -1 && dataSize > 0) {
let json = JSON.parse(atob(msg));
if (json.id === "params") {
// json.params is an array of {name, type, min, max, default, ...}
// Use this to configure your UI controls
}
}
}
Parameter changes from the C++ side arrive via SPVFD(paramIdx, normalizedValue). Define this function globally to handle them.
Audio-to-UI Data (ISender to WebView)
The C++ side is identical to IGraphics -- declare a sender, feed it in ProcessBlock, transmit in OnIdle:
// .h
IPeakSender<2> mSender;
enum EControlTags { kCtrlTagMeter = 0 };
// ProcessBlock
mSender.ProcessBlock(outputs, nFrames, kCtrlTagMeter);
// OnIdle
mSender.TransmitData(*this);
Установить webview-ui в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл webview-ui?
This skill should be used when the user asks to "create a web UI", "add a WebView", "build an HTML interface", "use Svelte", "use p5.js", "use three.js", "use React", "use web components", "send messages to JavaScript", "receive messages from JavaScript", "hot reload the UI", "use IWebViewControl", "embed a WebView", "WebView editor delegate", "use IPlugSendMsg", "web-based plugin UI", "load HTML in plugin", "use Vite", or discusses WebView setup, JS/C++ messaging, or web framework integration in an iPlug2 plugin.
Как установить скилл webview-ui?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл webview-ui запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic