← 返回 Skills 市场
bovinphang

Web Workers

作者 Bovin Phang · GitHub ↗ · v2.6.0 · MIT-0
cross-platform ✓ 安全检测通过
45
总下载
1
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install fec-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...
使用说明 (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 在卸载时被终止且无内存泄漏。

安全使用建议
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install fec-web-workers
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /fec-web-workers 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug fec-web-workers
版本 2.6.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 45 次。

如何安装 Web Workers?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install fec-web-workers」即可一键安装,无需额外配置。

Web Workers 是免费的吗?

是的,Web Workers 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Web Workers 支持哪些平台?

Web Workers 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Web Workers?

由 Bovin Phang(@bovinphang)开发并维护,当前版本 v2.6.0。

💬 留言讨论