agentleFS
mtarcuremtarcure/claude-vibe-squad/.agents/skills/dimensional-analysis-check/SKILL.md

dimensional-analysis-check

Skill220 starsChanged 18 days agoMITView on GitHub

Use when numeric values cross arithmetic, API, storage, or time boundaries and a unit, scale, precision, rounding, signedness, or range mismatch could make the result wrong.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check each arithmetic expression for dimensional consistency — added terms must share a unit, and a ratio's unit must be what the consumer …

    line 13
  2. Distinctive:

    Check every boundary crossing: function parameters, JSON fields, database columns, environment variables, and RPC payloads are where units …

    line 14
  3. Distinctive:

    Verify conversion factors against the authoritative definition rather than an inline literal, and flag every magic constant that encodes a …

    line 15
  4. Distinctive:

    Check precision and rounding: integer division truncation, float accumulation in loops, and fixed-point scaling applied twice or not at all.

    line 16
  5. Distinctive:

    Check signedness and range: values that can go negative, counters that can wrap, and durations that can exceed the field's width.

    line 17
  6. Distinctive:

    Check time explicitly — epoch vs monotonic, UTC vs local, inclusive vs exclusive interval bounds — as it is the most common dimensional …

    line 18
  7. Distinctive:

    Every quantity in the reviewed change has a stated unit and scale.

    line 22

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Dimensional Analysis Check

Catch unit, scale, base, and precision errors by checking that every quantity's dimensions agree across an expression, an API boundary, and a storage round-trip.

Steps

  1. Inventory every numeric quantity the change touches and annotate each with its unit and scale: seconds vs milliseconds, bytes vs KiB, basis points vs percent vs fraction, token decimals, wei vs ether.
  2. Check each arithmetic expression for dimensional consistency — added terms must share a unit, and a ratio's unit must be what the consumer expects.
  3. Check every boundary crossing: function parameters, JSON fields, database columns, environment variables, and RPC payloads are where units silently change identity.
  4. Verify conversion factors against the authoritative definition rather than an inline literal, and flag every magic constant that encodes a unit conversion.
  5. Check precision and rounding: integer division truncation, float accumulation in loops, and fixed-point scaling applied twice or not at all.
  6. Check signedness and range: values that can go negative, counters that can wrap, and durations that can exceed the field's width.
  7. Check time explicitly — epoch vs monotonic, UTC vs local, inclusive vs exclusive interval bounds — as it is the most common dimensional defect.
  8. Where a unit is only documented in a name, treat the name as an assertion to verify, not as evidence.

Acceptance

  • Every quantity in the reviewed change has a stated unit and scale.
  • Each expression and each boundary crossing is dimensionally consistent, or the mismatch is reported.
  • Conversion constants are traced to an authoritative definition.
  • Rounding, truncation, overflow, and sign behavior are checked at the extremes, not just at typical values.
  • Time values state their epoch, zone, and interval bound convention.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.