wasm-expert
Qué hace
Esta skill guía la creación de módulos de WebAssembly a partir de lenguajes como Rust y C, incluyendo WASI para uso en servidores e integración con el navegador. Está pensada para desarrolladores que quieren código portable y rápido en navegadores o en servidores.
Cuándo usarla
- ✓Cuando quieres ejecutar código Rust o C dentro de una página web casi a la velocidad nativa.
- ✓Cuando necesitas un módulo portable que se ejecute en un servidor mediante WASI.
- ✓Cuando un archivo de WebAssembly es demasiado grande y hay que reducirlo para cargarlo en el navegador.
Link de la skill
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/wasm-expert/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Compila mi función de Rust para redimensionar imágenes a WebAssembly para que funcione en el navegador, y que el archivo sea lo más pequeño posible.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
La skill cubre la compilación con wasm-pack o Cargo para WASI, concede solo el acceso que necesita un módulo y reduce el tamaño binario con herramientas de optimización.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
WebAssembly Expert
A systems programmer and runtime specialist with deep expertise in WebAssembly compilation, WASI system interfaces, the component model, and browser integration. This skill provides guidance for compiling Rust, C, and other languages to WebAssembly, building portable server-side modules with WASI, designing composable components with WIT interfaces, and integrating Wasm modules into web applications with optimal performance.
Key Principles
- WebAssembly provides a portable, sandboxed execution environment; leverage its security model by granting only the capabilities a module needs through explicit imports
- Target wasm32-wasi for server-side and CLI applications that need file system, network, or clock access through the standardized WASI interface
- Use the Component Model and WIT (WebAssembly Interface Types) for language-agnostic module composition; components communicate through typed interfaces, not raw memory
- Optimize Wasm binary size aggressively for browser delivery; every kilobyte matters for initial load time, so strip debug info, use wasm-opt, and enable LTO
- Understand linear memory: Wasm modules operate on a flat byte array that grows but never shrinks; design data structures and allocation patterns accordingly
Techniques
- Compile Rust to Wasm with wasm-pack for browser targets (wasm-pack build --target web) or cargo build --target wasm32-wasi for server-side WASI modules
- Use wasm-bindgen to expose Rust functions to JavaScript and import JS APIs into Rust; annotate public functions with #[wasm_bindgen] and use JsValue for dynamic interop
- Define component interfaces in WIT files specifying exports (functions the component provides) and imports (functions the component requires from the host)
- Compose multiple Wasm components using wasm-tools compose, linking one component's imports to another's exports without source-level dependencies
- Optimize binaries with wasm-opt -Oz for size or -O3 for speed; use wasm-tools strip to remove custom sections and debug information for production builds
- Instantiate modules in the browser with WebAssembly.instantiateStreaming(fetch("module.wasm"), importObject) for the fastest possible startup
- Enable SIMD (Single Instruction, Multiple Data) for compute-intensive workloads by compiling with target features enabled and using explicit SIMD intrinsics or auto-vectorization
Common Patterns
- Plugin Architecture: Host application loads untrusted Wasm plugins with restricted WASI capabilities; plugins export a known interface (defined in WIT) and cannot access resources beyond what the host provides
- Polyglot Composition: Compile components from different languages (Rust, Go, Python) to Wasm components with WIT interfaces, then compose them into a single application using wasm-tools
- Streaming Compilation: Use WebAssembly.compileStreaming to compile the module while it downloads; pair with instantiate for near-zero wait time after the network transfer completes
- Memory-Mapped I/O: For large data processing in Wasm, share a linear memory region between the host and the module, passing pointers and lengths instead of copying data across the boundary
Pitfalls to Avoid
- Do not assume all WASI APIs are available in every runtime; WASI Preview 2 is still being adopted, and different runtimes (Wasmtime, Wasmer, WasmEdge) support different subsets
- Do not allocate memory freely without a strategy; Wasm linear memory grows in 64KB page increments and never releases pages back to the OS, so fragmentation accumulates over time
- Do not pass complex data structures across the Wasm boundary by serializing to JSON; use shared linear memory with well-defined layouts or the component model's typed interface for efficiency
- Do not skip testing on the target runtime; behavior differences exist between browser engines (V8, SpiderMonkey, JavaScriptCore) and server-side runtimes, especially for threading and SIMD
Preguntas frecuentes
¿Qué es WASI?
Es un conjunto estándar de interfaces del sistema que permite a los módulos de WebAssembly usar archivos, red o relojes de forma controlada.
¿Por qué reducir el tamaño del archivo?
Los archivos más pequeños cargan más rápido en el navegador, y la skill recomienda quitar la información de depuración y optimizar el binario.
¿Qué es la memoria lineal?
Es el bloque de memoria plano que usa un módulo de WebAssembly, que puede crecer pero no reducirse, así que las estructuras de datos deben planificarlo.
Detalles
Descripción original del autor
WebAssembly expert for WASI, component model, Rust/C compilation, and browser integration
repo: RightNow-AI/openfang
Popularidad
- Estrellas en GitHub
- 18 mil
- Posición en el ranking
- #10720
- Licencia
- Apache-2.0
- Actualizada
- 2/7/2026
Comentarios
- …
Más skills de este repositorio
browser-automation
18 milEnseña a tu agente a controlar un navegador web con Playwright, usando selectores CSS para encontrar botones, formularios y enlaces.
clip-hand-skill
18 milAyuda a tu agente a crear clips de vídeo: descargar un vídeo, transcribir su voz, generar archivos de subtítulos y cortar fragmentos con ffmpeg.
collector-hand-skill
18 milAyuda a tu agente a reunir información pública sobre un tema o una empresa, extraer entidades clave, seguir los cambios y medir el sentimiento.
infisical-sync-skill
18 milAyuda a tu agente a leer y actualizar secretos en una bóveda de Infisical a través de su API, con pasos de inicio de sesión y gestión clara de errores.
Skills parecidas
diffs
394 milPermite que tu agente genere un diff real y compartible de los cambios, como enlace de visualización o archivo de imagen, en lugar de un resumen escrito a mano.
coding-agent
394 milAyuda a tu agente a pasar un trabajo de programación grande a Codex, Claude Code u OpenCode como trabajador en segundo plano, y después revisar su progreso.
gh-issues
394 milAyuda a tu agente a encontrar incidencias de GitHub, elegir cuáles trabajar y abrir pull requests con correcciones, incluido el seguimiento de los comentarios de revisión.