Skip to content
Skillpedia
Databases33k · #8748

database-schema-designer

What it does

This skill helps your AI agent design database tables and data models. It covers structure, indexes, constraints and migrations. It is for developers and founders who need a sound data model for a new app.

When to use it

  • ✓When you need a database schema for a new app, such as an online store or a blog.
  • ✓When you want to check an existing data model for weak spots like missing indexes.
  • ✓When you are choosing between SQL and NoSQL for a project and want a clear layout.

Skill link

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/database-schema-designer/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/database-schema-designer/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Design a database schema for an online store with users, products and orders.”

5 new skills a week. 1 minute to read.

How it works

The agent takes your description of the data and creates tables with keys, relationships and indexes. It explains the reasoning in plain terms so you can adjust the design.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Database Schema Designer

Design production-ready database schemas with best practices built-in.


Quick Start

Just describe your data model:

design a schema for an e-commerce platform with users, products, orders

You'll get a complete SQL schema like:

CREATE TABLE users (
  id BIGINT AUTO_INCREMENT PRIMARY KEY,
  email VARCHAR(255) UNIQUE NOT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE orders (
  id BIGINT AUTO_INCREMENT PRIMARY KEY,
  user_id BIGINT NOT NULL REFERENCES users(id),
  total DECIMAL(10,2) NOT NULL,
  INDEX idx_orders_user (user_id)
);

What to include in your request:

  • Entities (users, products, orders)
  • Key relationships (users have orders, orders have items)
  • Scale hints (high-traffic, millions of records)
  • Database preference (SQL/NoSQL) - defaults to SQL if not specified

Triggers

Trigger Example
design schema "design a schema for user authentication"
database design "database design for multi-tenant SaaS"
create tables "create tables for a blog system"
schema for "schema for inventory management"
model data "model data for real-time analytics"
I need a database "I need a database for tracking orders"
design NoSQL "design NoSQL schema for product catalog"

Key Terms

Term Definition
Normalization Organizing data to reduce redundancy (1NF → 2NF → 3NF)
3NF Third Normal Form - no transitive dependencies between columns
OLTP Online Transaction Processing - write-heavy, needs normalization
OLAP Online Analytical Processing - read-heavy, benefits from denormalization
Foreign Key (FK) Column that references another table's primary key
Index Data structure that speeds up queries (at cost of slower writes)
Access Pattern How your app reads/writes data (queries, joins, filters)
Denormalization Intentionally duplicating data to speed up reads

Quick Reference

Task Approach Key Consideration
New schema Normalize to 3NF first Domain modeling over UI
SQL vs NoSQL Access patterns decide Read/write ratio matters
Primary keys INT or UUID UUID for distributed systems
Foreign keys Always constrain ON DELETE strategy critical
Indexes FKs + WHERE columns Column order matters
Migrations Always reversible Backward compatible first

Process Overview

Your Data Requirements
    |
    v
+-----------------------------------------------------+
| Phase 1: ANALYSIS                                   |
| * Identify entities and relationships               |
| * Determine access patterns (read vs write heavy)   |
| * Choose SQL or NoSQL based on requirements         |
+-----------------------------------------------------+
    |
    v
+-----------------------------------------------------+
| Phase 2: DESIGN                                     |
| * Normalize to 3NF (SQL) or embed/reference (NoSQL) |
| * Define primary keys and foreign keys              |
| * Choose appropriate data types                     |
| * Add constraints (UNIQUE, CHECK, NOT NULL)         |
+-----------------------------------------------------+
    |
    v
+-----------------------------------------------------+
| Phase 3: OPTIMIZE                                   |
| * Plan indexing strategy                            |
| * Consider denormalization for read-heavy queries   |
| * Add timestamps (created_at, updated_at)           |
+-----------------------------------------------------+
    |
    v
+-----------------------------------------------------+
| Phase 4: MIGRATE                                    |
| * Generate migration scripts (up + down)            |
| * Ensure backward compatibility                     |
| * Plan zero-downtime deployment                     |
+-----------------------------------------------------+
    |
    v
Production-Ready Schema

Commands

Command When to Use Action
design schema for {domain} Starting fresh Full schema generation
normalize {table} Fixing existing table Apply normalization rules
add indexes for {table} Performance issues Generate index strategy
migration for {change} Schema evolution Create reversible migration
`review schema
FAQ

What do I need to tell the agent?

Describe the main things you store, how they relate to each other, and roughly how much data you expect.

Does it default to SQL?

Yes, if you do not name a database type, the skill assumes SQL.

Does it write migrations too?

The skill covers migration patterns, so the agent can help plan changes to an existing schema.

Details

Original description by the author

Design robust, scalable database schemas for SQL and NoSQL databases. Provides normalization guidelines, indexing strategies, migration patterns, constraint design, and performance optimization. Ensures data integrity, query performance, and maintainable data models.

repo: davila7/claude-code-templates

Popularity

GitHub stars
33k
Ranking position
#8748
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills