Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By trailofbits Verified Orgv3.2.0CC-BY-SA-4.0In 2 marketplaces
Annotates arithmetic-heavy code with dimensional comments like D18{tok} and flags formulas that mix units, decimals or WAD/RAY scales. Runs in full-auto mode and writes comment-only annotations without approval gates.
Trending plugins
7-day copy clicks
Claude hands work to one, or you mention it with @.
2 marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Public GitHub repos that commit this plugin as enabled in their Claude Code settings
Add dimensional annotations to codebases and detect dimensional bugs. Uses an annotation format inspired by Reserve Protocol's Solidity conventions, but applicable to any language or protocol performing numeric arithmetic with mixed units, precisions, or scaling factors.
This plugin runs one automatic workflow:
D18{tok}, D27{UoA/tok}Based on Reserve Protocol's format (shown here in Solidity, but adaptable to any language):
// State variables
uint256 public tvlFee; // D18{1/s} demurrage fee on AUM
uint256 public lastPoke; // {s}
// Struct fields
struct RebalanceLimits {
uint256 low; // D18{BU/share} (0, 1e27]
uint256 spot; // D18{BU/share} (0, 1e27]
uint256 high; // D18{BU/share} (0, 1e27]
}
// Function parameters (NatSpec)
/// @param weights D27{tok/BU} Basket weight ranges
/// @param prices D27{UoA/tok} Prices for each token
/// @return price D27{buyTok/sellTok}
// Inline arithmetic
// D27{buyTok/sellTok} = D27{UoA/sellTok} * D27 / D27{UoA/buyTok}
uint256 startPrice = Math.mulDiv(sellPrices.high, D27, buyPrices.low);
The skill always executes in full-auto mode. Any supplied mode argument is ignored.
Workflow phases are implemented in:
skills/dimensional-analysis/references/step1.mdskills/dimensional-analysis/references/step2.mdskills/dimensional-analysis/references/step3.mdskills/dimensional-analysis/references/step4.mdDIMENSIONAL_UNITS.md if present; otherwise auto-generates and saves itDIMENSIONAL_SCOPE.json as a source-of-truth manifest for large repos| Agent | Purpose |
|---|---|
arithmetic-scanner | Scans repo for files with dimensional arithmetic to scope discovery |
dimension-discoverer | Discovers dimensional vocabulary from naming, interfaces, and patterns |
dimension-annotator | Adds dimensional annotations at anchor points (comments only) |
dimension-propagator | Propagates dimensional annotations through arithmetic and call chains, reporting mismatches |
dimension-validator | Validates dimensional consistency and detects bugs |
DETERMINISTIC_ONLY=1 tests/smoke-test.sh # free: validator self-test
tests/smoke-test.sh # also runs the semantic eval (paid)
tests/fixtures/src/ is a cross-margin borrowing protocol with five planted
dimensional bugs, three of which only surface by tracing dimensions across files
(a RAY borrow index consumed as WAD, per-asset decimals from a registry, and
Uniswap v3 Q96 encoding). StakingRewards.sol is a dimensionally correct control
for measuring false positives. Ground truth is in
tests/fixtures/ANSWER-KEY.md.
The eval copies fixtures to /tmp/dimensional-analysis-eval before running.
This is deliberate: arithmetic-scanner post-filters any path containing
/tests/, so analysing the fixtures in place would exclude every file and score
a vacuous pass.
The harness requires uv and runs each eval arm against pristine fixtures.
Use the smoke-test script for ablation comparisons: the built-in --ablation
option shares annotated sources between arms and contaminates the baseline.
See the references/ directory for:
dimension-algebra.md - Rules for dimensional arithmeticcommon-dimensions.md - DeFi dimension vocabularybug-patterns.md - Dimensional bug patterns with examplesannotate.md - Full annotated protocol examples (ERC-4626, AMM, Lending)step1.md - Phase 1 workflow instructionsstep2.md - Phase 2 workflow instructionsstep3.md - Phase 3 workflow instructionsstep4.md - Phase 4 workflow instructionsCoriolan Pinhas & Benjamin Samuels - Trail of Bits
7-day copy clicks
npx claudepluginhub trailofbits/skills --plugin dimensional-analysisPlugins from other owners that cover similar ground
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.