Agent skill · software engineering · jeremylongshore
designing-database-schemas
Process use when you need to work with database schema design.
Why this skill is useful
Provides detailed guidance on schema design and migrations, including specific DDL patterns and normalization principles that the AI wouldn't reliably generate on its own.
What it needs
Requires mysql, psql installed locally. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
Database Schema Designer Overview Design normalized relational database schemas from business requirements, entity-relationship diagrams, or existing application code. This skill produces PostgreSQL or MySQL DDL with proper data types, constraints, indexes, and relationships following normalization principles (3NF by default) with strategic denormalization where performance requires it. Prerequisites Business domain requirements or existing application models/classes to derive schema from psql or mysql CLI for testing schema DDL Target database engine and version (determines available data types and features) Expected data volumes and query patterns for sizing and index decisions Multi-tenancy requirements (shared schema, schema-per-tenant, or database-per-tenant) Instructions 1. Identify all entities (nouns) from the business requirements. Each entity becomes a table. List every attribute (property) of each entity and classify as required or optional. 2. Define primary keys for each table. Prefer BIGSERIAL (PostgreSQL) or BIGINT AUTOINCREMENT (MySQL) for surrogate keys. Use UUID (via genrandomuuid()) for distributed systems or when IDs are exposed in URLs. Natural keys are acceptable when truly immutable and unique (ISO country codes, IATA airport codes). 3. Normalize the schema to Third Normal Form (3NF): 1NF: Eliminate repeating groups. Each column holds a single atomic value. No arrays in columns (unless using PostgreSQL array types intentionally). 2NF: Remove partial dependencies. Every non-key column depends on the entire primary key. 3NF: Remove transitive dependencies. Non-key columns depend only on the primary key, not on other non-key columns. Extract lookup tables for values that change independently. 4. Define relationships between tables: One-to-many: Add a foreign key column on the "many" side referencing the "one" side. Example: orders.customerid REFERENCES customers(id). Many-to-many: Create a junction table with two foreign keys. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/designing-database-schemas