ワンクリックで
krkr2-build
使用 CMake 和 Emscripten 编译构建 KrKr2 WebAssembly 项目。当用户需要编译、构建或重新构建项目、配置构建预设或排查构建错误时使用。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
使用 CMake 和 Emscripten 编译构建 KrKr2 WebAssembly 项目。当用户需要编译、构建或重新构建项目、配置构建预设或排查构建错误时使用。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
指导 Codex 中的 KrKr2 WebAssembly 完整调试工作流,从构建、服务器到应用内浏览器。当用户需要调试、测试或排查运行时环境的端到端问题时使用。
使用 IDA Pro MCP 工具逆向工程 libkrkr2.so(Android kirikiroid2)。 当用户要求检查 libkrkr2.so 如何实现某功能、将 Web 移植版的 C++ 代码与原始二进制对比、 查找函数地址、追踪调用链,或理解 NCB 类注册时使用此 skill。 在修复需要理解原始 Android 实现的 bug 时也应主动使用。 触发关键词:libkrkr2.so、IDA、反编译、逆向工程、原始实现、 Android kirikiroid2 二进制、"原版是怎么做的"、二进制中的 NCB 注册、 在 .so 文件中查找函数。
Write and update KrKr2 differential test cases for the current geometry_hit_test port-wasm/wasmtime scheme. Use when adding or editing JSON cases under tests/differential/specs/geometry_hit_test, updating EXPECTED_HITS in tests/differential/python/run_geometry_hit_test_wasmtime.py, or extending the current hit-test case set while preserving the existing case format, wasm ABI, and intended oracle-aligned expectations.
使用 mtndump 工具把 KiriKiri2 的 .mtn / .psb motion 文件里所有 src/ 源贴图导出为独立的 PNG,并生成一份 TSV manifest(source、png、宽高、origin、BGRA 标志)。用于 KrKr2/E-mote/EmotePlayer 的离线资源提取、differential testing(对比 libkrkr2.so 与 Web port 的贴图输出)、调试 motionplayer/EmotePlayer 渲染路径,或者只是想知道一个 motion 到底引用了哪些 src/<group>/<name> 贴图。典型触发:用户提到 "mtndump"、"dump motion"、"dump .mtn"、"dump .psb"、"提取 motion 贴图"、"解包 e-mote"、"导出 PSB 图像"、"EmotePlayer 的 src"、"emote 贴图"、"motion snapshot";或者在调试 motionplayer 渲染问题需要看原始贴图、做 KrKr2 差分测试需要对比贴图输出、提到 `tests/test_files/emote/*.psb` 或 seed `742877301` 时。
指导 KrKr2 WebAssembly 完整调试工作流,从构建到浏览器。当用户需要调试、测试或排查运行时环境的端到端问题时使用。
在 IDA Pro 中跨所有编码(UTF-8、UTF-16LE、UTF-32)搜索字符串,使用 IDAPython。IDA MCP 的 `find` 工具仅匹配 ASCII/UTF-8 字符串,会遗漏 UTF-16 编码的字符串——此 skill 修补了这个缺口。当用户要搜索或查找 IDA Pro 中的字符串时使用,尤其是当用户说"搜索字符串"、"search string"、"find string in IDA",或之前的 `find` 字符串搜索意外返回空结果时。
| name | krkr2-build |
| description | 使用 CMake 和 Emscripten 编译构建 KrKr2 WebAssembly 项目。当用户需要编译、构建或重新构建项目、配置构建预设或排查构建错误时使用。 |
确保以下环境变量已设置:
export VCPKG_ROOT=/path/to/vcpkg
source /path/to/emsdk/emsdk_env.sh
依赖工具:Emscripten SDK、vcpkg、ninja、cmake 3.31.1+、bison 3.8.2+、python3。
Emscripten 的端口库(SDL2、SDL2_ttf 等)在首次使用时按需编译并缓存。Ninja 并行构建时多个 em++ 进程同时触发端口编译会导致缓存锁冲突(EM_CACHE_IS_LOCKED 断言失败)。
首次构建前(或清空 emsdk 缓存后),必须先单线程预编译端口:
embuilder build sdl2 sdl2_ttf sdl2-mt sdl2_ttf-mt
此命令会自动编译 freetype、harfbuzz 等依赖。-mt 后缀为 pthreads 变体。缓存建立后后续构建无需重复执行。
产物文件:index.html、index.js、index.wasm、index.data、index.worker.js。
cmake --preset "Web Debug Config"
cmake --build out/web/debug
产物在 out/web/debug/ 下。
启用 AddressSanitizer,用于内存问题排查:
cmake --preset "Web Debug Asan Config"
cmake --build out/web/debug-asan
产物在 out/web/debug-asan/ 下。
cmake --preset "Web Release Config"
cmake --build out/web/release
产物在 out/web/release/ 下。