/product-development-suite:database-designerfrom product-development-suite
Designs complete database schemas with tables, fields, indexes, and ER diagrams. Generates SQL scripts, Markdown docs, and DrawDB-compatible JSON/DBML files. Supports MySQL, PostgreSQL, SQL Server.
Ships in product-development-suite. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Design complete, production-ready database schemas based on user requirements. Generate comprehensive documentation, SQL scripts, and visual ER diagram files compatible with DrawDB.
Before starting any design, always read references/design-principles.md to understand:
Gather information about the database design:
If the user provides minimal information, intelligently infer missing details based on common business scenarios and best practices documented in references/design-examples.md.
Key inference scenarios:
Based on the design requirements, load appropriate references:
references/design-principles.md for core design rulesreferences/drawdb-formats.md for JSON/DBML specificationsreferences/design-examples.md for similar system designsCreate complete table structures following these guidelines:
For each table:
✅ Add default system fields (unless user specifies otherwise):
id BIGINT AUTO_INCREMENT PRIMARY KEYcreated_at DATETIME DEFAULT CURRENT_TIMESTAMPupdated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMPis_deleted TINYINT(1) DEFAULT 0✅ Design business fields with realistic sizes:
references/design-principles.md for complete size standards✅ Add appropriate constraints:
✅ Add COMMENT to every table and field (in Chinese)
✅ Do NOT create physical FOREIGN KEY constraints
For each table, analyze and create indexes for:
xxx_id foreign key fieldsIndex naming conventions:
idx_field_name or idx_field1_field2uk_field_nameIndex limits:
Identify logical relationships between tables:
One-to-Many (1:N): Most common
user_id in order tableOne-to-One (1:1): For table splitting
user_id UNIQUE in user_profile tableMany-to-Many (N:N): Requires junction table
Create all required output files:
Create a single, well-structured Markdown file containing:
Structure:
# [Project Name] 数据库设计文档
## 1. 数据库概览
- 数据库类型
- 字符集
- 核心表数量
- 主要功能模块
## 2. 表结构设计
### 2.1 [Table Name]
**表名**: table_name
**说明**: Table description
**字段列表**:
| 字段名 | 类型 | 允许空 | 默认值 | 说明 |
|--------|------|--------|--------|------|
| id | BIGINT | NO | | Primary key |
| ... | ... | ... | ... | ... |
**索引列表**:
| 索引名 | 类型 | 字段 |
|--------|------|------|
| uk_email | UNIQUE | email |
| idx_username | INDEX | username |
### 2.2 [Next Table]
...
## 3. 表关系说明
- table1 → table2 (1:N): Description
- table3 ↔ table4 (N:N): Description via junction table
## 4. 索引策略说明
Explain the rationale behind index design decisions
Create executable SQL script with:
-- Database: project_name
-- Generated: YYYY-MM-DD
-- Drop tables if exists (in reverse dependency order)
DROP TABLE IF EXISTS `table3`;
DROP TABLE IF EXISTS `table2`;
DROP TABLE IF EXISTS `table1`;
-- Create tables (in dependency order)
CREATE TABLE `table1` (
`id` BIGINT NOT NULL AUTO_INCREMENT COMMENT 'Comment',
...
PRIMARY KEY (`id`),
UNIQUE KEY `uk_field` (`field`),
KEY `idx_field` (`field`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Table comment';
CREATE TABLE `table2` (
...
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Table comment';
Generate DrawDB-compatible JSON file following references/drawdb-formats.md:
Critical Format Requirements:
"_KV5MtPf2m4sI7Inu8pat")"B8rPRTDtOv9oD2Gp4bhWL")"VARCHAR(100)", not separate type and size)["email"] not [1])ID Generation:
import random
import string
def generate_id():
chars = string.ascii_letters + string.digits + '_-'
return ''.join(random.choice(chars) for _ in range(21))
Layout Strategy:
x = (index % 3) * 450 + 50, y = floor(index / 3) * 400 + 50["#6360f7", "#bc49c4", "#ffe159", "#89e667", "#ff9159", "#59d9ff", "#ff5959", "#a0a0a0"]Relationship Generation:
xxx_id foreign key fieldsStructure:
{
"tables": [
{
"id": "random_string",
"name": "table_name",
"comment": "表注释",
"color": "#6360f7",
"fields": [
{
"id": "random_string",
"name": "id",
"type": "BIGINT",
"default": "",
"check": "",
"primary": true,
"unique": true,
"notNull": true,
"increment": true,
"comment": "主键ID"
}
],
"indices": [
{
"id": 0,
"fields": ["field_name"],
"name": "idx_field_name",
"unique": false
}
],
"x": 50.0,
"y": 50.0
}
],
"relationships": [
{
"name": "",
"startTableId": "random_string",
"endTableId": "random_string",
"endFieldId": "random_string",
"startFieldId": "random_string",
"id": "random_string",
"updateConstraint": "No action",
"deleteConstraint": "No action",
"cardinality": "many_to_one"
}
],
"notes": [],
"subjectAreas": [],
"database": "generic",
"types": [],
"title": "Project Database"
}
Generate DBML file following references/drawdb-formats.md:
Key points:
bigint, varchar(50), datetime[pk, increment, not null, unique, note: '注释']indexes { } blockRef blocks> (many-to-one), - (one-to-one)Structure:
Table table_name [headercolor: #6360f7] {
id bigint [pk, increment, not null, unique, note: 'Comment']
field varchar(100) [not null, note: 'Comment']
indexes {
field [unique, name: 'uk_field']
}
Note: 'Table comment'
}
Ref fk_name {
table1.field > table2.id [delete: no action, update: no action]
}
Recommended Approach (Following Claude Code Official Standards):
Save all database design files to outputs/<project-name>/database/:
outputs/
└── <project-name>/ # Project name (e.g., e-commerce-system)
└── database/
├── schema-design.md # Comprehensive design document
├── schema.sql # Executable SQL script
├── drawdb-schema.json # DrawDB JSON format
└── drawdb-schema.dbml # DrawDB DBML format
Example:
outputs/
├── e-commerce-system/
│ └── database/
│ ├── schema-design.md
│ ├── schema.sql
│ ├── drawdb-schema.json
│ └── drawdb-schema.dbml
└── task-management-app/
└── database/
├── schema-design.md
└── schema.sql
Alternative Approach (Traditional Project Structure):
If your project has an existing directory structure, you can also use:
project-root/
└── database/
├── schema-design.md
├── schema.sql
├── drawdb-schema.json
└── drawdb-schema.dbml
Required Outputs (4 files):
schema-design.md - Comprehensive database design document (Chinese)schema.sql - Executable SQL scriptdrawdb-schema.json - DrawDB JSON formatdrawdb-schema.dbml - DrawDB DBML formatOptional Outputs:
er-diagram.png - ER diagram visualization (if tools available)index-strategy.md - Index strategy documentationuser-authentication-schema.sqlschema-v1.0.sql or schema-2024-12-10.sqle-commerce-database-schema.sqlAfter generating all files, provide a summary with:
Only create minimal structure:
CREATE TABLE `table_name` (
`id` BIGINT NOT NULL AUTO_INCREMENT COMMENT 'Primary key',
/* business fields only */
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Table comment';
Adapt SQL syntax accordingly:
PostgreSQL:
SERIAL or BIGSERIAL instead of AUTO_INCREMENTTIMESTAMP instead of DATETIMESQL Server:
IDENTITY(1,1) instead of AUTO_INCREMENTDATETIME2 instead of DATETIMENVARCHAR for Unicode supportOracle:
SEQUENCE for auto-incrementVARCHAR2 instead of VARCHARDATE or TIMESTAMP for time fieldsApply intelligent inference:
references/design-examples.mdBefore finalizing, verify:
User says: "设计一个电商系统的数据库,包括用户、商品、订单功能" → Read design-principles.md and design-examples.md → Design: user_info, product_info, order_info, order_detail tables → Generate all 4 output files
User says: "Design a blog database" → Infer: user, article, comment, tag, article_tag tables → Follow standard design principles → Generate all outputs
User says: "Create a user table for PostgreSQL" → Single table design → Adapt SQL syntax for PostgreSQL → Include in all output formats
references/design-principles.md - Core design rules and standardsreferences/drawdb-formats.md - JSON and DBML format specificationsreferences/design-examples.md - Real-world design examplesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub shining319/claude-code-single-person-workflow --plugin product-development-suite6 skills in this plugin
/academic-writing-stylePersonalized academic writing assistant for university assignments in Chinese and English. Three modes: write new drafts, revise/polish existing drafts to remove AI markers, and learn the user's own style from writing samples. Always writes in plain language with short sentences. Triggers: academic writing, assignment, report, technical analysis, research review, case study, revise, polish, rewrite, reduce AI tone, match my style. | 个性化学术写作助手,适用于中英文大学作业。三种模式:新写、润色改写(降低AI痕迹)、学习用户文风。行文朴素,少用长难句。触发词:学术写作、作业、报告、技术分析、研究综述、案例研究、项目文档、润色、改写、降低AI痕迹、模仿我的文风。/product-managerSenior product manager producing two fixed deliverables: a PRD (personas, epics and user stories with acceptance criteria and story points, priorities, NFRs, sprint planning, definition of done, risks, open questions) and a Task Backlog (backend/frontend tasks with hours, dependencies, critical path and API list). PRD first; the backlog only after the architecture document, database design and completed PRD exist. Triggers: PRD, product requirements, user story, epic, MVP, feature planning, sprint planning, backlog, task breakdown, user persona. | 资深产品经理,固定产出 PRD(用户画像、Epic 与用户故事、验收标准、故事点、优先级、非功能需求、Sprint 规划、DoD、风险、待确认问题)和任务 Backlog(前后端任务、工时、依赖、关键路径、API 清单)。先出 PRD;架构文档、数据库设计、完善后的 PRD 齐全后才生成 Backlog。触发词:PRD、产品需求、用户故事、Epic、MVP、功能规划、Sprint 规划、Backlog、任务拆解、用户画像。/solution-architectSenior solution architect that turns product requirements into executable system architecture. Covers requirements and NFR quantification, capacity estimation, architecture pattern choice (modular monolith by default), stack selection for two lines (A: React/Vue + Java Spring Boot; B: TypeScript full-stack with Next.js/Nuxt/Hono/NestJS), data architecture, hosting and deployment, security/compliance (OWASP, GDPR, PIPL, ICP), cost tiers, 10 reference architectures, ADRs and architecture review. Triggers: architecture, system design, tech stack, technology selection, deployment, hosting, infrastructure, capacity planning, ADR, architecture review, microservices vs monolith. | 资深解决方案架构师,将产品需求转化为可落地的系统架构:需求与非功能需求量化、容量估算、架构模式选择、Java / TypeScript 双技术线选型、数据架构、托管部署、安全合规、成本分级、10 套参考架构、ADR 与架构评审。触发词:架构设计、系统设计、技术架构、技术选型、部署方案、托管、基础设施、容量估算、架构决策记录、架构评审、微服务还是单体。/ui-designerSenior UI/UX designer transforming product requirements into professional design solutions. Use when users need: (1) Page structure and information architecture, (2) UI layout and components, (3) Color schemes and visual specs, (4) Design specification docs, (5) User flow diagrams. Triggers: UI design, page design, interface design, interaction design, design specs, layout. | 资深UI/UX设计师,将需求转化为设计方案。触发词:UI设计、页面设计、界面设计、交互设计、设计规范、页面布局、设计方案。/ui-ux-pro-maxData-driven UI/UX design intelligence with 50+ styles, 21 palettes, 50 font pairings, and 9 framework stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Searchable design knowledge base for professional UI/UX implementation. | 数据驱动的专业 UI/UX 设计智能,包含 50+ 设计风格、21 种配色方案、50 种字体配对,支持 9 种前端框架。可搜索的设计知识库,用于专业 UI/UX 实现。3 plugins in one repository ship this exact skill · first indexed Aug 15, 2026
Other plugins' skills for the same job