Profiling Wado Compiler
wado-lang/wado
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.
This skill should be used when managing WASM handle lifetimes or hunting memory leaks in brepjs — when a task mentions "createHandle() without using keyword risks WASM memory leak"…
$ npx skills add andymai/brepjs --skill memory-and-disposal -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install andymai/brepjs memory-and-disposal --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/andymai/brepjs.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/memory-and-disposal .claude/skills/memory-and-disposal && rm -rf skills-srcUse ~/.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/
Install the "memory-and-disposal" agent skill from https://github.com/andymai/brepjs/tree/main/.claude/skills/memory-and-disposal into .claude/skills/memory-and-disposal/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "memory-and-disposal", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/andymai/brepjs/tree/main/.claude/skills/memory-and-disposalType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add andymai/brepjs --skill memory-and-disposal -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install andymai/brepjs memory-and-disposal --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/andymai/brepjs.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/memory-and-disposal .agents/skills/memory-and-disposal && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "memory-and-disposal" agent skill from https://github.com/andymai/brepjs/tree/main/.claude/skills/memory-and-disposal into .agents/skills/memory-and-disposal/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "memory-and-disposal", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add andymai/brepjs --skill memory-and-disposal -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install andymai/brepjs memory-and-disposal --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/andymai/brepjs.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/memory-and-disposal .cursor/skills/memory-and-disposal && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "memory-and-disposal" agent skill from https://github.com/andymai/brepjs/tree/main/.claude/skills/memory-and-disposal into .cursor/skills/memory-and-disposal/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "memory-and-disposal", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/andymai/brepjs.git --path .claude/skills/memory-and-disposal--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add andymai/brepjs --skill memory-and-disposal -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install andymai/brepjs memory-and-disposal --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/andymai/brepjs.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/memory-and-disposal .gemini/skills/memory-and-disposal && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "memory-and-disposal" agent skill from https://github.com/andymai/brepjs/tree/main/.claude/skills/memory-and-disposal into .gemini/skills/memory-and-disposal/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "memory-and-disposal", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install andymai/brepjs memory-and-disposalInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add andymai/brepjs --skill memory-and-disposal -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/andymai/brepjs.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/memory-and-disposal .github/skills/memory-and-disposal && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "memory-and-disposal" agent skill from https://github.com/andymai/brepjs/tree/main/.claude/skills/memory-and-disposal into .github/skills/memory-and-disposal/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "memory-and-disposal", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add andymai/brepjs --skill memory-and-disposal -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install andymai/brepjs memory-and-disposal --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/andymai/brepjs.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/memory-and-disposal .opencode/skills/memory-and-disposal && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "memory-and-disposal" agent skill from https://github.com/andymai/brepjs/tree/main/.claude/skills/memory-and-disposal into .opencode/skills/memory-and-disposal/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "memory-and-disposal", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
memory-and-disposalThis skill should be used when managing WASM handle lifetimes or hunting memory leaks in brepjs — when a task mentions "createHandle() without using keyword risks WASM memory leak"…
Memory And Disposal is an agent skill from andymai/brepjs. This skill should be used when managing WASM handle lifetimes or hunting memory leaks in brepjs — when a task mentions "createHandle() without using keyword risks WASM memory leak", "require-using-for-handles", "Shape handle has been disposed", "kernel handle has been disposed", "memory grows / heap keeps climbing", "leaking shapes", "getDisposalStats / gcCollected", "DisposalScope register vs track", "withScopeResult", "kernelCallScoped", "registerForCleanup", "returned shape from withScope is disposed", or…
Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/kernel-memory-models.md`).
It sits in Development, covering Performance optimization. It works with WebAssembly. The repository describes itself as: Web CAD library with exact B-Rep geometry. The licence is Apache-2.0.
3 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 2907fb1. It shows what the files ask for, not the result of running them.
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.
Shell commands in SKILL.md call:
npmFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Memory And Disposal loads about 3.1k tokens when it runs, and up to ~4.2k if it reads all its reference files. Until then it costs about 151 tokens; SKILL.md has 1,170 words of instructions outside code blocks.
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.
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.
The full file from andymai/brepjs at commit 2907fb1, republished under its Apache-2.0 licence (© andymai). 1,170 words, ~3,076 tokens.
.claude/skills/memory-and-disposal/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.WASM objects are not visible to the JS garbage collector — a leaked shape grows WASM linear memory silently. Every branded shape (Vertex, Edge, Wire, Face, Shell, Solid, CompSolid, Compound) IS a disposable handle: src/core/shapeTypes.ts wraps each via createHandle() (src/core/disposal.ts). Cleanup has one primary rule and one safety net:
using / Symbol.dispose / DisposalScope. This is the plan.FinalizationRegistry (disposal.ts) frees handles that were never disposed — non-deterministic, GC-timed, never something to rely on. Environments lacking it get a no-op stub plus a console.warn (disposal.ts).User-facing prose lives in docs/memory-management.md (the four mechanisms, using examples, LIFO, heap-monitoring snippets, three common leak patterns) and the maintainer deep-dive in src/core/README.md. This skill adds what those lack: the tool-selection table, the pattern-checker rule, the kernel-dependent free semantics, and the leak-hunting workflow. Do not re-read those two docs for basics — point users to them.
using requires "target": "ES2022" + "lib": ["ES2022", "ESNext.Disposable"]; the repo tsconfig.json:3,6 already sets this.
| Situation | Tool | Notes |
|---|---|---|
| One temporary, freed at end of block | using x = createHandle(...) | Or using x = someFn() for any branded shape |
| Several temporaries in one function | using scope = new DisposalScope() + scope.register(...) | LIFO disposal; see ordering rule |
A Result-returning *Fns.ts op that allocates | kernelCallScoped(fn, code, msg) or withScopeResult(fn) | Scope disposed on Ok, Err, AND throw |
Async Result op | withScopeResultAsync(fn) | Note the intentional return await |
using for a single handleusing box = box(1, 1, 1);Any branded shape works directly this way, since every shape is a ShapeHandle. Accessing .wrapped after disposal throws 'Shape handle has been disposed' (disposal.ts); the KernelHandle variant throws 'kernel handle has been disposed' (disposal.ts). Double-dispose is safe — dispose is idempotent and inner delete() failures are swallowed.
DisposalScope — register vs track, and LIFOTwo registration methods, both return their argument for inline use:
scope.register(resource) — for anything Deletable ({ delete() }); calls .delete() on dispose (disposal.ts).scope.track(disposable) — for anything with [Symbol.dispose] (branded shapes, Curve2DHandle); calls [Symbol.dispose]() (disposal.ts).DisposalScope disposes in LIFO (reverse-registration) order (disposal.ts). The ordering rule (also a CLAUDE.md gotcha): register a dependency AFTER its dependee, so the dependent is disposed first. If B is built from A, register A first and B second.
Real code overwhelmingly uses the scope directly — using scope = new DisposalScope() then scope.register(...) (e.g. src/sketching/draw3d.ts, src/operations/threadFns.ts, src/gear/gearFns.ts). Prefer this idiom.
Result-returning opskernelCallScoped(fn, code, message) (src/core/kernelCall.ts) creates a scope, runs fn, and disposes deterministically after return or throw — the canonical wrapper for a *Fns.ts op that needs intermediate kernel allocations and returns Result<AnyShape>:
return kernelCallScoped(
(scope) => {
const axis = scope.register(makeKernelAx1(origin, dir));
return getKernel().revolveVec(shape.wrapped, axis);
},
BrepErrorCode.REVOLUTION_NOT_3D,
'Revolution failed'
);withScopeResult(fn) (disposal.ts) is the same scope discipline for any Result-returning function. withScopeResultAsync(fn) (disposal.ts) is the async variant — its body is return await fn(scope). The await is load-bearing: using disposes synchronously at end of block, so without await the scope would dispose before the promise settles. Keep the await.
These helpers are exported and documented but rarely called directly in src/; present them as available conveniences, not the dominant convention.
require-using-for-handlesThe pattern checker (scripts/check-patterns.ts, severity error) flags any createHandle() / createKernelHandle() call not bound with using. Message: "createHandle() without \using` keyword risks WASM memory leak.`"
Excused positions (check-patterns.ts):
using x = createHandle(...)return createHandle(...) — caller owns lifetimescope.register(createHandle(...)){ k: createHandle(...) } or array literal [createHandle(...)]It does not catch handles nested in ternaries/sub-expressions — those slip through. Scan scope is src/**/*.ts only (tests and scripts exempt, check-patterns.ts).
Inline disable (line above or inline):
// brepjs-patterns-disable: require-using-for-handlesReal use: createCurve2DHandle in src/core/curve2dHandle.ts, which returns the handle for the caller to own.
Where it runs: npm run check:patterns, pre-commit via lint-staged on staged src/**/*.ts, and CI's quality job. The baseline .pattern-baseline.json contains zero require-using-for-handles entries (see the quality-gates skill for the current baseline composition) — so ANY new violation of this rule fails the gate immediately; there is no baseline slack to absorb it. For baseline mechanics and the general pattern-checker workflow, see the quality-gates skill.
withScope/DisposalScope while intermediates are registered stays valid and meshable after the scope disposes. Registered intermediates are freed; the returned one is not (regression tests/withScope-disposal.test.ts, issue #723). Registering the returned value is a use-after-dispose bug.registerForCleanup(owner, deletable) / unregisterFromCleanup(deletable) (disposal.ts) — FinalizationRegistry cleanup keyed on owner. Used by Curve2D (src/2d/lib/curve2D.ts).isLive(handle) (disposal.ts) is a named !handle.disposed. Pattern: if (!isLive(h)) return err(...).createKernelHandle(ocObj) for anything Deletable (.value getter instead of .wrapped). Curve2DHandle (src/core/curve2dHandle.ts) shows the branded-wrapper pattern, including synthesizing a no-op Deletable for arena handles that lack delete().The disposal API is uniform but the WASM-side effect of .delete() depends on the active kernel. Under the default occt-wasm kernel, a handle's delete() is a no-op — the shape lives in a WASM arena and is freed only by getKernel().dispose(shape.wrapped) → k.release(id), or releaseAll() on kernel teardown. Under Embind kernels (brepjs-opencascade) .delete() genuinely frees. So using on a branded shape always gives use-after-dispose protection and stats, but only frees arena memory on Embind. This split is the single most common source of confusion when a leak reproduces on one kernel and not another.
Full file:line breakdown, the arena vs Embind table, Embind vector cleanup, and internal getKernel().dispose() call sites are in references/kernel-memory-models.md. Read it before diagnosing a kernel-specific leak.
getDisposalStats() / resetDisposalStats() (disposal.ts) return { liveHandles, peakHandles, gcCollected, scopeEnters, scopeExits }. Workflow:
resetDisposalStats() before the suspect operation.getDisposalStats() after.Symptom → meaning:
| Reading | Meaning |
|---|---|
gcCollected > 0 | Handles were reclaimed by the FinalizationRegistry — code forgot to dispose them. Each is a missed using. |
peakHandles high in a loop | Handles accumulate within an iteration; move disposal inside the loop body (a using per iteration or a per-iteration scope). |
liveHandles non-zero at rest | Suggestive, but do not assert absolute values — the FinalizationRegistry adjusts it asynchronously after a synchronous reset, so it can even go negative for later readers (tests/disposalStats.test.ts). Use it as a trend signal, not a hard number. |
For heap-monitoring snippets (performance.memory, WASM heap size), see docs/memory-management.md.
tests/disposal.test.ts is skipped on occt-wasm — describe.skipIf(shouldSkipSuite('disposal')) — because it wraps raw Embind oc objects that the default kernel does not expose. Do not add default-kernel coverage there.tests/disposalStats.test.ts (exercises stats, isLive, withScopeResult without touching oc).tests/withScope-disposal.test.ts as the exemplar for return-value lifecycle assertions.General test skeleton, geometry assertions, and kernel-skip mechanics are in the writing-tests skill.
gcWithScope, gcWithObject, and localGC were removed in commit d7e33e50 (#331). If old snippets reference them, they are gone — replace with using/DisposalScope.
.delete()), Embind vector cleanup, internal getKernel().dispose() call sites, with file:line anchors.docs/memory-management.md — user-facing cleanup guide + heap monitoring.src/core/README.md (disposal section) — maintainer deep-dive with API signatures and rationale.quality-gates (pattern-checker baseline workflow), kernel-abstraction (the .wrapped / getKernel() contract), writing-tests (test skeleton + kernel skips), result-error-handling (kernelCall / error codes), adding-operations (where cleanup fits in a new *Fns.ts).© andymai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file (references) in .claude/skills/memory-and-disposal of andymai/brepjs.
Open the folder on GitHubat commit 2907fb1
Memory And Disposal 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Memory And Disposal this skillandymai/brepjs | 115 | — | ~3.1k | Automated safety check: Pass | Apache-2.0 | |
| Profiling Wado Compilerwado-lang/wado | 117 | — | ~2.9k | Automated safety check: Notes | MIT | |
| Wado Performancewado-lang/wado | 117 | — | ~7.5k | Automated safety check: Pass | MIT | |
| Code Review ChecklistshareAI-lab/learn-claude-code | 78k | 4 repos | ~1.1k | Automated safety check: Pass | MIT | |
| LLM Torch Profiler Analysissgl-project/sglang | 37k | 2 repos | ~6.4k | Automated safety check: Pass | Apache-2.0 | |
| Pycrazyguitar/pysheeet | 8.2k | — | ~886 | Automated safety check: Pass | MIT |
wado-lang/wado
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.
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…
shareAI-lab/learn-claude-code
Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.
sgl-project/sglang
Unified LLM torch-profiler triage skill for sglang, vllm, TensorRT-LLM, and TokenSpeed.
crazyguitar/pysheeet
Comprehensive Python programming reference covering syntax, concurrency, networking, databases, ML/LLM development, and HPC.
manaflow-ai/cmux
Covers debug logging, the Debug menu, profiling rules and runtime pitfalls for working on the cmux macOS terminal app.
andymai/brepjs
A skill your agent uses when authoring or editing a brepjs .brep.ts part — writing the geometry with the functional API (box, cylinder, fuse, cut, fillet, sketch→extrude…), declaring an expected…
andymai/brepjs
A skill your agent uses when a valid brepjs part should look designed rather than glued-from-primitives (products, toys, mechanisms, anything a human eyeballs), and when exporting/handing off the…
andymai/brepjs
This skill should be used when working across the JS/WASM boundary in brepjs — writing or debugging code in src/kernel/occt, src/kernel/occtWasm, or src/kernel/brepkit, or diagnosing symptoms like…
andymai/brepjs
This skill should be used when writing, running, or fixing tests in the brepjs repository — when a task says "add a test", "write a regression test", "tests are failing", "test timed out", "coverage…
andymai/brepjs
This skill should be used when adding or extending a geometric shape operation in brepjs — the end-to-end recipe once the target module is chosen (which is decided by architecture-navigation) — when…
andymai/brepjs
This skill should be used when deciding which layer or module a new file, function, or directory belongs in, or when a layer-boundary check fails.
Works with
Categories
This skill should be used when managing WASM handle lifetimes or hunting memory leaks in brepjs — when a task mentions "createHandle() without using keyword risks WASM memory leak"…. Memory And Disposal is an agent skill from andymai/brepjs.
Memory And Disposal fits situations like: tasks that involve Performance optimization.
Run `npx skills add andymai/brepjs --skill memory-and-disposal -a claude-code`. Or copy the skill folder (.claude/skills/memory-and-disposal in andymai/brepjs) into .claude/skills/memory-and-disposal in your project. Claude Code loads it when a task matches its description.
Run `npx skills add andymai/brepjs --skill memory-and-disposal -a codex`. Or copy the skill folder (.claude/skills/memory-and-disposal in andymai/brepjs) into .agents/skills/memory-and-disposal in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add andymai/brepjs --skill memory-and-disposal -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/memory-and-disposal, .gemini/skills/memory-and-disposal, .github/skills/memory-and-disposal and .opencode/skills/memory-and-disposal in your project.
Going by SKILL.md and its folder, Memory And Disposal needs the command-line tools its instructions call (npm).
SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
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.
Memory And Disposal is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Memory And Disposal: Profiling Wado Compiler (wado-lang/wado, 117 stars), Wado Performance (wado-lang/wado, 117 stars), Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars) and LLM Torch Profiler Analysis (sgl-project/sglang, 37k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
andymai (a GitHub user) maintains it in andymai/brepjs, which has 115 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on October 9, 2026.
Source: andymai/brepjs on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.