Skip to content
Skills Library
Programming · Planning

data-model

/data-model

Data model reference and schema change management — document the current schema, propose and validate schema changes, plan migrations. TRIGGER when designing a new table or field, when modifying an existing schema, when asked about what a table contains or how tables join, or before writing a query against an unfamiliar table. SKIP pure query exploration with no schema change (use /data) and high-level data architecture decisions (use /design).

Repository
pai-orbit ↗
Licence
MIT
Last repository change
12.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 12.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Data model reference and schema change management — document the current schema, propose and validate schema changes, plan migrations. TRIGGER when designing a new table or field, when modifying an existing schema, when asked about what a table contains or how tables join, or before writing a query against an unfamiliar table. SKIP pure query exploration with no schema change (use /data) and high-level data architecture decisions (use /design).

Original author description

Data model reference and schema change management — document the current schema, propose and validate schema changes, plan migrations. TRIGGER when designing a new table or field, when modifying an existing schema, when asked about what a table contains or how tables join, or before writing a query against an unfamiliar table. SKIP pure query exploration with no schema change (use /data) and high-level data architecture decisions (use /design).

How it works

  1. Reference: read the current schema
  2. Proposing a schema change
  3. Schema change safety rules
Original SKILL.md headings · 106 lines, 480 words
SKILL.md preview
---
name: data-model
description: Data model reference and schema change management — document the current schema, propose and validate schema changes, plan migrations. TRIGGER when designing a new table or field, when modifying an existing schema, when asked about what a table contains or how tables join, or before writing a query against an unfamiliar table. SKIP pure query exploration with no schema change (use /data) and high-level data architecture decisions (use /design).
---

# Data Model

Schema reference and change management for the project's data stores.

Reads from:
- `CLAUDE.md` — primary data stores, key tables, natural keys, and known gotchas
- Live schema (via introspection commands or migration files)
- `docs/decisions/` — ADRs that record past schema decisions

---

## Reference: read the current schema

Before writing a query or proposing a change, read the current schema:

```bash
# BigQuery
bq show --schema --format=prettyjson <project>:<dataset>.<table>

# PostgreSQL
\d <table_name>

# MySQL / MariaDB
DESCRIBE <table>;

# SQLite
.schema <table>

# Check migration files (if using an ORM)
ls migrations/ | tail -5
```

When asked "what's in table X" or "how do X and Y join":
1. Read the schema
2. Check `CLAUDE.md` for documented natural keys and gotchas
3. Answer with: columns + types, natural key, notable nullable columns, known join path

---

## Proposing a schema change

When asked to add a field, rename a column, or create a table:

### 1. State the change precisely

- Table name
- Column name, type, nullable/not-null, default
- Why this column is needed (link to feature requirements)

### 2. Check for conflicts

- Does a column with this name or purpose already exist?
- Does this change affect any existing queries or indexes?
- Will NULL rows appear for existing records — is that acceptable?

### 3. Draft the migration

Write the migration in the project's migration format:

**BigQuery (schema update):**
```bash
bq update <project>:<dataset>.<table> <schema-file>.json
# Or for adding a nullable column only:
bq query --use_legacy_sql=false \
  "ALTER TABLE <dataset>.<table> ADD COLUMN IF NOT EXISTS <col> <type>"
```

**PostgreSQL / MySQL (migration file):**
```sql
-- up
ALTER TABLE <table> ADD COLUMN <col> <type> [DEFAULT <val>] [NOT NULL];

-- down
ALTER TABLE <table> DROP COLUMN <col>;
```

Always write a rollback (down migration) alongside the up migration.

### 4. Assess impact

- Which queries need updating after this change?
- Which API response models need a new field?
- Which frontend types need updating?

Use `/analysis` if the blast radius is non-trivial.

### 5. Document

After the change lands, update `CLAUDE.md` → Data Model section with:
- New table or column
- Natural key (if new table)
- Any gotchas (e.g., STRUCT fields returned as dicts, nullable semantics)

If it's a significant schema decision, record an ADR in `docs/decisions/`.

---

## Schema change safety rules

- **Never drop a column without a deprecation period** — check for any consumer first via `/analysis`
- **Prefer nullable new columns** — NOT NULL requires a default or a backfill before the migration runs
- **Test migrations on a copy of production data** before running on prod, for any table with > 100k rows
- **BigQuery:** table schema changes are limited (cannot rename columns, cannot change types); plan accordingly
- **Never modify a migration file that has already been applied** — write a new one instead

Versions

RepositoryScoreLicence
This page · the-psi/pai-orbit100MIT
genkovich/sdd100MIT
rustyrazorblade/skills95Apache-2.0
chatquill/claude-code-websites90MIT

Database snapshot: 13.11.2026 · package version faeb0ef09150 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100reviewing-migration-and-data-safety
    Reviews schema migrations and data changes for safety: backward compatibility with the running app (expand/migrate/contract), table locks from NOT NULL/index/FK on large tables, unbatched backfills, missing dual-write during transitions, irreversible or destructive DDL, and…
  • 100reviewing-migration-and-data-safety
    Reviews schema migrations and data changes for safety: backward compatibility with the running app (expand/migrate/contract), table locks from NOT NULL/index/FK on large tables, unbatched backfills, missing dual-write during transitions, irreversible or destructive DDL, and…
  • 100database-schema-designer
    Use when designing new database tables from requirements, reviewing a schema for normalisation or performance issues, adding multi-tenancy, planning a breaking migration, or generating TypeScript/Python types from a schema. Triggers on "design the schema", "ERD", "table…
  • 100prisma-schema
    Create or modify Prisma schema for new entities using multi-schema by default. Use this skill when the user wants to define database models, add tables, create migrations, or design a schema with proper field types, relations, indexes, and conventions. Triggers on "prisma…
  • 100schema-migrate
    Use for Salesforce schema changes — object/field/relationship migrations w/ deploy plan, sandbox validation, rollback strategy. Different from /migrate (data) — schema-migrate handles metadata.
  • 100doctrine-migrations
    Use when changing the database schema in Symfony — generating Doctrine migrations, writing reversible up()/down(), data migrations, and deploy-safe (zero-downtime) changes. Use when the task mentions migration, schema change, ALTER TABLE, or doctrine:migrations.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.