schema-designer
Help design database schemas, create tables, and plan data models. Activates when users ask to create tables, design schemas, or model data relationships.
Install
mkdir -p .claude/skills/schema-designer && curl -L -o skill.zip "https://mcp.directory/api/skills/download/3752" && unzip -o skill.zip -d .claude/skills/schema-designer && rm skill.zipInstalls to .claude/skills/schema-designer
About this skill
Schema Designer
Help users design database schemas, create tables, and model data relationships.
When to Use
Activate when user asks:
- "Create a table for storing orders"
- "Design a schema for a blog"
- "Add a column to track user preferences"
- "How should I model this relationship?"
Workflow
1. Understand Requirements
Ask clarifying questions:
- What data needs to be stored?
- What are the relationships between entities?
- What queries will be common?
- What's the expected data volume?
2. Check Existing Schema
whodb_tables() → See what already exists
whodb_columns(table="related_table") → Understand existing structure
3. Design the Schema
Follow database design principles:
- Normalize to reduce redundancy
- Use appropriate data types
- Define primary keys
- Establish foreign key relationships
- Add indexes for common queries
4. Generate DDL
Provide CREATE TABLE statements with explanations.
Data Type Guidelines
Identifiers
| Use Case | PostgreSQL | MySQL | SQLite |
|---|---|---|---|
| Auto-increment ID | SERIAL / BIGSERIAL | INT AUTO_INCREMENT | INTEGER PRIMARY KEY |
| UUID | UUID | CHAR(36) | TEXT |
Text
| Use Case | PostgreSQL | MySQL | SQLite |
|---|---|---|---|
| Short text (<255) | VARCHAR(n) | VARCHAR(n) | TEXT |
| Long text | TEXT | TEXT | TEXT |
| Fixed length | CHAR(n) | CHAR(n) | TEXT |
Numbers
| Use Case | PostgreSQL | MySQL | SQLite |
|---|---|---|---|
| Integer | INTEGER | INT | INTEGER |
| Big integer | BIGINT | BIGINT | INTEGER |
| Decimal (money) | NUMERIC(10,2) | DECIMAL(10,2) | REAL |
| Float | REAL | FLOAT | REAL |
Dates
| Use Case | PostgreSQL | MySQL | SQLite |
|---|---|---|---|
| Date only | DATE | DATE | TEXT |
| Timestamp | TIMESTAMP | DATETIME | TEXT |
| With timezone | TIMESTAMPTZ | TIMESTAMP | TEXT |
Boolean
| PostgreSQL | MySQL | SQLite |
|---|---|---|
BOOLEAN | TINYINT(1) | INTEGER |
Common Patterns
Users Table
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email VARCHAR(255) NOT NULL UNIQUE,
password_hash VARCHAR(255) NOT NULL,
name VARCHAR(100),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_users_email ON users(email);
One-to-Many (Orders → Order Items)
CREATE TABLE orders (
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL REFERENCES users(id),
status VARCHAR(20) DEFAULT 'pending',
total NUMERIC(10,2),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE order_items (
id SERIAL PRIMARY KEY,
order_id INTEGER NOT NULL REFERENCES orders(id) ON DELETE CASCADE,
product_id INTEGER NOT NULL REFERENCES products(id),
quantity INTEGER NOT NULL DEFAULT 1,
unit_price NUMERIC(10,2) NOT NULL
);
CREATE INDEX idx_order_items_order ON order_items(order_id);
Many-to-Many (Users ↔ Roles)
CREATE TABLE roles (
id SERIAL PRIMARY KEY,
name VARCHAR(50) NOT NULL UNIQUE
);
CREATE TABLE user_roles (
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
role_id INTEGER NOT NULL REFERENCES roles(id) ON DELETE CASCADE,
PRIMARY KEY (user_id, role_id)
);
Soft Delete Pattern
CREATE TABLE posts (
id SERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
content TEXT,
deleted_at TIMESTAMP NULL, -- NULL = not deleted
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Query active posts
SELECT * FROM posts WHERE deleted_at IS NULL;
Audit Trail Pattern
CREATE TABLE audit_log (
id SERIAL PRIMARY KEY,
table_name VARCHAR(50) NOT NULL,
record_id INTEGER NOT NULL,
action VARCHAR(10) NOT NULL, -- INSERT, UPDATE, DELETE
old_values JSONB,
new_values JSONB,
user_id INTEGER REFERENCES users(id),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_audit_table_record ON audit_log(table_name, record_id);
Best Practices
- Always define PRIMARY KEY - Every table needs one
- Use foreign keys - Enforce referential integrity
- Add NOT NULL - Unless the column is truly optional
- Create indexes - On foreign keys and frequently queried columns
- Use appropriate types - Don't store numbers as strings
- Add timestamps -
created_atandupdated_atare almost always useful - Name consistently -
user_idnotuserIdorUserID - Avoid reserved words - Don't name columns
order,user,group
Migration Safety
When modifying existing tables:
-- Safe: Adding nullable column
ALTER TABLE users ADD COLUMN phone VARCHAR(20);
-- Safe: Adding column with default
ALTER TABLE users ADD COLUMN active BOOLEAN DEFAULT true;
-- Caution: Adding NOT NULL (requires default or backfill)
ALTER TABLE users ADD COLUMN status VARCHAR(20) NOT NULL DEFAULT 'active';
-- Caution: Dropping column (data loss)
ALTER TABLE users DROP COLUMN old_column;
-- Caution: Changing type (may fail on existing data)
ALTER TABLE users ALTER COLUMN age TYPE INTEGER;
More by clidey
View all skills by clidey →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Related MCP Servers
Browse all serversAI-ERD - Create and manage database schemas with DBML on a real-time visual canvas for fast, collaborative design and in
Unlock powerful Excel automation: read/write Excel files, create sheets, and automate workflows with seamless integratio
Manage PostgreSQL connections, create a Postgres database, inspect schemas, and run SQL queries. Supports setting Postgr
Access PatternFly documentation and React docs, component schemas, and dev rules via PatternFly MCP Server — AI-assisted
Boost productivity with Task Master: an AI-powered tool for project management and agile development workflows, integrat
Connect Blender to Claude AI for seamless 3D modeling. Use AI 3D model generator tools for faster, intuitive, interactiv
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.