dimensional-analysis

Automate dimensional analysis and bug detection in numeric computation codebases.

6.5k|561|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/trailofbits/skills --skill dimensional-analysis-trailofbits
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dimensional-analysis
Source: https://github.com/trailofbits/skills/tree/main/plugins/dimensional-analysis/skills/dimensional-analysis
Command: npx skills add https://github.com/trailofbits/skills --skill dimensional-analysis-trailofbits

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python, tasklib, dimpy, dimensional-units, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill automates the dimensional analysis and bug detection in codebases, saving time and reducing the risk of arithmetic errors in numeric computations.

Core Features & Use Cases

  • Dimensional Analysis: Annotates codebases with dimensional analysis comments, detecting unit mismatches and formula bugs early.
  • Bug Detection: Detects dimensional bugs such as unit mismatches, missing scaling, or precision loss.
  • Use Case: Use this Skill to analyze smart contracts or financial code and prevent arithmetic bugs that could lead to vulnerabilities.

Quick Start

Use the dimensional-analysis skill to analyze the code in the current directory for dimensional analysis and bug detection.

Frequently Asked Questions about dimensional-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect arithmetic bugs and unit mismatches in smart contracts?

Yes, dimensional analysis can detect precision loss in financial code by validating numeric computations with mixed units and scaling factors. It annotates the codebase to find mismatches and arithmetic bugs that could lead to vulnerabilities.

What is dimensional analysis in codebases and how does it work?

Dimensional analysis in codebases is an automated bug detection technique that uses specialized agents for scanning, vocabulary discovery, annotation, propagation, and validation. It checks numeric computations to ensure unit consistency and correct formula scaling.

Do I need Python to run dimensional analysis and bug detection on my code?

Yes, you need Python along with specific libraries like tasklib, dimpy, and dimensional-units. These dependencies are required for task orchestration and subagent communication during the scanning and validation processes.

Can I use automated dimensional analysis for codebases with mixed units and precisions?

Yes, automated dimensional analysis is specifically designed for codebases performing numeric computations with mixed units, precisions, or scaling factors. It applies validation rules to prevent arithmetic errors in these complex environments.

What are the limitations of using dimensional analysis for bug detection?

Dimensional analysis for bug detection is limited to numeric computations and arithmetic validation. It requires specific Python library dependencies for task orchestration and may not identify logical errors or bugs unrelated to unit mismatches and scaling factors.