webassembly-component-development
Skill21 starsChanged 31 days agoApache-2.0View on GitHub
Build, compose, run, test and debug WebAssembly components targeting WASI 0.3 (wasip3) with native async. Use this skill whenever the user is building or troubleshooting a component or `.wasm` file, targeting `wasm32-wasip3` (or falling back to wasip2/wasip1), choosing an async approach, composing components with wac or wasm-tools, resolving WIT dependencies (wkg, wit-bindgen, `wash wit update`), hitting "unknown import" or version-mismatch errors, picking a runtime (wasmtime, jco, wasmCloud), or working across languages (Rust, JS/TS, Go, Python, C/C++). Also use it when the user mentions WASI, the component model, wasip3, or component composition. For designing or reviewing the WIT interfaces themselves (naming, capability scoping, errors, versioning), use wit-interface-design.
In this repository5 other files it gives its agents.
- cosmonic-wasmcloud-brand-guidelinesSkill
- helm-chartsSkill
- rust-developmentSkill
- washSkill
- wit-interface-designSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Build: use wash build when the project has .wash/config.yaml.
- Very specific: line 15
Async: use the component model's native async: async fn in exported handlers, wit_stream / wit_future for streams and futures, …
- Very specific: line 16
Threading: not available yet. std::thread::spawn returns an error on wasip3, and cooperative threading is still in development.
- Very specific: line 19
wasmCloud docs: use https://wasmcloud.com/docs/, never /docs/v1/.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
WebAssembly Component Development
Build components against WASI 0.3 (wasip3). It adds native async, stream<T> and future<T> to the component model, so most of the old workarounds (poll loops, tokio_unstable, third-party async runtimes) are no longer needed for new code. Fall back to wasip2 only when a runtime or dependency requires it.
Key Defaults
- Target:
wasm32-wasip3(Tier 2 in Rust, stable since 1.100.0). Use thewasip3crate for WASI bindings (wasip2crate for the fallback). Gate code with#[cfg(all(target_os = "wasi", target_env = "p3"))]. - Build: use
wash buildwhen the project has.wash/config.yaml. For plugins usewash build --skip-fetch(thewasmcloud:washinterface isn't published). Otherwisecargo build --target wasm32-wasip3 --release. - Async: use the component model's native async:
async fnin exported handlers,wit_stream/wit_futurefor streams and futures,wit_bindgen::spawn_localfor background tasks. Don't pull intokioorwstdfor new p3 code (see async.md). - Threading: not available yet.
std::thread::spawnreturns an error on wasip3, and cooperative threading is still in development. Design single-threaded and avoidrayon. - Strings: UTF-8. Avoid
as_encoded_bytes(). - Version matching: the runtime must implement the exact WASI 0.3.x versions your component imports. Check with
wasm-tools component wit component.wasm. - wasmCloud docs: use https://wasmcloud.com/docs/, never
/docs/v1/.
Reference Files
Load the relevant file when working on the matching topic:
| Topic | File |
| Component Model, wasip3 vs wasip2, targets and worlds | core-concepts.md |
Composition patterns, building with wash / cargo, wac, .wash/config.yaml | composition-and-building.md |
| Languages and toolchains (Rust, JS/TS, Go, Python, C/C++) | language-interop.md |
Native async on wasip3: handlers, streams, futures, spawning; the wasip2 fallback (tokio, wstd) | async.md |
| Gotchas (threading, strings, networking), unknown-import errors, runtimes (wasmtime, jco, wasmCloud), version alignment | gotchas-and-runtime.md |
| Testing with mock components, debugging workflow, error patterns, performance | testing-debugging-performance.md |
| Development practices, CI/CD, architecture patterns | patterns-and-best-practices.md |
| Designing or reviewing WIT interfaces (naming, capability grants, errors, versioning) | the wit-interface-design skill |
Related skills
wit-interface-design: how to design the WIT contract.wash: thewash build/wash devtoolchain.cosmonic-go: Go components withcomponentize-goon async wasip3.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

