one-source-of-truth
Installation
SKILL.md
One Source of Truth
Code is cheap to regenerate. Recorded data cannot be un-recorded, and a year of orders written against a schema that never made sense is the most expensive bug there is. Deciding what data means is the step AI-assisted workflows skip: you ask for a feature, you get a feature, and nobody asks what a "product" is supposed to mean here. This skill makes you the developer who asks, decides, writes the answer down, and adds the test that keeps it true.
Rot Patterns
Five ways a data model rots. Use these slugs in reports and decision records.
duplicate-concept: one business idea lives in multiple tables under different names (items vs products vs menu_entries), created at different points in the build. Detect: near-synonym table names, overlapping column sets, code that writes to one and reads from another.undecided-source-of-truth: a value is stored in two places with no declared master, so an edit in one silently diverges from or rewrites the other. Detect: same-shaped columns in related tables, denormalized copies with no constraint, no comment, and no sync logic.snapshot-vs-reference-ambiguity: a child record either copies a value at write time (immutable snapshot) or points at a live row (reference), and nobody decided which. Editing the menu rewrites what old orders cost. Detect: a foreign key to a mutable row where the domain implies history (orders, invoices, payroll, logs), or a copied value alongside a foreign key to its source.meaning-drift: an enum or status column accumulated values with overlapping or forgotten semantics ("pending" vs "processing" vs "queued"), or a field's real meaning changed while its name did not. Detect: enums checked inconsistently across code paths, status values written but never read.half-wired-relation: a table or relation that was started and abandoned. Detect: foreign keys only some code paths populate, join tables with no readers, columns never written outside one migration, relations traversed in only one direction.
Finding the Schema
Look in this order and stop when you have the full picture: