Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

worker-visualizer

/worker-visualizer

Tworzy wizualizator symulacji w czasie rzeczywistym, z obliczeniami w Web Workerze, opcjonalnym SharedArrayBuffer i renderem canvas w 60 fps, w jednym pliku index.html.

Repozytorium
open-design ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
3
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co robi i kiedy

Tworzy wizualizator symulacji w czasie rzeczywistym, z obliczeniami w Web Workerze, opcjonalnym SharedArrayBuffer i renderem canvas w 60 fps, w jednym pliku index.html.

Wyzwalacze z opisu

web workersimulationparticle systemphysicsoff-main-threadfractalreal-time computeaudio/data visualizer
Oryginalny opis (EN)

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 asks for a "web worker", "simulation", "particle system", "physics", "off-main-thread", "fractal", "real-time compute", or "audio/data visualizer". OpenDesign serves this in powered-preview mode so Workers and SharedArrayBuffer actually work.

Jak działa

  1. Why this is a powered artifact
  2. Resource map
  3. Workflow
Sekcje z nagłówków SKILL.md, w oryginale · 45 linii, 426 słów
Podgląd SKILL.md
---
name: worker-visualizer
description: |
  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 asks for a "web worker",
  "simulation", "particle system", "physics", "off-main-thread", "fractal",
  "real-time compute", or "audio/data visualizer". OpenDesign serves this in
  powered-preview mode so Workers and SharedArrayBuffer actually work.
triggers:
  - "web worker"
  - "worker"
  - "simulation"
  - "particle system"
  - "physics sim"
  - "fractal"
  - "off main thread"
  - "sharedarraybuffer"
  - "real-time compute"
  - "visualizer"
  - "多线程"
  - "粒子"
od:
  mode: prototype
  platform: web
  scenario: design
  preview:
    type: html
    entry: index.html
    reload: debounce-100
  design_system:
    requires: false
    sections: [color, typography]
  craft:
    requires: [animation-discipline, state-coverage]
---

# Worker Visualizer Skill

Produce a single self-contained `index.html` that moves heavy per-frame compute into a Web Worker and renders the result to a canvas, keeping the main thread at a smooth 60fps.

## Why this is a powered artifact

OpenDesign detects `new Worker(` / `SharedArrayBuffer` / `OffscreenCanvas` and renders this file in **powered preview** — a cross-origin-isolated iframe with `allow-same-origin`. That means external and blob Web Workers construct successfully, `SharedArrayBuffer` is defined (`crossOriginIsolated === true`), and `importScripts` works. In the old opaque sandbox all three failed; here they just work.

## Resource map

```
worker-visualizer/
├── SKILL.md      ← you're reading this
└── example.html  ← a working 12k-particle SharedArrayBuffer sim (READ FIRST)
```

## Workflow

### Step 0 — Read the reference
Read `example.html`. Note the split: the worker integrates positions each tick; the main thread only reads + draws. It feature-detects `crossOriginIsolated` and uses a `SharedArrayBuffer` for zero-copy when available, falling back to a transferable `postMessage` copy otherwise. Always ship that fallback so the artifact still animates if isolation is off.

### Step 1 — Choose the workload
Pick ONE compute-bound job worth offloading:
- **Particle / N-body field** (default): thousands of bodies with a cheap force law.
- **Fractal**: Mandelbrot/Julia escape-time into an `ImageData` buffer.
- **Cellular automata / reaction-diffusion**: grid updated in the worker.
- **Data/audio visualizer**: transform a stream into bars/rings each frame.

### Step 2 — Build `index.html`
- **One file, zero external requests.** Build the worker from a `Blob` + `URL.createObjectURL` (inline its source), or embed it as a `data:` URL.
- **Prefer SharedArrayBuffer** for large per-frame state: allocate on the main thread, pass the `SharedArrayBuffer` to the worker, and read the same `Float32Array`/`Uint8ClampedArray` view while drawing. Guard on `typeof SharedArrayBuffer !== 'undefined' && crossOriginIsolated`.
- **Fallback path**: if not isolated, `postMessage` a transferable `ArrayBuffer` each frame.
- Consider `OffscreenCanvas` + `canvas.transferControlToOffscreen()` to render inside the worker for the heaviest scenes.

### Step 3 — Overlay + brand
- HUD with the title and 2–3 live stat tiles (particle count, transport mode, fps). Map accent color to the active DESIGN.md when present; otherwise a dark ground with one vivid accent.

### Step 4 — Self-review (P0)
- [ ] Worker constructs with no SecurityError; sim runs.
- [ ] Main-thread render holds ~60fps under the full workload.
- [ ] `SharedArrayBuffer` path engages when `crossOriginIsolated` is true; `postMessage` fallback engages otherwise — verify BOTH branches degrade cleanly.
- [ ] No unbounded growth: velocities/positions stay stable over minutes.
- [ ] The "Transport" stat truthfully reports which path is live.
Pliki w paczce (3)
  • SKILL.md 4 KB
  • example.html 5 KB
  • open-design.json 11 KB

Wersje

W bazie nie ma innych skilli o nazwie worker-visualizer.

Identyczna treść występuje jeszcze w 1 innych folderach na GitHubie. Tu pokazujemy jedną, najlepiej ocenioną kopię.

Migawka bazy z 13.11.2026 · wersja paczki bb52a6ce2475 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 1 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100webgl-experience
    Tworzy pełnoekranowe doświadczenie WebGL lub WebGL2 w czasie rzeczywistym, z animowanymi shaderami, scenami 3D, wizualizacjami generatywnymi i polami cząstek z nakładką typograficzną, w jednym pliku index.html.
  • 100cross-origin-isolation
    Sprawdza aplikacje webowe wymagające izolacji między źródłami, na przykład z SharedArrayBuffer czy workerami, weryfikując zarówno nagłówki, jak i zachowanie w przeglądarce.
  • 100database-schema-visualizer
    Prawdopodobnie wizualizuje schematy baz danych jako treści wizualne.
  • 100fec-web-workers
    Przenosi kosztowną pracę przeglądarki poza główny wątek z użyciem Web Workers, SharedWorker, pul workerów, Comlink i obiektów transferowalnych, poprawiając responsywność interfejsu.
  • 100webgl-liquid-metal
    Tworzy shader ciekłego metalu w czasie rzeczywistym: zniekształcone pole szumu cieniowane jak stopiony chrom z tęczową warstwą cienkowarstwową, w jednym pliku index.html bez tekstur.
  • 100repo-visualizer
    Wyjaśnia, jak działa repozytorium lub funkcja, jako graf komponentów z interaktywnym HTML i opcjonalnym GIF lub wideo.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.