dimensional-analysis

Solid

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.

AI & Automation 5,673 stars 496 forks Updated today CC-BY-SA-4.0

Install

View on GitHub

Quality Score: 93/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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 is a workflow-based skill that delegates step-specific work to specialized agents via the `Task` tool. You orchestrate the overall process, manage coverage and state persistence, and ensure that every in-scope file is processed through each step of the pipeline. - Always run the full pipelin...

Details

Author
trailofbits
Repository
trailofbits/skills
Created
4 months ago
Last Updated
today
Language
Python
License
CC-BY-SA-4.0

Similar Skills

Semantically similar based on skill content — not just same category