feat(skills): restore 60 bundled skills (#42)
* feat(skills): restore ansible skill * feat(skills): restore api-tester skill * feat(skills): restore aws skill * feat(skills): restore azure skill * feat(skills): restore ci-cd skill * feat(skills): restore code-reviewer skill * feat(skills): restore compliance skill * feat(skills): restore confluence skill * feat(skills): restore crypto-expert skill * feat(skills): restore css-expert skill * feat(skills): restore data-analyst skill * feat(skills): restore data-pipeline skill * feat(skills): restore docker skill * feat(skills): restore elasticsearch skill * feat(skills): restore email-writer skill * feat(skills): restore figma-expert skill * feat(skills): restore gcp skill * feat(skills): restore git-expert skill * feat(skills): restore github skill * feat(skills): restore golang-expert skill * feat(skills): restore graphql-expert skill * feat(skills): restore helm skill * feat(skills): restore interview-prep skill * feat(skills): restore jira skill * feat(skills): restore kubernetes skill * feat(skills): restore linear-tools skill * feat(skills): restore linux-networking skill * feat(skills): restore llm-finetuning skill * feat(skills): restore ml-engineer skill * feat(skills): restore mongodb skill * feat(skills): restore nextjs-expert skill * feat(skills): restore nginx skill * feat(skills): restore notion skill * feat(skills): restore oauth-expert skill * feat(skills): restore openapi-expert skill * feat(skills): restore pdf-reader skill * feat(skills): restore postgres-expert skill * feat(skills): restore presentation skill * feat(skills): restore project-manager skill * feat(skills): restore prometheus skill * feat(skills): restore prompt-engineer skill * feat(skills): restore python-expert skill * feat(skills): restore react-expert skill * feat(skills): restore redis-expert skill * feat(skills): restore regex-expert skill * feat(skills): restore rust-expert skill * feat(skills): restore security-audit skill * feat(skills): restore sentry skill * feat(skills): restore shell-scripting skill * feat(skills): restore slack-tools skill * feat(skills): restore sql-analyst skill * feat(skills): restore sqlite-expert skill * feat(skills): restore sysadmin skill * feat(skills): restore technical-writer skill * feat(skills): restore terraform skill * feat(skills): restore typescript-expert skill * feat(skills): restore vector-db skill * feat(skills): restore wasm-expert skill * feat(skills): restore web-search skill * feat(skills): restore writing-coach skill
This commit is contained in:
60 files changed
+2474
No files matched your search
@@ -0,0 +1,39 @@
|
||||
---
|
||||
name: wasm-expert
|
||||
description: "WebAssembly expert for WASI, component model, Rust/C compilation, and browser integration"
|
||||
---
|
||||
# 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
|
||||
Reference in new issue
Block a user