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.
npx skills add trailofbits/skills --skill dimensional-analysis --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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
- When to Use
- When NOT to Use
- Execution Mode
- Scope and Coverage Guarantees
- Delegation Contract
- Workflow
- Shared Orchestration Rules
- Step 1: Vocabulary and Scope Discovery
- Step 2: Anchor Annotation
- Step 3: Dimension Propagation
- Step 4: Bug Detection
- Reference Documentation
- Final Output
- Completion Checklist
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.
