← Back to Skills Marketplace
bovinphang

Web Workers

by Bovin Phang · GitHub ↗ · v2.6.0 · MIT-0
cross-platform ✓ Security Clean
45
Downloads
1
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install fec-web-workers
Description
Use when moving expensive browser work off the main thread with Web Workers, SharedWorker, worker pools, Comlink, transferable objects, Vite/Webpack worker i...
README (SKILL.md)

Web Workers

Purpose

把昂贵计算移出主线程,保持输入、滚动和动画响应。

Procedure

  1. 先确认瓶颈:任务超过约 10ms、用户输入延迟明显、FPS 下滑或大文件解析/图像处理/加密计算才考虑 Worker。
  2. 选择通信模型:简单任务用 postMessage,函数式 RPC 用 Comlink,大量并行小任务用 Worker pool,跨 Tab 同步用 SharedWorker。
  3. 设计消息协议:请求/响应类型、错误类型、取消或超时策略都要明确。
  4. 传大对象时优先 Transferable Objects;不要让结构化克隆吞掉 Worker 带来的收益。
  5. 在组件或页面卸载时 terminate(),并通过 Profiler、Performance 面板或 FPS 指标验证主线程改善。

详细参考

  • 需要原生 Worker 文件、构建工具导入、React 生命周期封装和清理示例时,加载 references/basic-worker.md
  • 需要 Transferable Objects、Comlink、Worker pool、SharedWorker、CSP 和 SharedArrayBuffer 注意事项时,加载 references/advanced-workers.md

Constraints

  • Worker 内不能访问 DOM、windowdocumentalert() 或同步 localStorage
  • 高频通信可能比主线程计算更慢;先测量再拆分。
  • Worker 文件必须同源加载,并受 worker-src CSP 限制。
  • 大型二进制数据优先 transfer,transfer 后原引用会失效。
  • 每个 Worker 有独立 JS 堆,必须主动管理生命周期和内存。

Expected Output

计算密集型操作在后台线程执行,主线程输入和滚动恢复流畅,错误与取消路径明确,Worker 在卸载时被终止且无内存泄漏。

Usage Guidance
Install only if you expect ClawHub/Convex maintenance workflows. Pay particular attention before using the autoreview helper because its default nested Codex review runs with full-access sandbox bypass; use its no-yolo option if you want normal sandbox prompts. For moderation, migrations, deploys, or PR publishing, confirm the exact target and dry-run where supported.
Capability Assessment
Purpose & Capability
The artifacts describe repo-maintenance, moderation, UI proof, code review, and Convex development workflows that match the stated skill purposes.
Instruction Scope
Some workflows involve high-impact actions such as staff moderation, PR comments, production Convex deploys, migrations, and nested code review, but the instructions generally require explicit targets, confirmation, dry runs, or human handoff.
Install Mechanism
No install-time execution, hidden package hooks, obfuscated code, or automatic persistence was found in the skill artifacts.
Credentials
The bundled autoreview helper defaults to running nested Codex review with full-access sandbox bypass, which is explicitly disclosed and opt-out but broader than ordinary review needs.
Persistence & Privilege
The skills may use existing CLI auth, GitHub/Convex credentials, temporary artifacts, and optional output files during user-invoked workflows; no hidden credential capture, background worker, or unbounded persistence was evident.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install fec-web-workers
  3. After installation, invoke the skill by name or use /fec-web-workers
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v2.6.0
- Version bump to 2.5.1 with no file changes detected. - No updates to documentation, code, or procedures in this release.
v2.5.0
- Expanded documentation with detailed procedures for using Web Workers, SharedWorker, worker pools, Comlink, and transferable objects. - Updated requirements for when and how to offload work from the main thread. - Added clearer constraints, including communication strategies, resource management, and expected output. - Included references for basic and advanced examples, covering integration, lifecycle, and security considerations.
Metadata
Slug fec-web-workers
Version 2.6.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Web Workers?

Use when moving expensive browser work off the main thread with Web Workers, SharedWorker, worker pools, Comlink, transferable objects, Vite/Webpack worker i... It is an AI Agent Skill for Claude Code / OpenClaw, with 45 downloads so far.

How do I install Web Workers?

Run "/install fec-web-workers" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Web Workers free?

Yes, Web Workers is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Web Workers support?

Web Workers is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Web Workers?

It is built and maintained by Bovin Phang (@bovinphang); the current version is v2.6.0.

💬 Comments