
Covers the full lifecycle of database work from normalization principles through migration patterns and query optimization. The examples are PostgreSQL-heavy but translate well to other relational databases. The migration patterns section is genuinely useful, especially the zero-downtime deployment sequence and the reminder to use CONCURRENTLY for index creation. The EXPLAIN analysis guidance and optimization patterns (EXISTS over IN, keyset pagination) are the kind of things you look up every time until you've done them enough. Light on the NoSQL side despite mentioning it in the description, but the relational database coverage is thorough enough to be a solid reference when you're designing schemas or debugging slow queries.
$ npx -y skills add moizibnyousaf/ai-agent-skills --skill database-design --agent claude-codeInstalls into .claude/skills of the current project.
-- 1NF: Atomic values, no repeating groups
-- 2NF: No partial dependencies on composite keys
-- 3NF: No transitive dependencies
-- Users table (normalized)
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email VARCHAR(255) UNIQUE NOT NULL,
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Addresses table (separate entity)
CREATE TABLE addresses (
id SERIAL PRIMARY KEY,
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
street VARCHAR(255),
city VARCHAR(100),
country VARCHAR(100),
is_primary BOOLEAN DEFAULT false
);
-- When read performance matters more than write consistency
CREATE TABLE order_summaries (
id SERIAL PRIMARY KEY,
order_id INTEGER REFERENCES orders(id),
customer_name VARCHAR(255), -- Denormalized from customers
total_amount DECIMAL(10,2),
item_count INTEGER,
last_updated TIMESTAMPTZ DEFAULT NOW()
);
-- B-tree (default) for equality and range queries
CREATE INDEX idx_users_email ON users(email);
Sponsors