by softaworks
An AI skill for Claude, Codex, and Claude Code
1. 打开 Claude 聊天界面
2. 点击下方 "📋 复制" 按钮
3. 粘贴到 Claude 聊天框中并发送
4. 输入 "使用 database-schema-designer 技能" 开始使用
=== database-schema-designer 技能 === 作者: softaworks 描述: An AI skill for Claude, Codex, and Claude Code 使用方法: 1. 调用技能: "使用 database-schema-designer 技能" 2. 提供相关信息: 根据技能要求提供必要参数 3. 查看结果: 技能会返回处理结果 示例: "使用 database-schema-designer 技能,帮我分析一下这段代码"
这种方法适用于所有 Claude 用户,不需要安装额外工具。
productivity
medium
A comprehensive skill for designing production-ready database schemas with built-in best practices for both SQL and NoSQL databases.
The Database Schema Designer skill helps you create robust, scalable database schemas by providing:
Whether you are starting a new project or evolving an existing database, this skill ensures your schema follows industry best practices and avoids common pitfalls.
Use this skill when you need to:
| 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" |
The skill follows a four-phase process:
design a schema for an e-commerce platform with users, products, orders
Output:
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)
);
| Command | Purpose |
|---|---|
design schema for {domain} | Generate a complete schema from scratch |
normalize {table} | Apply normalization rules to fix an existing table |
add indexes for {table} | Generate an index strategy for performance |
migration for {change} | Create reversible migration scripts |
review schema | Audit an existing schema for issues |
Include these details in your request for best results:
No special tools or dependencies required. The skill generates standard SQL or NoSQL schema definitions that work with:
The skill produces:
After designing a schema, verify:
| Anti-Pattern | Problem | Solution |
|---|---|---|
| VARCHAR(255) everywhere | Wastes storage, hides intent | Size appropriately per field |
| FLOAT for money | Rounding errors | DECIMAL(10,2) |
| Missing FK constraints | Orphaned data | Always define foreign keys |
| No indexes on FKs | Slow JOINs | Index every foreign key |
| Storing dates as strings | Cannot compare/sort properly | Use DATE/TIMESTAMP types |
| Non-reversible migrations | Cannot rollback safely | Always write DOWN migration |
| Term | Definition |
|---|---|
| Normalization | Organizing data to reduce redundancy (1NF to 2NF to 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 |
MIT
View Count
0
Download Count
0
Favorite Count
0
Quality Score
58