一键导入
aiclean
Clean and refactor code with a focus on unnecessary complexity, reducing lines of code, improving readability, and preferring radare2-native portable APIs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Clean and refactor code with a focus on unnecessary complexity, reducing lines of code, improving readability, and preferring radare2-native portable APIs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when Codex needs to start, discover, or communicate with a radare2 or iaito HTTP webserver and run stateful radare2 commands over POST /cmd with curl, especially to replace r2mcp or one-shot r2 command lines during long binary analysis.
Use the bundled r2mcp MCP server for binary analysis, disassembly, and reverse-engineering tasks.
Create a commit message to use for the currently unstaged changes
When planning tasks or reviewing code is important to extend the reasoning of the unstaged changes, commits in the current non-master branch and todo roadmap of the ongoing work.
Find bugs and vulnerabilities in C code for radare2
Find logic bugs in C code for radare2 by analyzing control flow, state transitions, and silent assumptions.
| name | aiclean |
| description | Clean and refactor code with a focus on unnecessary complexity, reducing lines of code, improving readability, and preferring radare2-native portable APIs. |
When this skill is used:
Read the AGENTS.md for project guidelines first.
Workflow:
clean, cleanup, refactor, simplify, dedup, portable, dead code, reuse.Then improve the code quality following these rules:
bool a = true; instead of bool a; a = true;R_RETURN_* statementsR_API entry points should use R_RETURN_* for programmer-error precondition checksRPanelPos *pos = &p->view->pos; or const ut64 bsz = core->blocksize;UT64_MAX, R_MIN, R_MAX, and COUNTr_strbuf_* or r_str_newf instead of repeated append chains or sprintf/strcat
Use r_read_le* and r_read_be* instead of open-coded byte parsing
Use r_mem_dup, r_list_purge, R_NEWS0, vector/list helpers, RTable, Sdb, and other existing r2 primitives before inventing new helpers_tostring helpers plus one buffered print over many r_cons_printf callssprintf, strcpy, strcat, open-coded endian reads, UB-prone casts, and non-portable format strings
Use <r_types.h> types and PFMT64 macrosPatterns repeatedly seen in radare2 cleanup history:
RStrBuf, then drain once at the endstatic*_tostring style functions to lower RCons pressureslot_off, or local block size, then keep the loop body simplegoto blocks with a bounded for (;;) loop and a retried flagcore->block or file-global structs by reading into local buffers and passing explicit state around