worker-visualizer
यह क्या करती है
आपके ब्राउज़र में एक विज़ुअल एनिमेशन बनाता है जो स्मूथ चलता है (60 फ्रेम प्रति सेकंड)। यह भारी गणनाएँ बैकग्राउंड में करता है, बिना मुख्य पेज को फ्रीज़ किए, और नतीजा कैनवास पर दिखाता है।
कब इस्तेमाल करें
- ✓जब आप रियल-टाइम पार्टिकल या फिज़िक्स सिमुलेशन देखना चाहते हैं।
- ✓मूविंग फ्रैक्टल जैसे जटिल विज़ुअल इफ़ेक्ट बनाने के लिए।
- ✓ऐसी चीज़ विकसित करते समय जिसमें भारी गणना हो, पर इंटरफ़ेस धीमा न हो।
Skill का लिंक
https://github.com/nexu-io/open-design/blob/main/design-templates/worker-visualizer/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“1000 पार्टिकल्स का सिमुलेशन बनाओ जो एक-दूसरे को आकर्षित करें, और उसे कैनवास पर दिखाओ।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
कोड काम को बाँटता है: एक हिस्सा अलग जगह (Web Worker) में भारी गणना संभालता है, और दूसरा हिस्सा सिर्फ नतीजा स्क्रीन पर बनाता है। इससे पेज रिस्पॉन्सिव रहता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
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
ImageDatabuffer. - 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 adata:URL. - Prefer SharedArrayBuffer for large per-frame state: allocate on the main thread, pass the
SharedArrayBufferto the worker, and read the sameFloat32Array/Uint8ClampedArrayview while drawing. Guard ontypeof SharedArrayBuffer !== 'undefined' && crossOriginIsolated. - Fallback path: if not isolated,
postMessagea transferableArrayBuffereach 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.
-
SharedArrayBufferpath engages whencrossOriginIsolatedis true;postMessagefallback 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.
अक्सर पूछे जाने वाले सवाल
'Web Worker' क्या है?
यह ब्राउज़र में एक छिपे हेल्पर जैसा है, जो भारी काम करता है बिना उस स्क्रीन में दखल दिए जो आप मुख्य रूप से देखते हैं।
'SharedArrayBuffer' क्या है?
यह मुख्य हिस्से और हेल्पर (Web Worker) के बीच बहुत बड़ा डेटा शेयर करने का एक एडवांस तरीका है, जिसमें सब कुछ कॉपी नहीं करना पड़ता, इसलिए यह तेज़ होता है।
एनिमेशन 60fps पर क्यों चलता है?
यह टूल गणना और ड्राइंग दोनों को ऑप्टिमाइज़ करने के लिए बना है, ताकि एनिमेशन गेम की तरह स्मूथ और देखने में अच्छा लगे।
जानकारी
लेखक का मूल विवरण
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 "
repo: nexu-io/open-design
लोकप्रियता
- GitHub स्टार
- 101k
- रैंकिंग में स्थान
- #976
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
sample-plugin
101kआपके एजेंट से टेस्ट के लिए metadata file बनवाता है। इससे पक्का होता है कि कोड अलग-अलग स्थितियों में सही चलता है।
aster-atelier
101kआपके एजेंट से क्लासिक लुक वाली एक कलात्मक website बनवाता है। इसमें खूबसूरत इमेज, नीला आसमान और serif fonts इस्तेमाल होते हैं, जिससे सिनेमाई एहसास मिलता है।
audio-jingle
101kआपके एजेंट से जिंगल्स और sound effects जैसा audio बनवाता है। यह music और voice बना सकता है और नतीजा audio file में सेव करता है।
blog-post
101kआपका एजेंट लंबे articles या blog posts लिखने में मदद करता है। इसमें images, quotes और author की जानकारी के लिए जगह भी होती है।
मिलती-जुलती skills
add-model-provider
394kयह आपके एजेंट को सुरक्षित कमांड से OpenClaw में नया AI मॉडल प्रोवाइडर जोड़ने, API कीज़ को सादे टेक्स्ट से बचाने और लाइव टेस्ट चलाने देती है।
acp-router
394kयह आपके एजेंट को OpenClaw के ज़रिए Claude Code या Cursor जैसे कोडिंग असिस्टेंट को काम भेजने देती है, ताकि काम उसी टूल में चले।
browser-automation
394kयह आपके एजेंट को लॉगिन, टैब और अटकी वेब पेज से उबरने समेत, वेबसाइट पर चरण-दर-चरण काम करना सिखाती है।