بنقرة واحدة
krkr2-debug
指导 Codex 中的 KrKr2 WebAssembly 完整调试工作流,从构建、服务器到应用内浏览器。当用户需要调试、测试或排查运行时环境的端到端问题时使用。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
指导 Codex 中的 KrKr2 WebAssembly 完整调试工作流,从构建、服务器到应用内浏览器。当用户需要调试、测试或排查运行时环境的端到端问题时使用。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
使用 IDA Pro MCP 工具逆向工程 libkrkr2.so(Android kirikiroid2)。 当用户要求检查 libkrkr2.so 如何实现某功能、将 Web 移植版的 C++ 代码与原始二进制对比、 查找函数地址、追踪调用链,或理解 NCB 类注册时使用此 skill。 在修复需要理解原始 Android 实现的 bug 时也应主动使用。 触发关键词:libkrkr2.so、IDA、反编译、逆向工程、原始实现、 Android kirikiroid2 二进制、"原版是怎么做的"、二进制中的 NCB 注册、 在 .so 文件中查找函数。
使用 CMake 和 Emscripten 编译构建 KrKr2 WebAssembly 项目。当用户需要编译、构建或重新构建项目、配置构建预设或排查构建错误时使用。
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-debug |
| description | 指导 Codex 中的 KrKr2 WebAssembly 完整调试工作流,从构建、服务器到应用内浏览器。当用户需要调试、测试或排查运行时环境的端到端问题时使用。 |
服务器启动后,使用 Codex 的 browser:control-in-app-browser skill 控制应用内浏览器。不要使用或假定存在 playwright-cli,也不要把 Claude 版 krkr2-debug 的 CLI 命令移植到 Codex 工作流。
开始浏览器操作前必须完整读取 browser:control-in-app-browser skill,并严格按它完成运行时初始化、浏览器选择以及浏览器自身文档读取。浏览器连接和 tab binding 应在同一调试任务内复用;tab 失效时重新取得 tab,不要重复初始化浏览器运行时。
?game=xxx.zip — 加载 ZIP 打包的游戏(ZIP 内含 XP3 文件)?xp3=xxx.xp3 — 直接加载单个 XP3 文件(需先复制到 out/web/debug/ 目录)?game=xxx.zip&entry=data.xp3 — 加载 ZIP 并指定入口 XP3不要混用 game 和 xp3。
WASM 引擎每秒可能产生数百条控制台日志。浏览器提供的近期 console 视图可能遗漏初始化阶段日志,不能单独作为诊断依据。
正确流程:
window._filteredLogs。注入脚本的核心逻辑如下;具体调用方法必须使用当前浏览器文档中支持的 API,不要包装成 playwright-cli run-code:
window._allLogCount = 0;
window._filteredLogs = [];
const original = {
log: console.log,
warn: console.warn,
error: console.error,
};
const capture = (level, args) => {
window._allLogCount++;
const message = args
.map(value => typeof value === "string" ? value : String(value))
.join(" ");
if (!message.includes("isExistentStorage") &&
!message.includes("UpdateToDrawDevice") &&
!message.includes("InternalComplete2") &&
!message.includes("DrawCompleted") &&
!message.includes("BasicDrawDevice::Show") &&
!message.includes("_TVPDeliverContinuousEvent") &&
!message.includes("DrawDevice::Update")) {
window._filteredLogs.push(`[${level}] ${message}`);
}
};
console.log = function(...args) {
capture("LOG", args);
original.log.apply(console, args);
};
console.warn = function(...args) {
capture("WARN", args);
original.warn.apply(console, args);
};
console.error = function(...args) {
capture("ERR", args);
original.error.apply(console, args);
};
过滤条件必须根据问题调整:调试 storage 时不要过滤 storage 日志;调试渲染时可过滤高频绘制日志。日志应分批取回,避免一次返回过长内容。
测试游戏输入时,优先使用浏览器文档支持的鼠标点击接口。不要跨调用拆分触摸 down/up,也不要假定 tab 启用了 touch context。
判断输入是否进入引擎前,先在页面上安装 capture listener,分别统计 pointerdown、pointerup、mousedown、mouseup 和 click。只有浏览器层事件计数正常后,才继续排查 KrKr2 的 Window、DrawDevice 和脚本事件链。
krkr2-server 启动带跨域隔离响应头的服务器。http://localhost:端口/index.html?...。