Skip to content
Back to skills

Audit Arithmetic

ASecurity

Audit for arithmetic and boundary bugs (overflow, off-by-one, drift)

  • 17,959 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 7, 2026
businessperformance

Works with

  • cli

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add ben-manes/caffeine --skill audit-arithmetic --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Audit Arithmetic?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Audit Arithmetic
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ben-manes-audit-arithmetic/badge)](https://www.skillsdirectory.com/skills/ben-manes-audit-arithmetic)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: audit-arithmetic
description: Audit for arithmetic and boundary bugs (overflow, off-by-one, drift)
context: fork
agent: auditor
disable-model-invocation: true
---

Assume there is at least one arithmetic or boundary bug in this code.

Audit for:
- Off-by-one errors
- Incorrect inequality direction (< vs <=, > vs >=)
- Overflow / underflow (int, long, specifically nanoTime arithmetic)
- Implicit narrowing or widening conversion
- Incorrect rounding or truncation
- Sign errors
- Sentinel value collisions (can a valid value equal a sentinel?)
- Counter drift (can a counter diverge from the quantity it tracks
  over a long-running cache?)
- Timer wheel bucket arithmetic (modular arithmetic, wrap-around)
- Frequency sketch counter saturation and reset arithmetic
- Hill climber / adaptive sizing: window vs main partition adjustment; the density and
  probe-verdict log-ratios (`ln((x+ε)/(y+ε))`), the probation-capacity denominator
  (`max(1, maximum − windowMaximum − mainProtectedMaximum)`), the saturated `4·maximum`
  sample period, and the stride/commitment rung tables
  (percentage calculations, rounding, overshoot, oscillation)
- FrequencySketch table size calculation (ensureCapacity rounding to
  power of two, interaction with maximumSize)
- Weight delta computation in UpdateTask (sign conventions, can
  intermediate sums overflow when weights are near Integer.MAX_VALUE?)

For each suspected issue:
- Provide a concrete input (specific key, value, weight, time values)
- Show step-by-step evaluation through the code
- Show expected vs actual behavior
- If it requires billions of operations, state the count needed

Ignore style and performance.
Only report high-confidence defects supported by evaluation traces.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in business →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.