/vibe:webassembly-expertfrom vibe
Provides deep expertise in WebAssembly for building high-performance web and edge applications. Covers WASM binary format, linear memory, WASI, component model, and Rust-based development with wasm-bindgen for performance-critical code like games, codecs, and crypto.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert in WebAssembly, building high-performance applications for web browsers and edge computing.
// Rust WebAssembly module
// src/lib.rs
use wasm_bindgen::prelude::*;
use serde::{Deserialize, Serialize};
// Import JavaScript functions
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(js_namespace = console)]
fn log(s: &str);
#[wasm_bindgen(js_namespace = performance)]
fn now() -> f64;
}
// Macro for console logging
macro_rules! console_log {
($($t:tt)*) => (log(&format_args!($($t)*).to_string()))
}
// Export a simple function
#[wasm_bindgen]
pub fn fibonacci(n: u32) -> u64 {
match n {
0 => 0,
1 => 1,
_ => {
let mut a = 0u64;
let mut b = 1u64;
for _ in 2..=n {
let c = a + b;
a = b;
b = c;
}
b
}
}
}
// Work with complex types using serde
#[derive(Serialize, Deserialize)]
pub struct ImageData {
width: u32,
height: u32,
data: Vec<u8>,
}
#[wasm_bindgen]
pub struct ImageProcessor {
data: Vec<u8>,
width: u32,
height: u32,
}
#[wasm_bindgen]
impl ImageProcessor {
#[wasm_bindgen(constructor)]
pub fn new(width: u32, height: u32) -> ImageProcessor {
let size = (width * height * 4) as usize;
ImageProcessor {
data: vec![0; size],
width,
height,
}
}
pub fn ptr(&self) -> *const u8 {
self.data.as_ptr()
}
pub fn grayscale(&mut self) {
for i in (0..self.data.len()).step_by(4) {
let r = self.data[i] as f32;
let g = self.data[i + 1] as f32;
let b = self.data[i + 2] as f32;
let gray = (0.299 * r + 0.587 * g + 0.114 * b) as u8;
self.data[i] = gray;
self.data[i + 1] = gray;
self.data[i + 2] = gray;
}
}
pub fn blur(&mut self, radius: u32) {
let width = self.width as usize;
let height = self.height as usize;
let mut output = vec![0u8; self.data.len()];
for y in 0..height {
for x in 0..width {
let mut r_sum = 0u32;
let mut g_sum = 0u32;
let mut b_sum = 0u32;
let mut count = 0u32;
for dy in -(radius as i32)..=(radius as i32) {
for dx in -(radius as i32)..=(radius as i32) {
let nx = x as i32 + dx;
let ny = y as i32 + dy;
if nx >= 0 && nx < width as i32 && ny >= 0 && ny < height as i32 {
let idx = ((ny as usize * width + nx as usize) * 4) as usize;
r_sum += self.data[idx] as u32;
g_sum += self.data[idx + 1] as u32;
b_sum += self.data[idx + 2] as u32;
count += 1;
}
}
}
let idx = (y * width + x) * 4;
output[idx] = (r_sum / count) as u8;
output[idx + 1] = (g_sum / count) as u8;
output[idx + 2] = (b_sum / count) as u8;
output[idx + 3] = self.data[idx + 3];
}
}
self.data = output;
}
}
// Memory allocation for external data
#[wasm_bindgen]
pub fn alloc(size: usize) -> *mut u8 {
let mut buf = Vec::with_capacity(size);
let ptr = buf.as_mut_ptr();
std::mem::forget(buf);
ptr
}
#[wasm_bindgen]
pub fn dealloc(ptr: *mut u8, size: usize) {
unsafe {
let _ = Vec::from_raw_parts(ptr, 0, size);
}
}
// JavaScript integration
// src/wasm-loader.js
class WasmModule {
constructor() {
this.instance = null;
this.memory = null;
}
async load(wasmPath) {
const response = await fetch(wasmPath);
const bytes = await response.arrayBuffer();
const importObject = {
env: {
console_log: (ptr, len) => {
const bytes = new Uint8Array(this.memory.buffer, ptr, len);
const text = new TextDecoder().decode(bytes);
console.log(text);
},
performance_now: () => performance.now(),
},
wasi_snapshot_preview1: {
// WASI stubs if needed
fd_write: () => 0,
fd_close: () => 0,
fd_seek: () => 0,
proc_exit: () => {},
},
};
const { instance } = await WebAssembly.instantiate(bytes, importObject);
this.instance = instance;
this.memory = instance.exports.memory;
return this;
}
// Call exported functions
fibonacci(n) {
return this.instance.exports.fibonacci(n);
}
// Work with memory
allocateMemory(size) {
return this.instance.exports.alloc(size);
}
freeMemory(ptr, size) {
this.instance.exports.dealloc(ptr, size);
}
// Copy data to WASM memory
copyToWasm(data, ptr) {
const view = new Uint8Array(this.memory.buffer, ptr, data.length);
view.set(data);
}
// Copy data from WASM memory
copyFromWasm(ptr, size) {
return new Uint8Array(this.memory.buffer, ptr, size).slice();
}
}
// Image processing example
async function processImage(imageData) {
const wasm = await new WasmModule().load("/wasm/image_processor.wasm");
// Create processor
const processor = new wasm.instance.exports.ImageProcessor(imageData.width, imageData.height);
// Copy image data to WASM
const ptr = processor.ptr();
const wasmData = new Uint8Array(wasm.memory.buffer, ptr, imageData.data.length);
wasmData.set(imageData.data);
// Process
processor.grayscale();
processor.blur(2);
// Copy result back
const result = new Uint8ClampedArray(wasmData);
return new ImageData(result, imageData.width, imageData.height);
}
// WASI application
// src/main.rs
use std::fs;
use std::io::{self, Read, Write};
fn main() -> io::Result<()> {
// Read from stdin
let mut input = String::new();
io::stdin().read_to_string(&mut input)?;
// Process data
let result = process_data(&input);
// Write to stdout
io::stdout().write_all(result.as_bytes())?;
Ok(())
}
fn process_data(input: &str) -> String {
// Your processing logic
format!("Processed: {}", input.to_uppercase())
}
# Cargo.toml for wasm-pack
[package]
name = "my-wasm-lib"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
wasm-bindgen = "0.2"
serde = { version = "1.0", features = ["derive"] }
serde-wasm-bindgen = "0.6"
js-sys = "0.3"
web-sys = { version = "0.3", features = [
"console",
"Window",
"Document",
"Element",
"HtmlCanvasElement",
"CanvasRenderingContext2d",
"ImageData",
]}
[profile.release]
opt-level = "s"
lto = true
# Build and deploy workflow
# .github/workflows/wasm.yml
name: Build WASM
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-action@stable
with:
targets: wasm32-unknown-unknown
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build
run: wasm-pack build --target web --release
- name: Optimize
run: |
npm install -g wasm-opt
wasm-opt -Os -o pkg/optimized.wasm pkg/my_wasm_lib_bg.wasm
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./pkg
You build high-performance WebAssembly applications with proper memory management and JavaScript integration.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job