worker-visualizer
ما الذي تفعله
تنشئ هذه المهارة رسومًا متحركة تعمل بسلاسة (60 إطارًا في الثانية) في متصفحك. تنفذ الحسابات الثقيلة في الخلفية دون تجميد الصفحة الرئيسية، وتعرض النتيجة على عنصر canvas.
متى تستخدمها
- ✓عندما تريد رؤية محاكاة فورية للجسيمات أو الفيزياء.
- ✓لإنشاء مؤثرات بصرية معقدة، مثل الكسور المتحركة.
- ✓عند تطوير شيء يحتاج إلى حوسبة ثقيلة دون إبطاء الواجهة.
رابط المهارة
https://github.com/nexu-io/open-design/blob/main/design-templates/worker-visualizer/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“أنشئ محاكاة لـ1000 جسيم تتجاذب مع بعضها، واعرضها على عنصر canvas.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يقسّم الكود العمل: جزء يتولى الحسابات الثقيلة في منطقة منفصلة (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) دون نسخ كل شيء، فتصبح أسرع.
لماذا تعمل الرسوم بسرعة 60 إطارًا في الثانية؟
صُممت هذه المهارة لتحسين الحسابات والرسم، لتكون الحركة سلسة وممتعة للمشاهدة، كما في الألعاب.
التفاصيل
الوصف الأصلي من المؤلف
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
التعليقات
- …
المزيد من المهارات من هذا المستودع
sample-plugin
101kيجعل وكيلك ينشئ ملف بيانات وصفية للاختبارات. يساعد على ضمان عمل الكود بشكل صحيح في مواقف مختلفة.
aster-atelier
101kيساعد وكيلك على إنشاء موقع إلكتروني فني بطابع كلاسيكي. يستخدم صورًا أنيقة وسماءً زرقاء وخطوطًا بأسلوب السينما.
audio-jingle
101kيجعل وكيلك ينشئ صوتيات مثل الموسيقى التعريفية القصيرة والمؤثرات الصوتية. يمكنه إنشاء الموسيقى والأصوات وحفظ النتيجة كملف صوتي.
blog-post
101kيساعد وكيلك على كتابة المقالات الطويلة ومقالات المدونات. يتضمن أماكن للصور والاقتباسات ومعلومات الكاتب.
مهارات مشابهة
add-model-provider
394kتتيح لوكيلك ربط مزوّد نموذج ذكاء اصطناعي جديد بـ OpenClaw باستخدام أوامر إعداد آمنة، وإبقاء مفاتيح API خارج النص العادي، وإجراء اختبار حي.
acp-router
394kيساعد وكيلك على إرسال مهمة إلى مساعد برمجة مثل Claude Code أو Cursor عبر OpenClaw، فيعمل العمل داخل تلك الأداة.
browser-automation
394kتعلّم وكيلك التحكم في صفحات الويب خطوة بخطوة، بما في ذلك تسجيل الدخول والتبويبات والتعافي عندما تتوقف الصفحة عن الاستجابة.