Agent skill

Wasm Opt

by wado-lang in wado-lang/wado

Run binaryen's wasm-opt over the core Wasm that Wado generates, and read what it changes.

MITAuto-check passedDevelopment

Install Wasm Opt

skills CLI
$ npx skills add wado-lang/wado --skill wasm-opt -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install wado-lang/wado wasm-opt --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/wado-lang/wado.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/wasm-opt .claude/skills/wasm-opt && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
wasm-opt
GitHub stars
117
Token cost
~1.8k tokens
SKILL.md length
841 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
MIT

At a glance

Run binaryen's wasm-opt over the core Wasm that Wado generates, and read what it changes.

  • Any question about wasm-opt
  • SKILL.md covers Setup, Pipeline, Reading the difference and Findings: zlib benchmark…
  • Calls curl and node; reaches github.com
  • Find where Wados codegen leaves size

What it does

Wasm Opt is an agent skill from wado-lang/wado. Run binaryen's wasm-opt over the core Wasm that Wado generates, and read what it changes. Use for any question about wasm-opt or binaryen, or to find where Wado's codegen leaves size or speed on the table.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Project scaffolding. It works with WebAssembly. The repository describes itself as: The Wado Programming Language. The licence is MIT.

When your agent uses it

  • Any question about wasm-opt
  • Find where Wados codegen leaves size
  • Speed on the table

Example prompts

  • “/wasm-opt”

What it can do on your machine

Read from SKILL.md and the folder at commit b1f1e2a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl
    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Wasm Opt loads about 1.8k tokens when it runs. Until then it costs about 54 tokens; SKILL.md has 841 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~54
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from wado-lang/wado at commit b1f1e2a, republished under its MIT licence (© wado-lang). 841 words, ~1,815 tokens.

Download SKILL.mdSave it as .claude/skills/wasm-opt/SKILL.md (or your agent's skills folder).
name
wasm-opt
description
Run binaryen's wasm-opt over the core Wasm that Wado generates, and read what it changes. Use for any question about wasm-opt or binaryen, or to find where Wado's codegen leaves size or speed on the table.

wasm-opt over Wado output

wasm-opt reads a core module, not a component. jco splits a Wado component and hands back its core module, so the pipeline runs through jco. What wasm-opt then removes shows what Wado's own codegen could remove.

Setup

binaryen is not in the mise registry, and mise's github: backend gets a 403 from the GitHub API in a cloud session. Download the release tarball instead:

sh
curl -sSL https://github.com/WebAssembly/binaryen/releases/download/version_133/binaryen-version_133-x86_64-linux.tar.gz | tar xz -C scratchpad

wasm-tools comes from mise. Where its shim reports no version set, call the binary under ~/.local/share/mise/installs/wasm-tools/latest/ directly.

Pipeline

sh
B=scratchpad/binaryen-version_133/bin
S=scratchpad/wasm-opt
FEATURES=(--mvp-features --enable-sign-ext --enable-mutable-globals
  --enable-nontrapping-float-to-int --enable-simd --enable-relaxed-simd
  --enable-bulk-memory --enable-bulk-memory-opt --enable-call-indirect-overlong
  --enable-exception-handling --enable-tail-call --enable-reference-types
  --enable-multivalue --enable-gc --enable-extended-const --enable-multimemory)
mkdir -p $S
wado compile -Os -f no-wide-arithmetic prog.wado -o $S/prog.wasm
node scripts/jco/transpile-released.mjs $S/prog.wasm $S/jco   # → $S/jco/prog.core.wasm
$B/wasm-opt "${FEATURES[@]}" $S/jco/prog.core.wasm -o $S/none.wasm
$B/wasm-opt "${FEATURES[@]}" -O3 $S/jco/prog.core.wasm -o $S/O3.wasm
  • Make -Os the baseline. It is -O2 with the name section stripped and assert messages dropped. An -O2 baseline counts about 9KB of names that wasm-opt drops by default.
  • -f no-wide-arithmetic is required, since the module is run on V8 (see the jco skill).
  • Name the features explicitly, as an array because zsh does not word-split a string. Never pass -all: it lets wasm-opt emit proposals V8 cannot load, compact imports among them.
  • The run with no pass (none.wasm) re-encodes the module and nothing more, so it separates encoding waste from optimization.
  • Add -g to keep function names for a diff. Measure size without it.

Reading the difference

  • wasm-tools objdump gives the size and count of each section.
  • wasm-tools dump annotates every byte. Use it for encoding questions, such as how the local declarations are grouped.
  • wasm-tools print gives WAT to diff. A whole-module diff is too large to read, so compare per-function instruction counts and opcode histograms with a small Node script instead.
  • -O2 --skip-pass=NAME measures what one pass is worth: the bytes -O2 grows by without it. Passes overlap, so these do not add up to the whole gap. Running a pass alone misleads for the -optimizing variants, which rerun the whole function pipeline on what they touch.

To run the result, copy the jco output directory and replace its <name>.core.wasm. Then run it as the jco skill describes. Keep a median of at least 7 runs per variant, since the spread on a cloud VM is ±15%.

Findings: zlib benchmark (binaryen 133, 2026-10)

Sizes of the zlib benchmark's core module:

VariantBytes
Wado -Os76,476
wasm-opt, no pass76,943
wasm-opt -O270,073
wasm-opt -O367,979
wasm-opt -Oz67,853

Re-encoding alone makes this module 467 bytes larger, so binaryen's encoding finds nothing to save in Wado's.

In 2026-09, on Node 26, decompression ran faster under wasm-opt -O2 and -Os: the median rose 10–40% across two sessions. Compression, and everything under -O3, stayed within the noise.

What each -O2 pass is worth, by --skip-pass:

PassBytesWhat it does to Wado's output
coalesce-locals2,230Mostly cleans up after inlining: 337 run alone
inlining-optimizing1,799Takes 114 functions to 53
optimize-instructions1,164Peepholes, ref.as_non_null among them
remove-unused-brs1,062Turns block/br_if/return into if/else
precompute-propagate782Constant propagation
dae-optimizing758Drops unused and always-constant parameters
heap2local664Turns non-escaping structs into locals
vacuum, merge-blocks824Removes the blocks the passes above leave behind

What wasm-opt removes, as open codegen targets:

  • Local declarations: the emitter wrote one entry per local, 2,942 entries and 7.1KB in all. Grouped by type, they take 346 entries and 1.0KB. wir_optimize/local_layout.rs groups them, and puts the most used first.
  • Duplicate function types: 136 types, of which -O2 keeps 69. Most of the rest go with the functions it inlines.
  • ref.as_non_null: -O2 takes the count from 388 to 16. Codegen added most of them, after reads of nullable global slots. A global promoted to a non-null constant now has a non-null slot (wir_optimize/const_global.rs). The object of a GC access, which traps on null by itself, is not narrowed (wir_optimize/cleanup.rs). The -Os build keeps 17.
  • Set-then-get: a local.set X followed at once by local.get X occurred 1,191 times. wasm-opt turns it into a local.tee or removes it. The last WIR pass fuses each pair into a tee (fuse_remaining_local_tees), and copy propagation removes a copy of a tee'd local. The -Os build keeps 39 pairs.
  • Set sinking: simplify-locals moves a local.set into the one read of it, so the value stays on the stack. -O2 removes 565 local.set and 725 local.get, and adds 188 local.tee.
  • Local coalescing: wasm-opt merges locals whose live ranges never overlap, as a register allocator would. wir_optimize/local_coalesce.rs does the same per Wasm type. On the -Os build it takes 2,752 locals to 1,020.
  • Control-flow shape: -O2 takes block from 229 to 57, br_if from 191 to 54, and return from 184 to 44, while if grows from 1,278 to 1,385.
  • Single-caller inlining: -O2 inlines functions with one caller whatever their size, inflate_fast among them.
  • Identical functions: the -Os build has none. The -O2 build keeps 9 copies of the outlined $cold0 bounds-check path of List<T>::index_value and index_assign, one per element type, and i32's Display::fmt equals its Inspect::inspect. --duplicate-function-elimination saves 4,722 bytes there. Two param_spec clones whose bindings differ can fold to one body (fmt_float_special$spec0 and $spec1 in json_twitter).
  • Empty functions: a module whose globals all become constants keeps an empty $initialize_module. wir_optimize/empty_work.rs removes the calls to it and the once-flag that guarded them, and DCE drops both.

© wado-lang, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/wasm-opt of wado-lang/wado.

Open the folder on GitHubat commit b1f1e2a

Compare with similar skills

Wasm Opt next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Wasm Opt compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Wasm Opt this skillwado-lang/wado117—~1.8kAutomated safety check: PassMIT
Create Blazor Projectdotnet/skills5.6k1 repos~3kAutomated safety check: PassMIT
Cosmwasm Contractaxone-protocol/contracts123—~1.2kAutomated safety check: PassBSD-3-Clause
Fetch And Send Datadotnet/skills5.6k1 repos~2.5kAutomated safety check: PassMIT
Deployjustrach/merjs357—~171Automated safety check: PassMIT
Nx Generatenomcopter/react-mosaic4.8k7 repos~1.9kAutomated safety check: PassCustom licence

Similar skills

  • Official

    Create a new ASP.NET Core web application or web site using Blazor.

    5.6k GitHub starsUsed in 1 repo~3k tokens
    DevelopmentAuto-check passed
  • Cosmwasm Contract

    axone-protocol/contracts

    Axone contract structure and Abstract SDK patterns. An agent skill from axone-protocol/contracts.

    123 GitHub stars~1.2k tokensUpdated 13 days ago
    DevelopmentAuto-check passed
  • Fetch And Send Data

    dotnet/skills

    Official

    Call APIs, load data into components, and handle the async lifecycle in Blazor.

    5.6k GitHub starsUsed in 1 repo~2.5k tokens
    DevelopmentAuto-check passed
  • Deploy

    justrach/merjs

    Full production build — codegen, compile, prerender, and prepare for deployment.

    357 GitHub stars~171 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Nx Generate

    nomcopter/react-mosaic

    Generate code using nx generators. An agent skill from nomcopter/react-mosaic.

    4.8k GitHub starsUsed in 7 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Ponytail

    DavidObando/gsharp

    Forces the laziest solution that actually works, simplest, shortest, most minimal.

    564 GitHub starsUsed in 8 repos~1.7k tokens
    DevelopmentAuto-check passed

More from wado-lang/wado

All 15 skills in this repo
  • Profile the native Rust wado binary (compile/serve/run) for host-side bottlenecks — CPU with a sampling profiler, memory with the span trace's RSS and valgrind DHAT.

    117 GitHub stars~2.9k tokensUpdated today
    Auto-check: notes
  • Wado Performance

    wado-lang/wado

    Analyze and improve the runtime speed of a Wado program's compiled guest Wasm — profile hot functions, read the generated WIR for allocations and copies, reason about the WasmGC cost model, and…

    117 GitHub stars~7.5k tokensUpdated today
    Auto-check passed
  • CI Timing

    wado-lang/wado

    Measure how long GitHub Actions jobs and steps took across past runs, and find the pull request that made CI slower.

    117 GitHub stars~518 tokensUpdated today
    Auto-check passed
  • Investigate and improve code coverage for the wado-compiler crate.

    117 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Git Upstream Sync

    wado-lang/wado

    The only way to merge origin/main into a branch, conflicts or not.

    117 GitHub stars~855 tokensUpdated today
    Auto-check passed
  • Jco

    wado-lang/wado

    Transpile Wado Wasm components to JS with jco, then run, debug, and benchmark them on Node.

    117 GitHub stars~2.7k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Wasm Opt

What does Wasm Opt do?

Run binaryen's wasm-opt over the core Wasm that Wado generates, and read what it changes. Wasm Opt is an agent skill from wado-lang/wado. Run binaryen's wasm-opt over the core Wasm that Wado generates, and read what it changes.

When should I use Wasm Opt?

Wasm Opt fits situations like: any question about wasm-opt; find where Wados codegen leaves size; speed on the table.

How do I install Wasm Opt in Claude Code?

Run `npx skills add wado-lang/wado --skill wasm-opt -a claude-code`. Or copy the skill folder (.claude/skills/wasm-opt in wado-lang/wado) into .claude/skills/wasm-opt in your project. Claude Code loads it when a task matches its description.

How do I install Wasm Opt in Codex?

Run `npx skills add wado-lang/wado --skill wasm-opt -a codex`. Or copy the skill folder (.claude/skills/wasm-opt in wado-lang/wado) into .agents/skills/wasm-opt in your project. Codex loads it when a task matches its description.

Can I use Wasm Opt in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wado-lang/wado --skill wasm-opt -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/wasm-opt, .gemini/skills/wasm-opt, .github/skills/wasm-opt and .opencode/skills/wasm-opt in your project.

What does Wasm Opt need to run?

Going by SKILL.md and its folder, Wasm Opt needs the command-line tools its instructions call (curl and node).

Does Wasm Opt access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Wasm Opt safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Wasm Opt use?

Wasm Opt is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Wasm Opt use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Wasm Opt?

Skills that share tags, products or a category with Wasm Opt: Create Blazor Project (dotnet/skills, 5.6k stars), Cosmwasm Contract (axone-protocol/contracts, 123 stars), Fetch And Send Data (dotnet/skills, 5.6k stars) and Deploy (justrach/merjs, 357 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Wasm Opt?

wado-lang (a GitHub organization) maintains it in wado-lang/wado, which has 117 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 9, 2026.

Source: wado-lang/wado on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.