AgentSkillsCN

Check Exports

检查导出

SKILL.md

Skill: Check WASM Exports

Audit WASM export consistency across the three integration layers.

Usage

/check-exports

Process

1. Collect C++ Exports

Find all EMSCRIPTEN_KEEPALIVE functions in src/bindings/wasm_interface.cpp:

bash
grep -B0 -A1 'EMSCRIPTEN_KEEPALIVE' src/bindings/wasm_interface.cpp

2. Collect CMake Exports

Extract all entries from EXPORTED_FUNCTIONS in CMakeLists.txt:

bash
grep '"_' CMakeLists.txt

3. Collect JavaScript Usage

Find all wasmModule._ calls across all JS files:

bash
grep -rn 'wasmModule\._' src/js/

4. Cross-Reference and Report

CategorySeverityMeaning
C++ defined, missing from CMakeERRORFunction will be stripped by linker
CMake listed, no C++ implementationWARNINGPhantom export, link may fail
JS calls function not in CMakeERRORRuntime crash — function not available
CMake listed, never called from JSINFOUnused export (may be intentional)

5. Output Format

code
## WASM Export Audit

### Errors (must fix)
- _functionName: defined in C++ but missing from EXPORTED_FUNCTIONS

### Warnings
- _functionName: in EXPORTED_FUNCTIONS but no C++ implementation

### Info
- _functionName: exported but not called from JavaScript

### Summary
- C++ exports: N
- CMake exports: N
- JS call sites: N
- Status: PASS / FAIL