db-types-precision

db-types-precision is a skill for Claude Code from Hainrixz/claude-db. It costs 79 tokens per session (1,089 once invoked), scanned A, original, MIT.

A database design checker that reviews whether columns use suitable data types and precision. It covers issues such as inaccurate money values, timezone-free timestamps, overly flexible JSON fields, and difficult-to-change enums.

In plain words
What is it for?
Use it to audit PostgreSQL or MongoDB schemas for currency storage, timestamps, JSON structure, enum choices, and text encoding or collation.
Why use it?
It helps catch data-loss, sorting, comparison, and maintenance problems caused by weak column definitions.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the claude-db plugin — 36 skills, 6 agents, 1 hook shipped together

Good fit Use it to audit PostgreSQL or MongoDB schemas for currency storage, timestamps, JSON structure, enum choices, and text encoding or collation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hainrixz/claude-db/db-types-precision
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Hainrixz/claude-db --skill db-types-precision
Clone the repo
git clone --depth 1 https://github.com/Hainrixz/claude-db

Made for: Claude Code.

Or install claude-db, the plugin that ships this one along with the rest of its 36 skills, 6 agents, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for db-types-precision

README.md
[![agentmods](https://agentmods.dev/badge/skills/hainrixz/claude-db/db-types-precision.svg)](https://agentmods.dev/skills/hainrixz/claude-db/db-types-precision)
Your own site
<a href="https://agentmods.dev/skills/hainrixz/claude-db/db-types-precision"><img src="https://agentmods.dev/badge/skills/hainrixz/claude-db/db-types-precision.svg" alt="Measured on agentmods" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,089 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00079 $0.01089
Opus 5 $0.00039 $0.00544
Sonnet 5 $0.00016 $0.00218
Haiku 4.5 $0.00008 $0.00109

Measured 8d ago against content hash ffa6d758f27f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

db-types-precision scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/db-types-precision/SKILL.md · 55 lines

How it starts

The opening of the file, as written. The whole thing — 55 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

Tier-0 static check

Parse DDL/snapshot via scripts/parse-schema.mjs: match money-like column names (price, amount, total, balance, cost, *_cents) against float|real|double|Double types; flag timestamp/datetime without tz on *_at columns; detect json/jsonb columns and ENUM(...); read declared charset/collation. Directional program-source parses never raise the money-float sev-5 cap.

Read the full file on GitHub · 55 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 55 lines · 79 tokens per session scan A ffa6d758f27f

Subscribe to this mod's changes

db-types-precision is a skill published in the GitHub repository Hainrixz/claude-db (19 stars, last pushed 2mo ago), licensed MIT. It adds 79 tokens to every session and 1,089 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

malloy-lookml-review

Analyze LookML files as prior art for Malloy modeling. Used during Step 1 (DISCOVER) when .lkml files are present. Coordinates reference files that extract business logic, relationships, and curation decisions. Works with or without a database connection.

malloydata/publisher · 58 tokens

review-prs

Review a GitHub pull request in the googleapis/mcp-toolbox repo against the team's reviewer checklist: PR title/description conventions, linked issue, logic errors and unhandled edge cases, breaking changes, test coverage, docs updates, security (input handling), and new dependencies. Use whenever a maintainer asks…

googleapis/mcp-toolbox · 162 tokens

migration-review

Review database migration files when a change adds or modifies paths under migrations/. Use it before merge to collect forward, rollback, locking, and data-safety evidence.

rohitg00/ai-engineering-from-scratch · 35 tokens

product-review-report

A product-review workflow that researches a product and writes a Markdown report for deciding whether it is worth buying and using. It compares products from both the decision-maker's and everyday user's viewpoints.

digoal/blog · 153 tokens

malloy-review

Malloy semantic-model code review. Invoke when the user asks to review, audit, or critique a .malloy file, a folder of Malloy models, or a GitHub PR that touches Malloy. Enforces project modeling standards and emits a navigable review file.

malloydata/publisher · 60 tokens

migration-ready-schema

Data-model rules that make a schema importable from day one, so the migration-import-engineer is never blocked on missing columns. Every SMB Product-Builder product must let a customer bring their data from an incumbent (ServiceTitan/Toast/Mindbody/Shopify) — that requires provenance (sourceref) and rollback…

avelikiy/great_cto · 133 tokens