AI Agent Hub
Back to skills
MySQL Database Design Assistant icon

MySQL Database Design Assistant

Development Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please install @user_1a9d72e6/mysql-design according to https://skillhub.cn/install/skillhub.md.

About this skill

Problem

MySQL table designs often suffer from inconsistent naming, arbitrary data types, and weak indexing. This skill targets the design step between business documentation and executable DDL, helping engineers turn entities, fields, status codes, and constraints into a reviewable CREATE TABLE script.

How it works

The workflow is practical rather than generic:

  • Use Read or Glob to inspect .md business-rule files and extract entities, fields, enums, status codes, and relationships.
  • Analyze existing .sql files to understand legacy schemas and compatibility risks.
  • Apply naming and type rules, such as lowercase identifiers, VARCHAR, DECIMAL(M,2), DATETIME, and TINYINT(1).
  • Design primary keys, unique business keys, and indexes for high-frequency queries, following the leftmost prefix rule.
  • Generate MySQL DDL with column comments, utf8mb4, InnoDB, and no foreign keys, leaving consistency to the application layer.

Boundaries

It is most useful for new table design, schema review, and DDL cleanup on MySQL 5.7/8.0. It does not replace data migration, load testing, or full sharding strategy. If the business-rule document is incomplete, the generated design may miss fields or constraints.

Use Cases

  • Turn a procurement contract requirements document into a MySQL DDL draft with standardized names and field types.
  • Review legacy .sql scripts, decide compatibility constraints, and add unique or high-frequency query indexes.
  • Convert order, status, and amount business rules into annotated CREATE TABLE statements using utf8mb4 and InnoDB.
  • Prepare a data review packet by mapping status codes and defaults to CHAR(2), DECIMAL, and NOT NULL rules.

Best For

  • Backend engineers building transaction tables need schema drafts from requirement docs before review.
  • Legacy system maintainers need compatible changes, added indexes, and column comments without breaking old tables.
  • Architects reviewing data models need consistent amount, status, and time fields to reduce rework.
  • Backend developers taking over procurement or order modules need scattered business rules converted into executable DDL.