skills_categorized/database-tools/data-model-creation/SKILL.md
Optional advanced tool for complex data modeling. For simple table creation, use relational-database-tool directly with SQL statements.
npx skillsauth add activer007/ordinary-claude-skills data-model-creationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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:
For most cases, use rules/relational-database-tool/rule.md instead:
Do NOT use for:
⚠️ NOTE: This is OPTIONAL. For simple tasks, skip this and use relational-database-tool directly.
When you do use this advanced modeling approach:
Optional modeling workflow (only when complexity justifies it)
Apply generation rules strictly (when using this tool)
Use tools correctly (only when you choose this approach)
mermaidDiagram parameter with complete mermaid classDiagram codepublish to false initially, create then publish separatelyupdateMode for new or existing modelsMost Database Tasks → rules/relational-database-tool/rule.md
Complex Modeling Only → This rule (rules/data-model-creation/rule.md)
For most database table creation tasks, use rules/relational-database-tool/rule.md directly:
CREATE TABLE users (id INT PRIMARY KEY, name VARCHAR(255))ALTER TABLE users ADD COLUMN email VARCHAR(255)INSERT, UPDATE, SELECT, DELETEOnly use this advanced Mermaid modeling approach when:
This rule exists for complex modeling scenarios, but most development should use direct SQL execution.
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:
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 |
Naming Convention: Convert Chinese descriptions to English naming (except enum values). Use PascalCase for class names, camelCase for field names.
Field Visibility: Use default visibility for fields, do not add "+" or "-".
Array Types: When descriptions include array types, use specific array formats such as string[], number[], x-rtf[], etc.
Chinese Administrative Regions: When involving Chinese administrative regions like "province/city/district", use x-area-code field type.
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.
Unique Fields: When descriptions explicitly mention unique fields, define a unique() parameterless function, return value as string array of unique field names, e.g., unique() ["name", "age"]. By default, fields are not unique.
Default Values: When descriptions explicitly require field default values, use "= default value" format after field definition, e.g., age: number = 0. By default, fields have no default values.
Field Descriptions: For each field definition in user descriptions, use <<description>> format at the end of the definition line, e.g., name: string <<Name>>.
Display Field: Each entity class should have a field for display when being referenced. Usually a human-readable name or unique identifier. Define display_field() parameterless function, return value is a field name representing the main display field, e.g., display_field() "name" means the main display field is name. Otherwise, default to the implicit _id of the data model.
Class Notes: After all class definitions are complete, use note to describe class names. First use "%% Class naming" to anchor the area, then provide Chinese table names for each class.
Relationships: When descriptions contain relationships, relationship label LabelText should not use original semantics, but use relationship field names. For example, A "n" <-- "1" B: field1 means A has many-to-one relationship with B, data exists in A's field1 field. Refer to examples for specifics.
Naming: Field names and descriptions in Mermaid should be concise and accurately expressed.
Complexity Control: Unless user requires, control complexity, e.g., number of classes should not exceed 5, control field complexity.
classDiagram
class Student {
name: string <<Name>>
age: number = 18 <<Age>>
gender: x-enum = "Male" <<Gender>>
classId: string <<Class ID>>
identityId: string <<Identity ID>>
course: Course[] <<Courses>>
required() ["name"]
unique() ["name"]
enum_gender() ["Male", "Female"]
display_field() "name"
}
class Class {
className: string <<Class Name>>
display_field() "className"
}
class Course {
name: string <<Course Name>>
students: Student[] <<Students>>
display_field() "name"
}
class Identity {
number: string <<ID Number>>
display_field() "number"
}
%% Relationships
Student "1" --> "1" Identity : studentId
Student "n" --> "1" Class : student2class
Student "n" --> "m" Course : course
Student "n" <-- "m" Course : students
%% Class naming
note for Student "Student Model"
note for Class "Class Model"
note for Course "Course Model"
note for Identity "Identity Model"
string → VARCHAR/TEXTnumber → INT/BIGINT/DECIMALboolean → BOOLEAN/TINYINTdate → DATEdatetime → DATETIMEtime → TIMEx-enum → ENUM typex-file/x-image → File path storagex-rtf → LONGTEXT rich textx-area-code → Region codex-location → Geographic location coordinatesemail/phone/url → VARCHAR with validationexecuteWriteSQL with CREATE TABLEexecuteWriteSQL with ALTER TABLEexecuteReadOnlySQLmermaidDiagram: Complete mermaid classDiagram codepublish: Whether to publish model immediately (recommend default to false, create then publish)updateMode: Create new model or update existing modelclassDiagram
class User {
username: string <<Username>>
email: email <<Email>>
password: string <<Password>>
avatar: x-image <<Avatar>>
status: x-enum = "active" <<Status>>
required() ["username", "email"]
unique() ["username", "email"]
enum_status() ["active", "inactive", "banned"]
display_field() "username"
}
classDiagram
class Product {
name: string <<Product Name>>
price: number <<Price>>
description: x-rtf <<Product Description>>
images: x-image[] <<Product Images>>
category: string <<Category>>
stock: number = 0 <<Stock>>
required() ["name", "price"]
display_field() "name"
}
class Order {
orderNo: string <<Order Number>>
totalAmount: number <<Total Amount>>
status: x-enum = "pending" <<Order Status>>
createTime: datetime <<Create Time>>
required() ["orderNo", "totalAmount"]
unique() ["orderNo"]
enum_status() ["pending", "paid", "shipped", "completed", "cancelled"]
display_field() "orderNo"
}
classDiagram
class Article {
title: string <<Title>>
content: x-rtf <<Content>>
author: string <<Author>>
publishTime: datetime <<Publish Time>>
status: x-enum = "draft" <<Status>>
tags: string[] <<Tags>>
required() ["title", "content", "author"]
enum_status() ["draft", "published", "archived"]
display_field() "title"
}
These rules will guide AI Agents to generate high-quality, business-requirement-compliant data models during the data modeling process.
tools
Generate typed TypeScript SDKs for AI agents to interact with MCP servers. Converts verbose JSON-RPC curl commands to clean function calls (docs.createDocument() vs curl). Auto-detects MCP tools from server modules, generates TypeScript types and client methods, creates runnable example scripts. Use when: building MCP-enabled applications, need typed programmatic access to MCP tools, want Claude Code to manage apps via scripts, eliminating manual JSON-RPC curl commands, validating MCP inputs/outputs, or creating reusable agent automation.
testing
Generate structured task lists from specs or requirements. IMPORTANT: After completing ANY spec via ExitSpecMode, ALWAYS ask the user: "Would you like me to generate a task list for this spec?" Use when user confirms or explicitly requests task generation from a plan/spec/PRD.
tools
Create compelling story-format summaries using UltraThink to find the best narrative framing. Support multiple formats - 3-part narrative, n-length with inline links, abridged 5-line, or comprehensive via Foundry MCP. USE WHEN user says 'create story explanation', 'narrative summary', 'explain as a story', or wants content in Daniel's conversational first-person voice.
testing
Navigate through the original three-world shamanic technology. Deploy when soul retrieval, power animal guidance, or journey between realms emerges. Deeply respectful of Tungus, Buryat, Yakut, Evenki traditions. Use for consciousness navigation, NOT cultural appropriation.