Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

data-model-creation

FreeNo executable scriptsNot checked

Optional advanced tool for complex data modeling. For simple table creation, use relational-database-tool directly with SQL statements.

Microckby Microck★ 417 GitHub stars

About this skill

When to use this skill

This is an OPTIONAL advanced modeling tool for complex database design. Most simple table creation should use relational-database-tool directly with SQL statements.

ONLY use this skill when you specifically need:

  • Complex multi-table relationships with automatic foreign key management
  • Visual ER diagram generation for documentation
  • Automated field type mapping and constraint generation
  • Enterprise-level data model documentation

For most cases, use rules/relational-database-tool/rule.md instead:

  • Simple table creation with CREATE TABLE statements
  • Basic CRUD operations
  • Schema modifications with ALTER TABLE
  • Direct SQL execution without Mermaid modeling

Do NOT use for:

  • Querying or manipulating existing data (use database skills)
  • NoSQL database design (use NoSQL skills)
  • Frontend data structures (use appropriate frontend skills)

How to use this skill (for a coding agent)

⚠️ NOTE: This is OPTIONAL. For simple tasks, skip this and use relational-database-tool directly.

When you do use this advanced modeling approach:

  1. Optional modeling workflow (only when complexity justifies it)

    • Business analysis phase: Analyze user requirements, identify core entities and relationships
    • Mermaid modeling phase: Create mermaid classDiagram following generation rules
    • Model validation phase: Check completeness, consistency, and correctness
  2. Apply generation rules strictly (when using this tool)

    • Use correct type mappings (string, number, boolean, x-enum, etc.)
    • Convert Chinese to English naming (PascalCase for classes, camelCase for fields)
    • Define required(), unique(), display_field() functions when needed
    • Use proper relationship notation with field names
  3. Use tools correctly (only when you choose this approach)

    • Call data model creation tools only for complex multi-entity business requirements
    • Use mermaidDiagram parameter with complete mermaid classDiagram code
    • Set publish to false initially, create then publish separately
    • Choose appropriate updateMode for new or existing models

Quick Decision Guide

Most Database Tasks → rules/relational-database-tool/rule.md

  • ✅ Simple table creation
  • ✅ Data queries and modifications
  • ✅ Schema changes
  • ✅ Direct SQL execution

Complex Modeling Only → This rule (rules/data-model-creation/rule.md)

  • 🎯 Multi-entity relationship modeling
  • 🎯 Automated foreign key management
  • 🎯 Visual ER diagram generation
  • 🎯 Enterprise documentation

Data Model AI Modeling Professional Rules

⚠️ IMPORTANT: Simplified Workflow Recommendation

For most database table creation tasks, use rules/relational-database-tool/rule.md directly:

  • Simple table creation: CREATE TABLE users (id INT PRIMARY KEY, name VARCHAR(255))
  • Schema modifications: ALTER TABLE users ADD COLUMN email VARCHAR(255)
  • Data operations: INSERT, UPDATE, SELECT, DELETE

Only use this advanced Mermaid modeling approach when:

  • You need automated relationship management
  • Complex multi-table schemas with foreign keys
  • Enterprise documentation requirements
  • Visual ER diagram generation

This rule exists for complex modeling scenarios, but most development should use direct SQL execution.

AI Modeling Expert Prompt

As an expert in data modeling and a senior architect in software development, you are proficient in Mermaid. Your main task is to provide model structures in mermaid classDiagram format based on user descriptions, following the detailed rules below:

Generation Rules

  1. Type Mapping Priority: When user-described fields match the mapping relationship, prioritize using type as the field type. Mapping relationships are as follows:

    Business Field type
    Text string
    Number number
    Boolean boolean
    Enum x-enum
    Email email
    Phone phone
    URL url
    File x-file
    Image x-image
    Rich Text x-rtf
    Region x-area-code
    Time time
    Date date
    DateTime datetime
    Object object
    Array string[]
    Location x-location
  2. Naming Convention: Convert Chinese descriptions to English naming (except enum values). Use PascalCase for class names, camelCase for field names.

  3. Field Visibility: Use default visibility for fields, do not add "+" or "-".

  4. Array Types: When descriptions include array types, use specific array formats such as string[], number[], x-rtf[], etc.

  5. Chinese Administrative Regions: When involving Chinese administrative regions like "province/city/district", use x-area-code field type.

  6. Required Fields: When descriptions explicitly mention required fields, define a required() parameterless function, return value as string array of required field names, e.g., required() ["name", "age"]. By default, fields are not required.

Full SKILL.md on GitHub

Install data-model-creation in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

metadata.json

FAQ

What does the data-model-creation skill do?

Optional advanced tool for complex data modeling. For simple table creation, use relational-database-tool directly with SQL statements.

How do I install the data-model-creation skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the data-model-creation skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare data-model-creation with