Giverny

Dimensional Analysis

Audits code for unit and decimal-scaling bugs and annotates it with dimensional comments recording the units of each value.

by Trail of Bits★ 8,529General

What Dimensional Analysis does

Audits code for unit and decimal-scaling bugs and annotates it with dimensional comments recording the units of each value. Use when someone asks to audit or review code for unit confusion, decimals or scaling mismatches, WAD/RAY scale errors, or the wrong token's decimals; to annotate units in a codebase; or to perform a dimensional analysis of a DeFi protocol, offchain code, or other arithmetic-heavy codebase. Catches formulas that combine values carrying different units or scales.

How to install Dimensional Analysis in Claude Code

Giverny gives you a ready prompt with the exact install command from trailofbits/skills. Sign in with GitHub, copy the prompt and paste it into Claude Code; Claude installs the skill and confirms it loaded. To install by hand, clone trailofbits/skills and copy the plugins/dimensional-analysis/skills/dimensional-analysis folder into ~/.claude/skills/.

How to use it

Once installed, Claude loads Dimensional Analysis on its own whenever your request matches what the skill does. You can also ask for it by name, for example: “Use the dimensional-analysis skill on my current project.”

More Claude skills for general