db-types-precision

Installation
SKILL.md

db-types-precision (M4)

The type is the first and cheapest constraint: it decides what values are even representable and how they sort, compare, and round. The classic data-loss bug — money in a float — lives here. This module is design-axis (Tipos category, shared with M6). It applies across paradigms with paradigm-appropriate type vocabularies (Postgres numeric, Mongo Decimal128).

What it checks

  • Money as float: float/real/double precision (or Mongo Double) for currency/amounts — binary floating point cannot represent decimal cents exactly. Use numeric/decimal/Decimal128/integer-minor-units. This is the severity-5 cap.
  • Timestamps & timezone: naive timestamp/datetime (without time zone) for instants that cross zones; prefer timestamptz stored in UTC. Flag timestamp columns named *_at lacking tz.
  • jsonb as schema evasion: a jsonb/json column carrying what should be first-class typed/constrained columns (stable, queried, FK-related keys buried in JSON). Embedding flexible blobs is fine; hiding the schema is not.
  • enum vs lookup: native ENUM (esp. MySQL ENUM, hard to alter) where a referenced lookup table would be safer to evolve; or free-text status where a constrained domain is needed.
  • Charset/collation: MySQL utf8 (3-byte, no emoji/astral) instead of utf8mb4; an unintended case-sensitive or accent-sensitive collation on identifiers/emails.

Axis & severity

  • Money in float/double: severity 5, fail, axis design, confidence established (caps the Design score).
  • Naive timestamp for cross-zone instant: severity 3–4, warn, axis design.
  • jsonb hiding a stable queried schema: severity 3, warn, fixable: proposed.
  • MySQL utf8 (not utf8mb4): severity 3, warn.
  • enum-as-lock-in / wrong collation: severity 2–3, warn.
Installs
58
GitHub Stars
19
First Seen
Jun 17, 2026
db-types-precision — hainrixz/claude-db