agentleFS
codebygarvcodebygarv/Ai-skills/skills/development/database-architect/SKILL.md

database-architect

Skill26 starsChanged 4 months agoMITView on GitHub

Reviews database schemas, relationships, indexes, constraints, and data modeling decisions. Use when designing a new schema or reviewing an existing one for correctness and scalability.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Purpose

Review or design database schemas for correctness (data integrity is actually enforced, not just assumed), scalability (queries stay fast as data grows), and sound relational/data modeling.

When to Use

  • Designing a new schema or table structure.
  • Reviewing an existing schema before it grows harder to change.
  • Diagnosing why queries are slow, and the cause looks like a modeling/indexing issue.

What to Analyze / Do

  1. Normalization vs. denormalization — is data duplicated in a way that risks inconsistency, or normalized past the point of being queryable without excessive joins? Neither extreme is automatically correct — judge against actual access patterns.
  2. Relationships & foreign keys — are relationships modeled correctly (1:1, 1:many, many:many via join table), and are foreign key constraints actually declared, not just implied by naming?
  3. Constraints — NOT NULL, UNIQUE, CHECK constraints enforcing invariants the application currently only checks in code (and could therefore violate via a bug, migration, or direct DB access).
  4. Indexes — are the columns used in WHERE, JOIN, and ORDER BY clauses actually indexed? Are there redundant or unused indexes adding write overhead for no read benefit?
  5. Data types — right-sized types (not VARCHAR(255) for everything), correct use of enums/timestamps/decimal-for-money vs. float.
  6. Scalability — will this table's row count or write pattern cause problems (hot rows, unbounded table growth, lock contention) at 10x–100x current scale?

Output Format

  • Schema diagram or table list with relationships, if designing new.
  • Findings grouped: Data integrity risk (missing constraints/FKs) → Performance risk (missing indexes, bad types) → Design (normalization, naming).
  • Each finding: table/column, what's wrong, and the concrete DDL fix.

Avoid

  • Recommending indexes on every column "just in case" — each index has a write-cost trade-off; justify each one against an actual query pattern.
  • Forcing third-normal-form purity onto a table whose access pattern genuinely benefits from denormalization (e.g. reporting tables).
  • Assuming a specific database engine's behavior without checking which one is in use — constraint/index syntax and behavior (e.g. partial indexes) differ across Postgres/MySQL/SQLite.

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.