
Database Design
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.
- skills.sh installs
- 615
- GitHub stars
- 1.2K
- last updated
- May 5, 2026
Install
$ npx -y skills add moizibnyousaf/ai-agent-skills --skill database-design --agent claude-codeInstalls into .claude/skills of the current project.
Files
Database Design
Schema Design Principles
Normalization Guidelines
-- 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
);
Denormalization for Performance
-- 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()
);
Index Design
Common Index Patterns
-- B-tree (default) for equality and range queries
CREATE INDEX idx_users_email ON users(email);
Sponsors
Details
- Repository
- github.com/moizibnyousaf/ai-agent-skills
- Categories
- Backend & APIs, Documentation, AI & Agent Building, Design & UI/UX, Databases
- License
- MIT
- First seen
- Jun 11, 2026
More from moizibnyousaf/ai-agent-skills
All 17- Code Documentation569
- Best Practices531
- Llm Application Dev466
- Content Research Writer412
- Changelog Generator397
- Ask Questions If Underspecified380
- Browse And Evaluate177
- Review A Skill177
- Build Workspace Docs172
- Audit Library Health170
- Update Installed Skills168
- Install From Remote Library161
- Share A Library161
- Curate A Team Library160
- Migrate Skills Between Libraries158
- Backend Development874