lichtblick-suite/lichtblick/web-workers
Claude Code and agent skill by lichtblick-suite/lichtblick
- community
Checking that the SKILL.md file is still in the repository.
Web Worker patterns used throughout the Lichtblick codebase: Comlink integration, ComlinkWrap lifecycle, transfer handlers, OffscreenCanvas, SharedWorker isolation, and testing utilities.
Install
npx vskill@latest install lichtblick-suite/lichtblick/web-workersSKILL.md
The same SKILL.md was published earlier as lichtblick-suite/lichtblick/web-workers.
Web Workers Skill
Standard Pattern: ComlinkWrap
All Worker communication in Lichtblick uses Comlink with the ComlinkWrap utility for safe lifecycle management.
Worker Creation (main thread)
Worker Implementation (worker thread)
Key file: packages/den/worker/ComlinkWrap.ts
FinalizationRegistry Cleanup
ComlinkWrap returns a dispose function, but the project also uses FinalizationRegistry as a safety net:
This prevents Worker leaks if the wrapping object is GC'd without explicit disposal.
Transfer Handlers
AbortSignal Transfer
Allows passing AbortSignal across Worker boundaries — used by WorkerIterableSource to cancel iteration.
OffscreenCanvas Transfer
Used by: Plot panel (OffscreenCanvasRenderer), Chart component.
ArrayBuffer Transfer
Worker URL Pattern (Webpack)
All Worker URLs use the import.meta.url pattern for webpack compatibility:
- File must be named
*.worker.ts(webpack recognizes this pattern) babel-plugin-transform-import-metahandles the URL resolution- Each Worker file is bundled as a separate chunk
SharedWorker Pattern
Used by UserScriptPlayer for script execution:
SharedWorkerchosen for memory efficiency (shared code across script instances)- Unique
nameper instance prevents cross-tab Worker sharing (intentional isolation)
Testing Workers
makeComlinkWorkerMock
Located in packages/den/testing/makeComlinkWorkerMock.ts:
- Creates an in-process Comlink channel (no actual Worker thread)
- Allows unit testing Worker-based code without spawning real threads
- Uses
EventEmitterto simulatepostMessage/onmessage
Workers in the Codebase
| Location | Purpose | Pattern | |
|---|---|---|---|
IterablePlayer/WorkerIterableSource.ts | Data source parsing | ComlinkWrap + AbortSignal | |
Plot/OffscreenCanvasRenderer.ts | Chart.js rendering | ComlinkWrap + OffscreenCanvas | |
Plot/builders/TimestampDatasetsBuilder.ts | Dataset building | ComlinkWrap + FinalizationRegistry | |
ThreeDeeRender/renderables/Images/WorkerImageDecoder.ts | Image decoding | ComlinkWrap | |
UserScriptPlayer/index.ts | Script execution | SharedWorker + unique name | |
FoxgloveWebSocketPlayer/WorkerSocketAdapter.ts | WebSocket I/O | Raw Worker + postMessage | |
components/Chart/index.tsx | Legacy chart rendering | WebWorkerManager + Rpc |
Performance Considerations
- Transfer vs Copy: Always use
Comlink.transfer()for large ArrayBuffers - Worker startup: Workers are created lazily — first use incurs startup cost
- Proxy cleanup: Always call
dispose()or rely on FinalizationRegistry - Message overhead: Small frequent messages have higher overhead than batched large messages
- SharedWorker caveats: Debugging is harder (separate DevTools), errors may be silent
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/web-workers/SKILL.md
Popularity
- Repository stars
- 1,152
- Repository forks
- 750
- 7-day trend score
- 35
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/lichtblick-suite/lichtblick/web-workers)