cpp-wasm-engineer
2
总安装量
2
周安装量
#67594
全站排名
安装命令
npx skills add https://github.com/kimwoonggon/cpp-wasm-engineer-skill --skill cpp-wasm-engineer
Agent 安装分布
amp
2
gemini-cli
2
github-copilot
2
codex
2
kimi-cli
2
cursor
2
Skill 文档
C++ WASM Engineer
Drive C++-first WebAssembly delivery with deterministic diagnosis, minimal-risk build settings, and explicit runtime constraints.
Skill Routing
- Use this skill for C++/C, CMake, Make, Emscripten, WASI, raylib/SDL ports, and browser runtime debugging.
- Keep
discover-wasmas a gateway only; treat this skill as the implementation authority for C++. - Route Rust smart-contract specific tasks to
multiversx-wasm-debug.
Core Workflow
- Classify target first.
Choose one:
browser,worker,node,wasi, orhybrid. - Pin the toolchain and entrypoints. Capture exact compiler, linker, and exported symbol list before edits.
- Build a minimal reproducible artifact. Reduce to the smallest command or target that still fails.
- Resolve runtime contract mismatches. Check environment assumptions: threads, filesystem, MIME, CORS, JS glue, and memory model.
- Verify with evidence. Run target-specific smoke tests plus size and symbol checks before closing.
Target Decision Matrix
| Requirement | Prefer | Reason |
|---|---|---|
| DOM/WebGL/audio/canvas integration | Emscripten | Provides JS glue and browser APIs |
| Portable server/runtime execution without browser APIs | WASI | Lean runtime contract |
| Same core library in browser and backend | Hybrid (Emscripten + WASI) | Share core, split platform adapters |
| Existing desktop CMake app | Emscripten first | Lowest migration friction |
| Strict startup and binary-size budget | Either, benchmark both | Tradeoffs depend on JS glue + libc usage |
Hard Rules
- Keep all build flags explicit and version-controlled.
- Export only required symbols and runtime methods.
- Fail fast on undefined symbols while iterating.
- Keep debug and release presets separate; never blend flags ad hoc.
- Treat browser headers and hosting config as part of the build contract.
- Document every non-default flag with the symptom it solves.
- For interactive bug fixes, require executable e2e evidence (keyboard + control-click/tap + drag + audio) before closure.
- Record each encountered error with symptom/root-cause/fix/evidence in project error reports.
Load References On Demand
- Read
references/toolchain-build.mdfor CMake/Make/direct builds, export policy, and Emscripten vs WASI setup. - Read
references/runtime-interop.mdfor JS bridge, event loop, async, filesystem, and pthread runtime constraints. - Read
references/debugging-optimization.mdfor debug presets, sanitizers, wasm inspection, and size/perf tuning. - Read
references/edge-cases.mdfor symptom-driven triage and high-frequency failure patterns. - Read
references/source-index.mdto trace official sources used by this skill.
Execution Templates
Template A: Migrate desktop CMake app to browser WASM
- Configure with
emcmake cmake. - Build with
cmake --build. - Replace blocking desktop loop with browser-compatible main loop.
- Declare exports and runtime methods explicitly.
- Validate in served HTTP context, not
file://.
Template B: Fix runtime trap quickly
- Rebuild with debug preset.
- Inspect wasm sections and symbols.
- Map trap to one of: memory, symbol export/import, threading, async boundary, or JS interop contract.
- Apply one fix at a time; retest after each.
- Re-run release preset and compare size/perf regression.
Template C: Prepare production artifact
- Switch to release preset and run wasm optimizer pass.
- Audit exports, assets, and filesystem usage.
- Verify hosting headers for threads and MIME.
- Run smoke tests in target browsers/runtimes.
- Record artifact size, startup time, and known constraints.
Done Criteria
- Build is reproducible with committed commands.
- Runtime behavior is validated in intended environment.
- Edge-case checks for threads, memory, and loader headers are complete.
- Debug/release presets are documented and separate.
- Remaining limitations are explicit.