Agent skill

dimensional-analysis

Annotates codebases with dimensional analysis comments documenting units, dimensions, and decimal scaling. Use when someone asks to annotate units in a codebase, perform a dimensional analysis, or find vulnerabilities in a DeFi protocol, offchain code, or other blockchain-related codebase with arithmetic. Prevents dimensional mismatches and catches formula bugs early.

trailofbitsgithub.com/trailofbitsGitHub ↗
claude-codecan modify filesCC-BY-SA-4.0
Install
npx skills add trailofbits/skills --skill dimensional-analysis --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 7
SKILL.md size: 17 KB
Bundled scripts: none
Allowed tools: ReadWriteGrepListGlobTaskTodoReadTodoWrite
Path: plugins/dimensional-analysis/skills/dimensional-analysis/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 6,426
Language: Python
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Dimensional Analysis Skill This skill orchestrates a dimensional-analysis pipeline for codebases that perform numeric computations with mixed units, precisions, or scaling factors. The main skill context is a workflow controller only: it delegates scanning, vocabulary discovery, annotation, propagation, and validation to specialized subagents, then manages batching, persistence, retries, coverage gates, and final reporting. ## When to Use - Annotating a codebase with unit/dimension comments (e.g., `D18{tok}`, `D27{UoA/tok}`) - Performing dimensional analysis on DeFi protocols, financial code, or scientific computations - Hunting for arithmetic bugs caused by unit mismatches, missing scaling, or precision loss - Auditing codebases with mixed decimal precisions or fixed-point arithmetic ## When NOT to Use - Codebases with no numeric arithmetic or unit conversions — there is nothing to annotate - Pure integer counting logic (loop indices, array lengths) with no physical or financial dimensions - When you only need a quick spot-check of a single formula — read the code directly instead of running the full pipeline ## Execution Mode This skill runs in one mode only: `full-auto`. This

What's inside
Steps it walks through
  1. When to Use
  2. When NOT to Use
  3. Execution Mode
  4. Scope and Coverage Guarantees
  5. Delegation Contract
  6. Workflow
  7. Shared Orchestration Rules
  8. Step 1: Vocabulary and Scope Discovery
  9. Step 2: Anchor Annotation
  10. Step 3: Dimension Propagation
  11. Step 4: Bug Detection
  12. Reference Documentation
  13. Final Output
  14. Completion Checklist
Ships with 6 files
  • agents/openai.yaml
  • assets/trail-of-bits-mark.svg
  • references/annotate.md
  • references/bug-patterns.md
  • references/common-dimensions.md
  • references/dimension-algebra.md
More from skills
All skills →
About this skill
What does the dimensional-analysis skill do?

Annotates codebases with dimensional analysis comments documenting units, dimensions, and decimal scaling. Use when someone asks to annotate units in a codebase, perform a dimensional analysis, or find vulnerabilities in a DeFi protocol, offchain code, or other blockchain-related codebase with arithmetic. Prevents dimensional mismatches and catches formula bugs early.

How do I install it?

Run `npx skills add trailofbits/skills --skill dimensional-analysis --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From trailofbits/skills, a repository with 6,426 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going