panel-user-scripts
Technical reference for developing and debugging Panel UserScripts.
Install
mkdir -p .claude/skills/panel-user-scripts && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10429" && unzip -o skill.zip -d .claude/skills/panel-user-scripts && rm skill.zipInstalls to .claude/skills/panel-user-scripts
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Deep UserScripts panel knowledge: Monaco editor integration, UserScriptPlayer wrapper, TypeScript compilation in the transformer Worker, sandboxed runtime Worker execution, diagnostics, and the script API.Key capabilities
- →Write custom message transformations in TypeScript
- →Compile TypeScript code within a dedicated worker
- →Execute user scripts in a sandboxed runtime environment
- →Display inline diagnostics and errors in the editor
- →Manage script lifecycle through a player wrapper
How it works
The system uses a transformer worker to compile TypeScript into JavaScript, which is then executed in an isolated runtime worker to process message events.
Inputs & outputs
When to use panel-user-scripts
- →Developing user script features
- →Debugging script compilation
- →Managing worker environments
About this skill
Panel User Scripts Skill
The in-app TypeScript editor that lets users write custom message transformations.
Architecture
UserScripts Panel (Monaco editor)
│
▼
UserScriptPlayer (wraps the base Player)
│
├── Transformer Worker (compiles + reports diagnostics)
│ └── TypeScript compiler (in-Worker)
│
└── Runtime Worker (sandboxed script execution)
└── user code runs here (isolated)
Core Components
| File | Role |
|---|---|
panels/UserScriptEditor/ | Monaco editor UI, diagnostics display |
players/UserScriptPlayer/index.ts | Player wrapper, Worker pool management |
players/UserScriptPlayer/transformerWorker/ | TypeScript compilation in a Worker |
players/UserScriptPlayer/runtimeWorker/ | Sandboxed script execution |
Script Lifecycle
- User writes TypeScript in Monaco
- On save: code is sent to the Transformer Worker for compilation
- Transformer compiles TS → JS and reports diagnostics (errors/warnings)
- On success: the JS bundle is sent to the Runtime Worker
- During playback: messages on input topics → Runtime Worker → output messages
- Output messages are injected into
PlayerStateas additional topics
Worker Naming Pattern
// unique name per instance — isolates workers per tab (no cross-tab sharing)
new SharedWorker(new URL("./transformerWorker/index", import.meta.url), {
name: uuidv4(),
});
SharedWorkeris the worker type, but cross-tab instance reuse is disabled by unique naming.- Within a single player lifetime, runtime workers are reused/pooled where possible.
- Each active script processor maps to an isolated runtime execution context.
Monaco Integration
- Full TypeScript language service (autocomplete, errors, hover)
- Custom Lichtblick script-API type definitions injected
- Diagnostics shown inline and in a panel below the editor
Script API
export const inputs = ["/camera/image"];
export const output = "/processed_image";
export default function transform(event: MessageEvent): OutputMessage {
return {
/* processed data */
};
}
Performance Notes
- Script execution never blocks the main thread (Worker isolation)
- Unchanged scripts don't recompile (compilation caching)
- Only subscribed input topics are forwarded to the Worker
- Runtime errors in user code are contained — they don't crash the app
- Each Runtime Worker has its own heap (no cross-script interference)
Key Files
packages/suite-base/src/panels/UserScriptEditor/packages/suite-base/src/players/UserScriptPlayer/index.tspackages/suite-base/src/players/UserScriptPlayer/transformerWorker/packages/suite-base/src/players/UserScriptPlayer/runtimeWorker/
Skills Reference
- For SharedWorker patterns: load
web-workersskill
When not to use it
- →Tasks requiring main-thread blocking operations
Limitations
- →Cross-tab worker instance reuse is disabled by unique naming
- →Runtime workers are isolated with their own heap
How it compares
This architecture isolates script execution from the main application thread, preventing runtime errors from crashing the host app.
Compared to similar skills
panel-user-scripts side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| panel-user-scripts (this skill) | 0 | 1mo | No flags | Advanced |
| playwright-browser-automation | 29 | 7mo | Review | Intermediate |
| desktop | 9 | 2mo | No flags | Advanced |
| browser-extension-builder | 6 | 6mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by lichtblick-suite
View all by lichtblick-suite →You might also like
playwright-browser-automation
lackeyjb
Complete browser automation with Playwright. Auto-detects dev servers, writes clean test scripts to /tmp. Test pages, fill forms, take screenshots, check responsive design, validate UX, test login flows, check links, automate any browser task. Use when user wants to test websites, automate browser interactions, validate web functionality, or perform any browser-based testing.
desktop
lobehub
Electron desktop development guide. Use when implementing desktop features, IPC handlers, controllers, preload scripts, window management, menu configuration, or Electron-specific functionality. Triggers on desktop app development, Electron IPC, or desktop local tools implementation.
browser-extension-builder
davila7
Expert in building browser extensions that solve real problems - Chrome, Firefox, and cross-browser extensions. Covers extension architecture, manifest v3, content scripts, popup UIs, monetization strategies, and Chrome Web Store publishing. Use when: browser extension, chrome extension, firefox addon, extension, manifest v3.
stitch-loop
google-labs-code
Teaches agents to iteratively build websites using Stitch with an autonomous baton-passing loop pattern
writing-vite-devtools-integrations
vitejs
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.
e2e
AsiaOstrich
[UDS] 從 BDD 場景生成 E2E 測試骨架,支援框架偵測與覆蓋差距分析