跳到正文
cccskills
免费在 GitHub 公开

wasm-edge-computing-expert

Expert guide for WebAssembly (WASM) and Edge Computing. Covers WASI preview 2, Spin/Fermyon, Cloudflare Workers WASM, and high-performance browser computing / Panduan ahli untuk WebAssembly (WASM) dan Edge Computing. Mencakup WASI preview 2, Spin/Fermyon, Cloudflare Workers WASM, dan komputasi performa tinggi di browser.

中文简介正在准备中。当前显示原文说明。

集成工具Cloudflare
查看安装方法

包含的文件(1)

  • SKILL.md5.3 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

WASM & Edge Computing Expert

English | Bahasa Indonesia


<a name="english"></a>

English

Description

A specialized guide for writing, compiling, and deploying WebAssembly (WASM) modules both on the Edge and in the browser. Covers the new WebAssembly System Interface (WASI) Preview 2, serverless execution environments (Spin, Cloudflare Workers, Fastly Compute), and bidirectional JavaScript-to-WASM interop.

Trigger Conditions

  • When porting heavy computational tasks (image processing, video encoding, cryptography) from JavaScript to Rust/Go via WASM.
  • When deploying ultra-fast, cold-start-free serverless functions on Cloudflare Workers or Fermyon Spin.
  • When the user asks about "WASI", "WebAssembly", or "Edge computing performance".
  • When bridging legacy C/C++ libraries to run in the browser using Emscripten.

Core Architectural Guidelines

1. Language Choice & Toolchain

  • Rust (Recommended): Use wasm-pack for browser modules and cargo component for WASI Preview 2. Rust offers the smallest binary sizes and no garbage collector overhead.
  • Go: Go 1.21+ has native WASI support (GOOS=wasip1 GOARCH=wasm), but binaries are larger due to the included runtime. Use TinyGo for smaller binaries.
  • AssemblyScript: Use when the team only knows TypeScript, though performance is slightly less than Rust.

2. Browser Integration (wasm-bindgen)

When writing Rust for the browser, minimize crossings between JS and WASM, as serialization is expensive.

use wasm_bindgen::prelude::*;

#[wasm_bindgen]
pub fn compute_heavy_task(input: &[u8]) -> Vec<u8> {
    // Process data entirely in WASM before returning
    input.iter().map(|&b| b.wrapping_add(1)).collect()
}

3. Edge & WASI Preview 2

WASI Preview 2 introduces the Component Model, allowing WASM modules to securely access system resources (HTTP, Filesystem) without being tied to a specific language.

  • Deploying to Cloudflare Workers:
    # wrangler.toml
    main = "./build/worker.js"
    [wasm_modules]
    MODULE = "./build/module.wasm"
    
  • Deploying to Fermyon Spin: Use the spin CLI to build microservices entirely in WASM that start in under 1 millisecond.

4. Shared Memory & Atomics

For multi-threaded browser WASM, use SharedArrayBuffer and Web Workers. Ensure your server sends the correct headers:

  • Cross-Origin-Opener-Policy: same-origin
  • Cross-Origin-Embedder-Policy: require-corp

Orchestration & Integration

  • Enhances api-gateway-proxy-expert for running custom logic at the edge (Cloudflare/Kong).
  • Integrates with rust-programming-expert or go-programming-expert for module compilation.
  • Pairs with performance-web-vitals to offload main-thread blocking tasks.

<a name="bahasa-indonesia"></a>

Bahasa Indonesia

Deskripsi

Panduan khusus untuk menulis, mengompilasi, dan mendeploy modul WebAssembly (WASM) baik di Edge maupun di browser. Mencakup WebAssembly System Interface (WASI) Preview 2, lingkungan serverless (Spin, Cloudflare Workers), dan interoperabilitas JavaScript-ke-WASM dua arah.

Kondisi Pemicu

  • Saat memindahkan tugas komputasi berat (pemrosesan gambar, kriptografi) dari JavaScript ke Rust/Go melalui WASM.
  • Saat mendeploy fungsi serverless ultra-cepat tanpa cold start di Cloudflare Workers atau Fermyon Spin.
  • Saat menjembatani library C/C++ lama untuk dijalankan di browser menggunakan Emscripten.

Panduan Arsitektur Inti

1. Pilihan Bahasa & Toolchain

  • Rust (Direkomendasikan): Menghasilkan ukuran biner terkecil. Gunakan wasm-pack untuk web dan cargo component untuk WASI.
  • Go: Gunakan TinyGo untuk ukuran modul yang lebih kecil, atau Go native GOOS=wasip1 untuk dukungan WASI penuh (namun biner akan lebih besar).
  • AssemblyScript: Jika tim hanya menguasai TypeScript.

2. Integrasi Browser

Minimalkan pertukaran data (crossing) antara JavaScript dan WASM karena biaya serialisasinya tinggi. Kirim array besar (seperti Uint8Array) sekali, proses seluruhnya di WASM, lalu kembalikan hasilnya.

3. Edge & WASI Preview 2 (Component Model)

WASI Preview 2 memungkinkan modul WASM mengakses resource sistem (HTTP, File) secara aman. Anda dapat mendeploy service WASM murni ke infrastruktur edge seperti Fermyon Spin atau Fastly dengan waktu mulai (startup time) di bawah 1 milidetik, jauh lebih cepat daripada container Docker tradisional.

4. Shared Memory & Web Workers

Untuk performa multi-threading sejati di browser menggunakan WASM, gunakan SharedArrayBuffer. Pastikan server Anda mengirimkan header keamanan COOP dan COEP yang diwajibkan oleh browser modern.

Integrasi Orkestrasi

  • Memperkuat api-gateway-proxy-expert untuk logika kustom di edge.
  • Terintegrasi dengan rust-programming-expert untuk kompilasi modul.
  • Melengkapi performance-web-vitals dengan memindahkan komputasi berat dari main thread JavaScript.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Expert guide for automated and manual Web Accessibility (a11y) testing — axe-core, Pa11y, Playwright a11y, screen reader testing, and WCAG 2.2 Level AA/AAA compliance / Panduan ahli pengujian aksesibilitas web.

中文简介正在准备中。当前显示原文说明。

roedyrustam/vibes-plug802026年10月19日 更新

Expert guide for intelligent model cascading and routing — complexity-scored task routing from Flash/Haiku to Sonnet/Opus/Astra, dynamic escalation with quality gates, 40-60% token cost reduction while maintaining output quality / Panduan ahli untuk kaskade dan routing model cerdas — routing tugas berbasis skor kompleksitas dari Flash/Haiku ke Sonnet/Opus/Astra, eskalasi dinamis dengan gerbang kualitas, pengurangan biaya token 40-60% dengan kualitas output terjaga.

中文简介正在准备中。当前显示原文说明。

roedyrustam/vibes-plug802026年10月19日 更新

Expert guide for Affective Computing, emotional AI, and real-time sentiment analysis through native multimodal tokens (voice intonation and facial micro-expressions) / Panduan ahli komputasi afektif, AI emosional, dan analisis sentimen real-time melalui token multimodal native.

中文简介正在准备中。当前显示原文说明。

roedyrustam/vibes-plug802026年10月19日 更新

Expert guide for AI-assisted coding workflows — agentic code generation, multi-agent code swarms, self-healing CI/CD, automated PR review, spec-to-code pipelines, codebase knowledge graphs, and human-in-the-loop approval gates / Panduan ahli untuk workflow pengkodean berbasis AI — generasi kode agentic, code swarm multi-agen, CI/CD self-healing, review PR otomatis, pipeline spec-to-code, knowledge graph codebase, dan gate persetujuan human-in-the-loop.

中文简介正在准备中。当前显示原文说明。

roedyrustam/vibes-plug802026年10月19日 更新

Expert guide for autonomous Machine-to-Machine (M2M) agent settlement, dual-rail fiat & stablecoin micro-clearing, dynamic budget envelopes, and cryptographic agent invoicing / Panduan ahli settlement otonom antar-agen (M2M), kliring mikro dual-rail fiat & stablecoin, pagu anggaran dinamis, dan penagihan agen kriptografis.

中文简介正在准备中。当前显示原文说明。

roedyrustam/vibes-plug802026年10月19日 更新

Expert guide for long-term episodic memory integration (Mem0 v2, Letta/MemGPT, Zep v2), memory tier architecture, pgvector HNSW storage, and unified context management for autonomous AI agents / Panduan ahli untuk integrasi memori episodik jangka panjang (Mem0 v2, Letta/MemGPT, Zep v2), arsitektur tier memori, penyimpanan pgvector HNSW, dan manajemen konteks terpadu untuk agen AI otonom.

中文简介正在准备中。当前显示原文说明。

roedyrustam/vibes-plug802026年10月19日 更新

查看 roedyrustam 的全部技能

报告此技能的问题