data-modeling

Designs database schemas, indexes, and expand/contract migration plans with rollback steps.

Updated Apr 26, 2026
One-click install
npx skills add https://github.com/Jin9/skillify-foundation --skill data-modeling-jin9
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-modeling
Source: https://github.com/Jin9/skillify-foundation/tree/main/treasury/data-modeling
Command: npx skills add https://github.com/Jin9/skillify-foundation --skill data-modeling-jin9

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing a persistence layer without a plan leads to missing indexes, unclear data ownership, and irreversible migrations. This Skill produces a structured Data Model plus Migration Plan artifact so schema changes ship with backward compatibility and a rollback path. ## Core Features & Use Cases - Schema and Source-of-Truth Design: Defines tables, columns, types, constraints, and designates one source of truth per fact. - Index Planning from Access Patterns: Derives indexes from real query patterns and volume rather than guesswork. - Expand/Contract Migration Planning: Writes reversible expand, backfill, switch, and contract steps with a rollback for each, gated by human approval. - Use Case: When building a wallet ledger, use this Skill to define an append-only ledger table with a unique idempotency key, designate the ledger sum as the balance source of truth, and plan a nullable-column expand migration with a drop-column rollback. ## Quick Start Ask the agent to design the table schema and plan the migration for your feature, providing your domain model, access patterns, and expected data volume.

Frequently Asked Questions about data-modeling

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

FAQPage Schema
How do I design a database schema for a new feature?

Start from your domain model and real access patterns, then define tables with column types, nullability, and defaults. Designate one source of truth per fact, map indexes to actual query patterns, and add unique, foreign key, and check constraints.

How do I plan a database migration with zero data loss?

Use an expand/contract migration: add new nullable structures, backfill data, switch reads/writes, then contract old structures. Write a rollback step for every phase and get human approval before running anything, since data migration is a one-way door.

How do I decide which indexes my database needs?

Derive indexes from real access patterns and expected data volume, not guesses. Map each index to the specific query it serves, such as a composite index on wallet_id and created_at for ledger lookups.

When should I not use this data modeling skill?

Do not use it for query-cost or performance tuning of an existing system, or for chasing a specific slow query path. It also does not cover domain boundaries, aggregates, and ownership, which belong to domain modeling.

Does this skill execute database migrations automatically?

No. The skill only designs the schema and writes the migration and rollback plan. A human must approve both the migration and its rollback before anything runs against the database.