agentleFS
YauhenBichelYauhenBichel/engineering-skills/skills/model-data/SKILL.md

model-data

Skill0 starsChanged 53 days agoApache-2.0View on GitHub

Designs a database schema or data model. Use when adding tables, collections or persistent formats.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add constraints in the database: NOT NULL, UNIQUE, FOREIGN KEY, CHECK.

    line 9
  2. Distinctive:

    Write migrations with the project's tool (Alembic, Django, Flyway, plain SQL files).

    line 11
  3. Distinctive:

    Write sample queries for the main use cases.

    line 12

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Steps

  1. List entities, primary keys, and foreign keys. Define cardinality (1:1, 1:N, M:N).
  2. Normalize first. Denormalize only for a measured need.
  3. Add constraints in the database: NOT NULL, UNIQUE, FOREIGN KEY, CHECK. (SQLite: turn on PRAGMA foreign_keys = ON;.)
  4. Choose indexes from the real queries and check them with the plan (EXPLAIN / EXPLAIN QUERY PLAN). Cover WHERE, JOIN, and ORDER BY columns.
  5. Write migrations with the project's tool (Alembic, Django, Flyway, plain SQL files). Make changes safe on a live table: add nullable, backfill, then constrain; drop columns only in a later release.
  6. Write sample queries for the main use cases. Test them against a seed dataset.

Checklist

  • All foreign keys reference existing primary keys.
  • No nullable columns without explicit NULL handling.
  • Indexes match live query plans, not guesses.
  • Migrations are additive and reversible via rollback scripts.
  • Cardinality matches domain rules, not assumptions.
  • Sample queries return the expected rows on seed data.

Output

  • Schema definition with tables, columns, types, and constraints.
  • Migration files and index DDL.
  • Three representative queries with execution plans.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.