dimensional-analysis

Detects unit mismatches and dimensional inconsistencies in numeric data across code, APIs, and configurations.

2|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/NlightNFotis/skills --skill dimensional-analysis-nlightnfotis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dimensional-analysis
Source: https://github.com/NlightNFotis/skills/tree/main/dimensional-analysis
Command: npx skills add https://github.com/NlightNFotis/skills --skill dimensional-analysis-nlightnfotis

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you find and prevent unit-mismatch bugs in software systems by treating every numeric value as a quantity with meaning, not just a raw number. It is especially useful when errors come from mixing milliseconds with seconds, percentages with ratios, timestamps with durations, or currencies and measurement systems across boundaries.

Core Features & Use Cases

  • Unit Inventory and Classification: Identifies numeric quantities in code, APIs, configs, and persisted data, then classifies them by family such as time, money, size, rate, percentage, ratio, or score.
  • Boundary and Conversion Analysis: Examines where values move between modules, services, databases, libraries, or protocols so implicit or missing conversions become visible.
  • Type-Safety Recommendations: Suggests stronger representations such as branded types, newtypes, value objects, canonical internal units, and naming conventions to make dimensional errors harder to introduce.
  • Use Case: Review a service that accepts timeouts from environment variables, stores timestamps in a database, and reports latency metrics, then verify that durations, absolute times, percentages, and rates are never confused.

Quick Start

Use the dimensional-analysis skill to review a code path or API schema and identify every numeric field, its unit, and any unsafe conversions or mismatched arithmetic.

Frequently Asked Questions about dimensional-analysis

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

FAQPage Schema
How do I detect unit mismatches and dimensional inconsistencies in my code?

To detect unit mismatches and dimensional inconsistencies, you inventory all numeric quantities in your code, APIs, and configs, then validate dimensional homogeneity across module boundaries to expose implicit conversions. This process traces values like milliseconds, percentages, and currencies to prevent arithmetic errors.

What is dimensional analysis in software engineering and when do I need it?

Dimensional analysis in software engineering treats numeric values as typed quantities rather than raw numbers. You need it when reviewing code that mixes milliseconds with seconds, percentages with ratios, or timestamps with durations across services, databases, or APIs to prevent unit-mismatch bugs.

How do I prevent timestamp and duration bugs across API boundaries?

To prevent timestamp and duration bugs across API boundaries, you examine where values move between modules and protocols to make implicit conversions visible. You then distinguish absolute times from relative durations and apply stronger type enforcement to prevent mismatched arithmetic.

Can I use dimensional analysis for code review and debugging numeric values?

Yes, you can use dimensional analysis for code review and debugging by classifying numeric values into families like time, money, size, and rate. It validates dimensional homogeneity and identifies unsafe conversions or mismatched arithmetic in the reviewed code paths.

What is the best way to enforce type safety for numeric values in APIs?

The best way to enforce type safety for numeric values is to implement branded types, newtypes, value objects, and canonical internal units. Establishing strict naming conventions makes dimensional errors harder to introduce when APIs pass durations, rates, or normalized scores.

Why do my environment variables cause timeout and latency metric errors?

Environment variables cause timeout and latency metric errors when implicit unit conversions occur between configured values and internal usage. Analyzing boundary conversions reveals where milliseconds are confused with seconds, providing recommendations for stronger type or naming enforcement.