wasm-expert
O que ela faz
Esta skill orienta a criação de módulos WebAssembly a partir de linguagens como Rust e C, incluindo WASI para uso em servidores e integração com o navegador. É para desenvolvedores que querem código portátil e rápido no navegador ou no servidor.
Quando usar
- ✓Quando você quer rodar código Rust ou C dentro de uma página web com velocidade quase nativa.
- ✓Quando você precisa de um módulo portátil que rode em um servidor por meio do WASI.
- ✓Quando um arquivo WebAssembly é grande demais e precisa ser reduzido para carregar no navegador.
Link da skill
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/wasm-expert/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Compile a minha função de redimensionamento de imagens em Rust para WebAssembly, para que ela rode no navegador, e deixe o arquivo o menor possível.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
A skill cobre a construção com wasm-pack ou com o Cargo para WASI, a concessão apenas do acesso que um módulo precisa e a redução do tamanho do binário com ferramentas de otimização.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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
Perguntas frequentes
O que é WASI?
É um conjunto padrão de interfaces de sistema que permite que módulos WebAssembly usem arquivos, rede ou relógios de forma controlada.
Por que reduzir o tamanho do arquivo?
Arquivos menores carregam mais rápido no navegador, e a skill recomenda remover informações de depuração e otimizar o binário.
O que é memória linear?
É o bloco plano de memória que um módulo WebAssembly usa, que pode crescer mas não diminuir, então os layouts de dados devem prever isso.
Detalhes
Descrição original do autor
WebAssembly expert for WASI, component model, Rust/C compilation, and browser integration
repo: RightNow-AI/openfang
Popularidade
- Estrelas no GitHub
- 18 mil
- Posição no ranking
- #10720
- Licença
- Apache-2.0
- Atualizada em
- 02/07/2026
Comentários
- …
Mais skills deste repositório
browser-automation
18 milEnsina seu agente a controlar um navegador web com Playwright, usando seletores CSS para encontrar botões, formulários e links.
clip-hand-skill
18 milAjuda seu agente a fazer cortes de vídeo: baixar um vídeo, transcrever a fala, criar arquivos de legenda e cortar trechos com o ffmpeg.
collector-hand-skill
18 milAjuda seu agente a reunir informações públicas sobre um tema ou empresa, extrair entidades principais, acompanhar mudanças e avaliar o sentimento.
infisical-sync-skill
18 milAjuda seu agente a ler e atualizar segredos em um cofre do Infisical pela API, com passos de login e tratamento claro de erros.
Skills parecidas
diffs
394 milPermite que seu agente gere um diff real e compartilhável das edições, como link de visualização ou arquivo de imagem, em vez de um resumo escrito à mão.
coding-agent
394 milAjuda seu agente a passar um trabalho grande de programação para o Codex, Claude Code ou OpenCode em segundo plano e acompanhar o andamento.
gh-issues
394 milAjuda seu agente a encontrar issues do GitHub, escolher quais resolver e abrir pull requests com correções, acompanhando os comentários de revisão.