Skip to content
Skills Library
Programming · Building & coding

fec-web-workers

/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 integration, or UI responsiveness fixes. Do not use for lightweight synchronous work or DOM manipulation; Chinese triggers include Web Worker, background thread, main thread blocking.

Licence
MIT
Last repository change
26.09.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when moving expensive browser work off the main thread with Web Workers, SharedWorker, worker pools, Comlink, transferable objects, Vite/Webpack worker integration, or UI responsiveness fixes. Do not use for lightweight synchronous work or DOM manipulation; Chinese triggers include Web Worker, background thread, main thread blocking.

Original author description

Use when moving expensive browser work off the main thread with Web Workers, SharedWorker, worker pools, Comlink, transferable objects, Vite/Webpack worker integration, or UI responsiveness fixes. Do not use for lightweight synchronous work or DOM manipulation; Chinese triggers include Web Worker, background thread, main thread blocking.

How it works

  1. Purpose
  2. Procedure
  3. Detailed reference
  4. Constraints
  5. Expected Output
Original SKILL.md headings · 32 lines, 286 words
SKILL.md preview
---
name: 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 integration, or UI responsiveness fixes. Do not use for lightweight synchronous work or DOM manipulation; Chinese triggers include Web Worker, background thread, main thread blocking.
---

# Web Workers

## Purpose

Move expensive calculations off the main thread and keep input, scrolling, and animations responsive.

## Procedure

1. Confirm the bottleneck first: consider workers only if the task exceeds about 10ms, user input delay is obvious, FPS drops, or large file parsing/image processing/encryption calculation.
2. Choose a communication model: use `postMessage` for simple tasks, use Comlink for functional RPC, use Worker pool for a large number of parallel small tasks, and use SharedWorker for cross-Tab synchronization.
3. Design the message protocol: request/response types, error types, cancellation or timeout strategies must be clear.
4. Prioritize Transferable Objects when transferring large objects; don’t let structured cloning swallow up the benefits brought by Worker.
5. `terminate()` when a component or page is unloaded and verify main thread improvements through Profiler, Performance panel or FPS metrics.

## Detailed reference

- Load [references/basic-worker.md](references/basic-worker.md) when you need native Worker files, build tool imports, React lifecycle encapsulation and cleanup examples.
- Load [references/advanced-workers.md](references/advanced-workers.md) when Transferable Objects, Comlink, Worker pool, SharedWorker, CSP and SharedArrayBuffer considerations are required.

## Constraints

- Cannot access DOM, `window`, `document`, `alert()` or synchronize `localStorage` within Worker.
- High frequency communication may be slower than main thread calculations; measure first then split.
- Worker files must be loaded from the same source and are subject to `worker-src` CSP restrictions.
- Large binary data is transferred first, and the original reference will become invalid after the transfer.
- Each Worker has an independent JS heap and must actively manage life cycle and memory.

## Expected Output

Computationally intensive operations are performed on a background thread, main thread input and scrolling resume smoothly, error and cancellation paths are clear, and workers are terminated on unloading without memory leaks.
Files in this package (3)
  • SKILL.md 2 KB
  • references/advanced-workers.md 2 KB
  • references/basic-worker.md 2 KB

Versions

The database has no other skills named fec-web-workers.

Database snapshot: 13.11.2026 · package version af31d60d67ec (SHA-256 digest of the entire package)

Downloads in the last 30 days: 3 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100web-workers-multithreading
    Use this skill when offloading CPU-intensive computations, cryptography, image processing, or data transformations from the main UI thread to Web Workers.
  • 100bun-workers
    Use for Web Workers in Bun, worker_threads, parallel processing, and background tasks.
  • 100worker-visualizer
    A real-time data/particle/simulation visualizer whose heavy compute runs in a Web Worker (off the main thread), optionally sharing memory with the UI via SharedArrayBuffer, and renders to a canvas at 60fps. Produced as a single self-contained `index.html`. Use when the brief…
  • 100background-worker-creator
    Create background worker creator operations. Auto-activating skill for Backend Development. Triggers on: background worker creator, background worker creator Part of the Backend Development skill category. Use when working with background worker creator functionality. Trigger…
  • 96thread
    Use only when the owner asks for a thread. Opens a branch.
  • 100worker-api-engineering
    Engineering skill: Edge Worker API — how to build and ship a api / service with Cloudflare Workers, JavaScript (ES modules) or TypeScript, Vitest with the Workers pool. Use when writing, reviewing, testing or releasing code in this stack, and when turning a Celestial design or…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.