audit-correctness
Use when auditing and fixing logic bugs in a scope — off-by-one, wrong operator, inverted condition, unhandled boundary cases, unit/dimension mismatch, code that doesn't do what its name or docstring claims. Triggers on "audit correctness", "fix logic bugs", "check for off-by-one
What it does
target = $ARGUMENTS
If target provided, audit that path. Otherwise, files changed since the default branch. Full-codebase audit requires explicit user request.
Find and fix code whose behavior diverges from what it claims to do.
Intent lives in names, signatures, docstrings, comments, and caller expectations — when behavior contradicts any of them, one is wrong and usually it's the code. Read for what the code does, not what it claims; names, comments, and the diff message prime confirmation bias. The patterns the model under-weights without prompting: off-by-one in loop bounds, slicing, range checks (< vs <= against length); inverted conditions and wrong logical operator (|| vs &&, missing De Morgan flip); unhandled boundary cases (empty collection, single element, zero, negative, max) where surrounding logic implicitly assumes more; unit or dimension mismatch (ms vs seconds, bytes vs KB, 0- vs 1-indexed); time bugs (naive vs timezone-aware datetimes, DST); concurrency hazards (stale reads, TOCTOU, missing atomicity). Distinguish from silent-failures, which is about swallowing errors — correctness is about producing the wrong answer with no error at all.
Re-read the cited line and surrounding code before editing — if you can't point to where intent and behavior disagree, don't touch it. False positives erode trust faster than misses. Fix where intent is unambiguous: a name, signature, docstring, or caller pattern pins the correct reading. When the code could plausibly be either the bug or the spec, surface the divergence and ask which is canonical before editing — guessing wrong propagates the bug under the appearance of a fix. Run tests after the batch; report git diff --stat, the bugs fixed, and any ambiguous cases left for sign-off.
Capabilities
Install
Quality
deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 8 github stars · SKILL.md body (1,780 chars)