By aphrody-code
Connect Rust and Bun end-to-end: bun:ffi bindings, napi-rs native addons, the Rust↔Bun reference, and crate→Bun-package workflows.
Build a complete, correct Rust↔Bun FFI bridge for ANY Rust project: a `cdylib` crate exposing `extern "C"` functions that Bun loads with `bun:ffi` (`dlopen`/`cc`/`JSCallback`). Use this skill whenever the user wants to call Rust from Bun/JavaScript, "bind a Rust crate to Bun", "expose Rust to bun:ffi", pass strings/structs/buffers/callbacks across the Rust↔JS boundary, generate the TypeScript `dlopen` bindings for a native library, or debug FFI crashes (segfaults, wrong values, memory corruption) when using bun:ffi — even if they just say "I want my Rust function callable from Bun" without naming FFI.
Build production Rust native addons (`.node`) with napi-rs (v3) for Bun and Node: the `#[napi]` macro surface (functions, objects, classes, getters, async), errors-as-thrown-exceptions, Buffer/typed-array values, ThreadsafeFunction for cross-thread callbacks, the `@napi-rs/cli` build, and the multi-platform prebuild/publish model. Use this skill whenever the user wants a Rust native module for Bun/Node that needs rich JS values, async, classes, or thrown errors, says "use napi-rs", "build a .node addon in Rust", "Rust addon for Bun", wants the stable/production alternative to bun:ffi, needs to cross-compile and publish a native package, or is debugging a napi-rs build or a napi addon under Bun — even if they just say "make my Rust into a fast Node/Bun module".
Turn a Rust crate into a usable, distributable Bun package via bun:ffi — project layout, automated build (cargo → cdylib → typed TS bindings), a fast prototyping loop, and multi-platform distribution (prebuilt per-platform deps, build-from-source, or embedding the library with `bun build --compile`). Use this skill whenever the user wants to "package a Rust crate for Bun", "ship Rust as an npm/Bun package", "wrap my Rust library so JS can import it", set up the build/automation/CI for a Rust+Bun project, generate TypeScript bindings from a symbol manifest, prototype a Rust↔Bun binding quickly, or distribute a native Bun package across platforms — even if they only say "make my Rust crate installable from Bun".
The reference and decision guide for connecting Rust and Bun in ANY project: every integration path (bun:ffi cdylib, N-API via napi-rs, Bun.spawn subprocess, WebAssembly, stdio IPC), how to choose between them, the complete cross-boundary type-marshalling rules, and how Bun itself bridges Rust↔JS internally (the canonical reference patterns from the official oven-sh/bun repo: the FFI JIT trampoline, bun_jsc/host_fn, the .classes.ts codegen, bun_sys/bun_core). Use this skill whenever the user asks "how do Rust and Bun fit together", "what's the best way to call Rust from Bun", "should I use FFI or N-API", needs the Rust↔JS type mapping, is architecting a native module for Bun, or wants to understand how Bun's own Rust internals talk to JavaScript — even if they don't name a specific mechanism.
Build and run Rust→WebAssembly modules from Bun with wasm-bindgen: the setup, the `#[wasm_bindgen]` macro surface (functions, classes, Result→throw, async, importing JS, js-sys), the `wasm-pack` build, and — critically — which target actually loads under Bun (`nodejs`, NOT `bundler`). Use this skill whenever the user wants to call Rust from Bun via WASM, "use wasm-bindgen", "wasm-pack with Bun", run a `.wasm` from a Rust crate in Bun, wants a portable sandboxed Rust artifact instead of a native addon, or is debugging why a wasm-bindgen module won't load in Bun (`__wbindgen_start is not a function`, wasm import resolving to a string) — even if they just say "compile my Rust to WASM for Bun".
Uses power tools
Uses Bash, Write, or Edit tools
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Everything to connect Rust and Bun, packaged as one Claude Code plugin: four skills + a specialist sub-agent.
| Skill | What it does |
|---|---|
| bun-ffi | The FFI mechanics — build a complete, correct Rust↔Bun bridge via bun:ffi (dlopen/cc/JSCallback): the type table, strings, buffers, structs, callbacks, memory ownership. Includes a tested scaffold.sh. |
| napi-rs | Build Rust native addons (.node) with napi-rs for Bun and Node: #[napi] macros, async, classes, errors-as-exceptions, ThreadsafeFunction, the build CLI and prebuild model. |
| wasm-bun | Run Rust→WebAssembly from Bun with wasm-bindgen: the macro surface, wasm-pack, and the Bun‑verified loading rule (--target nodejs, not bundler). |
| rust-bun | The decision + reference layer — every integration path (bun:ffi, N-API, Bun.spawn, WASM, IPC), how to choose, the cross-boundary type rules, and how Bun bridges Rust↔JS internally. |
| rs-to-ts | The workflow — turn a crate into a distributable Bun package: build automation, a manifest→bindings generator, a prototyping loop, and multi-platform distribution. |
cargo build + bun test instead of guessing.# add this directory as a local plugin marketplace, then install
/plugin marketplace add /home/aphrody/rs-bun
/plugin install rs-bun@rs-bun
Or point your Claude Code plugin config at this folder. The four skills are
auto-discovered from skills/; the agent is registered via plugin.json.
The runnable artifacts are tested against a real Rust cdylib + Bun:
bun-ffi/scripts/scaffold.sh → cargo build + bun test green, UTF-8 round trip.rs-to-ts/scripts/gen-bindings.ts → generates a typed dlopen wrapper from a
symbol manifest (auto string-encoding + CString/free), verified end-to-end.rs-bun/
├── .claude-plugin/
│ ├── plugin.json
│ └── marketplace.json
├── skills/{bun-ffi,napi-rs,wasm-bun,rust-bun,rs-to-ts}/
└── agents/bun-rs.md
bun-ffi).napi-rs).rust-bun).wasm-bun).bun:ffi is officially experimental; for production native code, prefer N-API.
npx claudepluginhub aphrody-code/rs-bun --plugin rs-bunExpert guidance for Next.js Cache Components and Partial Prerendering (PPR). Proactively activates in projects with cacheComponents: true, providing patterns for 'use cache' directive, cacheLife(), cacheTag(), cache invalidation, and parameter permutation rendering.
Bun-native Claude Code plugin co-located with the n2b migration tool (Rust + TS). Ships 23 agents (incl. bun-runner, bun-explorer, bun-dreamer, bun-deployer, bun-reviewer, n2b), 9 skills (analyze, deploy, dream, gemini-cli-cli, gemini-cli-jsx, green-gate, n2b, regen-baseline, run), session/memory hooks, autonomous output-style, and the n2b binary itself (cargo build --release -p n2b). Reusable across any repo — paths via ${CLAUDE_PLUGIN_ROOT}, project root via git, n2b binary via $PATH.
Comprehensive feature development workflow with specialized agents for codebase exploration, architecture design, and quality review
A growing collection of Claude-compatible academic workflow bundles. Covers scientific figures, manuscript writing and polishing, reviewer assessment, citation retrieval, data availability, paper reading, literature search, response letters, paper-to-PPTX conversion, and evidence-grounded Chinese invention patent drafting. Rules are organized as reusable skill folders with explicit workflows and quality checks.
Harness-native ECC operator layer - 67 agents, 271 skills, 92 legacy command shims, reusable hooks, rules, selective install profiles, and production-ready workflows for Claude Code, Codex, OpenCode, Cursor, and related agent harnesses
Upstash Context7 MCP server for up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your LLM context.
Comprehensive skill pack with 66 specialized skills for full-stack developers: 12 language experts (Python, TypeScript, Go, Rust, C++, Swift, Kotlin, C#, PHP, Java, SQL, JavaScript), 10 backend frameworks, 6 frontend/mobile, plus infrastructure, DevOps, security, and testing. Features progressive disclosure architecture for 50% faster loading.