ailogic
Installation
SKILL.md
Introduction
Logic bugs are not syntax errors and the compiler will not catch them. They live in branches that look reasonable, in loops that almost terminate, and in assumptions that are never written down. This skill focuses on radare2's C codebase, where most logic bugs come from misuse of libr APIs, unchecked return values, and state that leaks across calls.
When this skill is used: read AGENTS.md first and follow the project rules. Patches must be surgical, behavior-preserving, and small.
Steps
-
Understand the function contract before reading the body
- What does each input represent? What range is valid?
- What must always be true on entry and on exit?
- If the contract is unclear, the function is already suspicious.
-
Identify inputs and boundaries
- Check handling of
NULL, zero, negative, andUT64_MAX/UT32_MAXsentinels. - Look for missing validation at
R_APIentry points (these should useR_RETURN_*). - Static helpers should rely on the contract instead of re-checking.
- Check handling of