PA

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.zip

Installs 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.
205 charsno explicit “when” trigger
Advanced

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

You give it
TypeScript code in Monaco editor
You get back
Compiled JS bundle executed in a sandboxed runtime worker

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

FileRole
panels/UserScriptEditor/Monaco editor UI, diagnostics display
players/UserScriptPlayer/index.tsPlayer wrapper, Worker pool management
players/UserScriptPlayer/transformerWorker/TypeScript compilation in a Worker
players/UserScriptPlayer/runtimeWorker/Sandboxed script execution

Script Lifecycle

  1. User writes TypeScript in Monaco
  2. On save: code is sent to the Transformer Worker for compilation
  3. Transformer compiles TS → JS and reports diagnostics (errors/warnings)
  4. On success: the JS bundle is sent to the Runtime Worker
  5. During playback: messages on input topics → Runtime Worker → output messages
  6. Output messages are injected into PlayerState as 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(),
});
  • SharedWorker is 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.ts
  • packages/suite-base/src/players/UserScriptPlayer/transformerWorker/
  • packages/suite-base/src/players/UserScriptPlayer/runtimeWorker/

Skills Reference

  • For SharedWorker patterns: load web-workers skill

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.

SkillInstallsUpdatedSafetyDifficulty
panel-user-scripts (this skill)01moNo flagsAdvanced
playwright-browser-automation297moReviewIntermediate
desktop92moNo flagsAdvanced
browser-extension-builder66moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

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.

29146

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.

941

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.

637

stitch-loop

google-labs-code

Teaches agents to iteratively build websites using Stitch with an autonomous baton-passing loop pattern

29

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.

10

e2e

AsiaOstrich

[UDS] 從 BDD 場景生成 E2E 測試骨架,支援框架偵測與覆蓋差距分析

00

Search skills

Search the agent skills registry