agentleFS
cosmonic-labscosmonic-labs/skills/webassembly-component-development/SKILL.md

webassembly-component-development

Skill21 starsChanged 10 months agoApache-2.0View on GitHub

Comprehensive guide to WebAssembly component development covering WASI fundamentals, component composition patterns, language interoperability, runtime compatibility, and troubleshooting. Use this skill when building WebAssembly components, writing or editing WIT (WebAssembly Interface Types) definitions, composing components with wac or wasm-tools, targeting wasip1/wasip2/wasip3, working with `.wit` or `.wasm` files, or whenever the user mentions WASI, the component model, wkg, wstd, or component composition.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 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.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Build: Use wash build when the project has .wash/config.yaml.

    line 13
  2. Very specific:

    Strings: Always UTF-8 on wasip2. Avoid as_encoded_bytes().

    line 16
  3. Very specific:

    wasmCloud docs: Always use https://wasmcloud.com/docs/ — never /docs/v1/.

    line 18

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

WebAssembly Component Development

This skill provides comprehensive expertise in developing WebAssembly components, including WASI fundamentals, composition patterns, runtime compatibility, and troubleshooting.

Key Defaults

  • Build: Use wash build when the project has .wash/config.yaml. Use wash build --skip-fetch for plugins (since wasmcloud:wash interface isn't published). Otherwise cargo build --target wasm32-wasip2 --release.
  • Target: wasm32-wasip2 (Rust 1.82+ tier-2 target). WASI 0.2 (wasip2) is the current standard.
  • Async: Pick one — tokio 1.50+ with RUSTFLAGS="--cfg tokio_unstable", or wstd (lighter, Wasm-native). Do not mix.
  • Strings: Always UTF-8 on wasip2. Avoid as_encoded_bytes().
  • Threading: Unsupported. Design single-threaded. Avoid rayon, threaded tokio, std::thread::spawn.
  • wasmCloud docs: Always use https://wasmcloud.com/docs/ — never /docs/v1/.

Reference Files

Load the relevant file when working on the matching topic:

TopicFile
Component Model fundamentals, benefits, WASI (wasip2) basicscore-concepts.md
Composition patterns (simple dependency, adapter, middleware, facade), boundary design, building with wash build / cargo, wac, .wash/config.yamlcomposition-and-building.md
Cross-language composition, supported languages (Rust, Python, JS/TS, Go, C/C++, C#), data type / performance / error handling considerationslanguage-interop.md
WASI gotchas (no threading, UTF-8 string assumptions, network capabilities), unknown-import errors, runtime-specific compatibility (wasmtime flags, wasmCloud), version alignment strategiesgotchas-and-runtime.md
Async with tokio on wasip2, wstd (Wasm-native async stdlib), when to choose whichasync.md
Testing (host harness, mocks, wash integration, feature flags, env setup), debugging workflow, common error patterns, wasm-tools/wash inspect, performance (minimize cross-component calls, streaming, batching)testing-debugging-performance.md
Documentation links, development/component-design/runtime-compat best practices, CI/CD examples, common architecture patterns (microservices, plugin, data pipeline)patterns-and-best-practices.md

Summary

  • Component Model enables language-agnostic, composable WebAssembly applications
  • WASI 0.2 (wasip2) is the current standard with full networking and UTF-8 guarantees
  • Design coarse-grained interfaces for better performance
  • Test in target runtime early and often
  • Use wash build for wasmCloud projects — handles compatibility automatically
  • Document runtime requirements and maintain compatibility matrices

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.