Skip to main content
skill CX Codex

dimensional-analysis — Claude Code skill: audit units

Audits numeric code for unit confusion and decimal-scale errors, then adds dimensional comments. Use it when formulas or conversions need a unit-level review.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add trailofbits/skills --skill dimensional-analysis -a claude-code
Open on GitHub

What dimensional-analysis does

The skill traces numeric calculations for incompatible units or scales. It can flag incorrect token decimals, WAD/RAY scale mistakes, prices with an unclear numerator or denominator, and missing scale adjustments after oracle calls.

It runs in full-auto mode through scanning, vocabulary discovery, annotation, and validation. The workflow writes DIMENSIONAL_SCOPE.json at the project root and reuses DIMENSIONAL_UNITS.md when present, otherwise it creates the vocabulary. Comments use notation such as D18{tok} and {s}.

Native agent dispatch and write access to an explicitly scoped target are required. It edits comments in files directly, so that is a reason to run it only where those changes are acceptable. The skill does not commit or publish the target.

What it helps with

  • detect additions of values from different tokens
  • check WAD/RAY and other decimal scales
  • find incorrect token decimals in calculations
  • add unit comments to numeric values
  • trace conversions after an oracle call

Example prompts for the agent

  • Run dimensional-analysis on the arithmetic in this repository and add unit comments.
  • Audit these formulas for token decimal and WAD/RAY scale errors.
  • Annotate the numeric calculations with dimensions and flag incompatible units.

How to install dimensional-analysis

1Skills CLI (Vercel)

npx skills add trailofbits/skills --skill dimensional-analysis -a claude-code

2Manually: put the files in place

~/.claude/skills/dimensional-analysis/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/dimensional-analysis/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about dimensional-analysis

How do I install dimensional-analysis in Claude Code?

Run npx skills add trailofbits/skills --skill dimensional-analysis -a claude-code, then run npx skills add trailofbits/skills --skill dimensional-analysis -a claude-code again. The skill file is at ~/.claude/skills/dimensional-analysis/SKILL.md.

What does dimensional-analysis do?

It reviews numeric computations for unit, precision, and scaling conflicts. The skill adds dimensional annotations and checks formulas for invalid conversions.

What does dimensional-analysis require to run?

It requires native agent dispatch and write access to an explicitly scoped target. If a stage cannot run, it preserves its outputs and marks that stage as blocked.

Similar skills

Everything for Code review and refactoring →

From the same set77

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor