[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EGKDFRSDS7JEGKP64KP2CN":3,"skill-same:01M6EGKDFRSDS7JEGKP64KP2CN":45},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M6EGKDFRSDS7JEGKP64KP2CN","wasm",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fwasm\u002FSKILL.md",[],[5],"2026-11-10 10:12:30",false,"# WebAssembly (WASM) — Near-Native Performance in the Browser\n\nYou are an expert in WebAssembly, the binary instruction format for stack-based virtual machines. You help developers compile Rust, C, C++, Go, and AssemblyScript to WASM for near-native performance in browsers, edge functions, and serverless environments — building image\u002Fvideo processing, games, crypto, AI inference, and compute-intensive tools that run 10-100x faster than JavaScript.\n\n## Core Capabilities\n\n### Rust → WASM\n\n```rust\n\u002F\u002F src\u002Flib.rs — Rust compiled to WASM\nuse wasm_bindgen::prelude::*;\n\n#[wasm_bindgen]\npub fn fibonacci(n: u32) -> u64 {\n    match n {\n        0 => 0,\n        1 => 1,\n        _ => {\n            let mut a: u64 = 0;\n            let mut b: u64 = 1;\n            for _ in 2..=n {\n                let tmp = a + b;\n                a = b;\n                b = tmp;\n            }\n            b\n        }\n    }\n}\n\n#[wasm_bindgen]\npub fn process_image(pixels: &[u8], width: u32, height: u32) -> Vec\u003Cu8> {\n    let mut output = Vec::with_capacity(pixels.len());\n    for chunk in pixels.chunks(4) {\n        let gray = (0.299 * chunk[0] as f32 + 0.587 * chunk[1] as f32 + 0.114 * chunk[2] as f32) as u8;\n        output.extend_from_slice(&[gray, gray, gray, chunk[3]]);\n    }\n    output\n}\n\n#[wasm_bindgen]\npub struct ImageProcessor {\n    width: u32,\n    height: u32,\n    data: Vec\u003Cu8>,\n}\n\n#[wasm_bindgen]\nimpl ImageProcessor {\n    #[wasm_bindgen(constructor)]\n    pub fn new(width: u32, height: u32) -> Self {\n        Self { width, height, data: vec![0; (width * height * 4) as usize] }\n    }\n\n    pub fn blur(&mut self, radius: u32) {\n        \u002F\u002F Gaussian blur implementation — 50x faster than JS Canvas API\n        let kernel_size = (radius * 2 + 1) as usize;\n        \u002F\u002F ... optimized blur using SIMD when available\n    }\n\n    pub fn data_ptr(&self) -> *const u8 { self.data.as_ptr() }\n    pub fn data_len(&self) -> usize { self.data.len() }\n}\n```\n\n```bash\n# Build with wasm-pack\ncargo install wasm-pack\nwasm-pack build --target web              # For browser\nwasm-pack build --target bundler          # For webpack\u002Fvite\nwasm-pack build --target nodejs           # For Node.js\n```\n\n### JavaScript Integration\n\n```typescript\n\u002F\u002F Use WASM from JavaScript\nimport init, { fibonacci, process_image, ImageProcessor } from \".\u002Fpkg\u002Fmy_wasm.js\";\n\nawait init();                             \u002F\u002F Initialize WASM module\n\n\u002F\u002F Simple function call\nconst result = fibonacci(50);             \u002F\u002F ~0.001ms vs ~10ms in JS\n\n\u002F\u002F Image processing\nconst canvas = document.querySelector(\"canvas\")!;\nconst ctx = canvas.getContext(\"2d\")!;\nconst imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\nconst processed = process_image(imageData.data, canvas.width, canvas.height);\nconst output = new ImageData(new Uint8ClampedArray(processed), canvas.width, canvas.height);\nctx.putImageData(output, 0, 0);\n\n\u002F\u002F Class instance\nconst processor = new ImageProcessor(1920, 1080);\nprocessor.blur(5);\n\n\u002F\u002F Shared memory for zero-copy (advanced)\nconst memory = new WebAssembly.Memory({ initial: 256, maximum: 512, shared: true });\n```\n\n### AssemblyScript (TypeScript-like)\n\n```typescript\n\u002F\u002F assembly\u002Findex.ts — TypeScript syntax → WASM\nexport function add(a: i32, b: i32): i32 {\n  return a + b;\n}\n\nexport function sum(arr: Int32Array): i32 {\n  let total: i32 = 0;\n  for (let i = 0; i \u003C arr.length; i++) {\n    total += unchecked(arr[i]);           \u002F\u002F Skip bounds check for performance\n  }\n  return total;\n}\n\n\u002F\u002F Build: npx asc assembly\u002Findex.ts --outFile build\u002Fmodule.wasm --optimize\n```\n\n### WASI (Server-Side WASM)\n\n```bash\n# Run WASM outside browsers with WASI\nwasmtime run my_program.wasm              # Bytecode Alliance runtime\nwasmer run my_program.wasm                # Wasmer runtime\n\n# Edge computing (Cloudflare Workers, Fastly Compute)\n# WASM modules run at the edge with near-native speed\n```\n\n## Installation\n\n```bash\n# Rust → WASM\ncargo install wasm-pack\nrustup target add wasm32-unknown-unknown\n\n# AssemblyScript\nnpm install -D assemblyscript\nnpx asc --init\n\n# WASM runtimes\nbrew install wasmtime                      # Server-side WASM\nbrew install wasmer                        # Alternative runtime\n```\n\n## Best Practices\n\n1. **Use for compute** — WASM excels at CPU-intensive tasks (image processing, crypto, parsing, physics); don't use for DOM manipulation\n2. **Rust is the best fit** — Rust has the most mature WASM toolchain (wasm-bindgen, wasm-pack); smallest binaries, no GC\n3. **Minimize JS↔WASM calls** — Cross-boundary calls have overhead; batch data and process in WASM, return results\n4. **SharedArrayBuffer** — Use shared memory for large data (images, audio); avoid copying between JS and WASM\n5. **wasm-opt for size** — Run `wasm-opt -O3` on output; typically reduces binary size 10-30%\n6. **Streaming compilation** — Use `WebAssembly.compileStreaming(fetch(...))` for fastest loading; compiles while downloading\n7. **WASI for portability** — Target WASI for server-side WASM; runs on Cloudflare, Fastly, Wasmtime, Wasmer\n8. **Feature detection** — Check `typeof WebAssembly === \"object\"` before loading; fall back to JS for unsupported browsers\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Fwasm",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill wasm",{"tool":37,"command":38},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill wasm",{"tool":40,"command":41},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill wasm","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fwasm\u002FSKILL.md",true,[],[46,55,64,73,79,85],{"skillNo":47,"name":48,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[52,53,54],"model","model hierarchy","model hierarchy skill",{"skillNo":56,"name":57,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[61,62,63],"MCP","zoom","zoom mcp",{"skillNo":65,"name":66,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[70,71,72,62],"sdk","zoom apps sdk","apps",{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[75],{"skillNo":80,"name":81,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[81],{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[87]]