Sibling skills (local only)
Sibling CloudBase skills ship beside this skill. Use local relative paths such as ../auth-tool-cloudbase/SKILL.md.
If a referenced sibling skill file is missing from this environment, ask the user to install the full CloudBase plugin (or the missing skill). Do not HTTP-fetch remote skill or protocol markdown into the agent context.
Data Model Creation
Activation Contract
Use this first when
- The user explicitly wants Mermaid
classDiagram modeling.
- The task needs complex multi-entity relational design, visual ER-style output, or generated data-model structure rather than direct SQL.
- You need to create CloudBase data models through the dedicated modeling tools, or you need to inspect an existing model before planning follow-up changes.
Read before writing code if
- The request mentions data model, ER diagram, Mermaid, relationship graph, or enterprise schema design.
- The user wants to reuse or update an existing published model.
Then also read
- Direct MySQL SQL creation or schema change ->
../relational-database-mcp-cloudbase/SKILL.md
- PostgreSQL / CloudBase PG schema work ->
../postgresql-development-cloudbase/SKILL.md
- Broader feature planning before schema work ->
../spec-workflow/SKILL.md
Do NOT use for
- Simple
CREATE TABLE, ALTER TABLE, or CRUD tasks.
- Document-database collection design.
- Frontend-only data-shape discussions with no modeling requirement.
Common mistakes / gotchas
- Using Mermaid modeling for a task that only needs one or two SQL statements.
- Mixing SQL-table design and NoSQL collection design in the same model.
- Generating diagrams without first deciding entity boundaries and ownership relations.
- Publishing a new model before validating the generated fields and relationships.
Minimal checklist
- Confirm Mermaid modeling is actually needed.
- List the core entities and relationships first.
- Decide whether this is a new model or an update.
- Keep the initial model small unless the user explicitly wants a large enterprise schema.
Overview
This skill is an advanced modeling path, not the default path for database work.
- For most MySQL database tasks, use
relational-database-mcp-cloudbase and write SQL directly. If the task says PostgreSQL, CloudBase PG, PG mode, app.rdb(), queryPgDatabase, managePgDatabase, or RLS, use postgresql-development-cloudbase instead.
- Use this skill only when diagram-driven modeling adds value.
Quick routing
Use relational-database-mcp-cloudbase instead when
- You need MySQL
CREATE TABLE, ALTER TABLE, INSERT, UPDATE, DELETE, or SELECT
- The schema is small and already clear
- The user never asked for a visual model
- The task does not mention PostgreSQL / CloudBase PG / PG mode /
app.rdb() / queryPgDatabase / managePgDatabase / RLS
Use this skill when
- You need multi-entity relationship modeling
- You need Mermaid
classDiagram output
- You want generated model structure and documentation
- You need a clean modeling pass before SQL implementation
How to use this skill (for a coding agent)
Clarify the entity set
- Extract business entities, ownership, and relationship cardinality from the request.
- Prefer 3-5 core entities unless the user clearly asks for more.
Model first, then generate
- Draft Mermaid
classDiagram content.
- Validate names, field types, and relationships before calling modeling tools.
Use the right tools
- Read/list existing models ->
manageDataModel(action="list"|"get"|"docs")
- Create a new model ->
modifyDataModel (compatibility name; create-only)
Publish carefully
- Prefer creating with unpublished or draft-like intent first.
- Publish only after checking field names, required constraints, and relationship directions.
Mermaid generation rules
Naming
- Class names -> PascalCase
- Field names -> camelCase
- Convert Chinese business descriptions into clear English identifiers
- Keep enum values human-readable when needed
Type mapping
| Business meaning |
Mermaid type |
| text |
string |
| number |
number |
| boolean |
boolean |
| enum |
x-enum |
| email |
email |
| phone |
phone |
| URL |
url |
| image |
x-image |
| file |
x-file |
| rich text |
x-rtf |
| date |
date |
| datetime |
datetime |
| region |
x-area-code |
| location |
x-location |
| array |
string[] or another explicit array type |
Required structure conventions
- Use
required() only for fields the user explicitly marks as required.
- Use
unique() only for explicit uniqueness needs.
- Use
display_field() for the human-facing label field.
- Add concise
<<description>> notes to important fields.
- Keep relationship labels tied to actual field names rather than vague business prose.
Minimal example
classDiagram
class User {
username: string <<Username>>
email: email <<Email>>
display_field() "username"
required() ["username", "email"]
unique() ["username", "email"]
}
class Order {
orderNo: string <<Order Number>>
totalAmount: number <<Total Amount>>
userId: string <<User ID>>
display_field() "orderNo"
unique() ["orderNo"]
}
Order "n" --> "1" User : userId
%% Class naming
note for User "用户"
note for Order "订单"
Tool usage guidance
Read existing models
Use this before creating related models, checking naming consistency, or assessing how an existing model is defined:
manageDataModel(action="list")
manageDataModel(action="get", name="ModelName")
manageDataModel(action="docs", name="ModelName")
Create model
Use modifyDataModel with:
- a complete
mermaidDiagram
action="create" when you want to create new models
- a deliberate publish decision
- clear awareness that updating existing model structures is not currently supported by this tool
Best practices
- Prefer direct SQL unless the user clearly benefits from model-first design.
- Keep the first model iteration small and reviewable.
- Separate business entities from implementation-only helper fields.
- Validate relationship direction and ownership before publishing.
- After modeling, hand off actual MySQL SQL/table work to
relational-database-mcp-cloudbase when needed. For PostgreSQL / CloudBase PG tables, hand off to postgresql-development-cloudbase instead.
1---2name: data-model-creation3description: [Deprecated] Optional advanced tool for complex data modeling. For simple MySQL table creation, use relational-database-tool directly; for PostgreSQL / CloudBase PG schema work, use postgresql-development. New environments should use PostgreSQL DDL via queryPgDatabase/managePgDatabase — see postgresql-development skill instead.4---56## Sibling skills (local only)78Sibling CloudBase skills ship beside this skill. Use local relative paths such as `../auth-tool-cloudbase/SKILL.md`.910If a referenced sibling skill file is missing from this environment, ask the user to install the full CloudBase plugin (or the missing skill). Do **not** HTTP-fetch remote skill or protocol markdown into the agent context.1112# Data Model Creation1314## Activation Contract1516### Use this first when1718- The user explicitly wants Mermaid `classDiagram` modeling.19- The task needs complex multi-entity relational design, visual ER-style output, or generated data-model structure rather than direct SQL.20- You need to create CloudBase data models through the dedicated modeling tools, or you need to inspect an existing model before planning follow-up changes.2122### Read before writing code if2324- The request mentions data model, ER diagram, Mermaid, relationship graph, or enterprise schema design.25- The user wants to reuse or update an existing published model.2627### Then also read2829- Direct MySQL SQL creation or schema change -> `../relational-database-mcp-cloudbase/SKILL.md`30- PostgreSQL / CloudBase PG schema work -> `../postgresql-development-cloudbase/SKILL.md`31- Broader feature planning before schema work -> `../spec-workflow/SKILL.md`3233### Do NOT use for3435- Simple `CREATE TABLE`, `ALTER TABLE`, or CRUD tasks.36- Document-database collection design.37- Frontend-only data-shape discussions with no modeling requirement.3839### Common mistakes / gotchas4041- Using Mermaid modeling for a task that only needs one or two SQL statements.42- Mixing SQL-table design and NoSQL collection design in the same model.43- Generating diagrams without first deciding entity boundaries and ownership relations.44- Publishing a new model before validating the generated fields and relationships.4546### Minimal checklist4748- Confirm Mermaid modeling is actually needed.49- List the core entities and relationships first.50- Decide whether this is a new model or an update.51- Keep the initial model small unless the user explicitly wants a large enterprise schema.5253## Overview5455This skill is an **advanced modeling path**, not the default path for database work.5657- For most MySQL database tasks, use `relational-database-mcp-cloudbase` and write SQL directly. If the task says PostgreSQL, CloudBase PG, PG mode, `app.rdb()`, `queryPgDatabase`, `managePgDatabase`, or RLS, use `postgresql-development-cloudbase` instead.58- Use this skill only when diagram-driven modeling adds value.5960## Quick routing6162### Use `relational-database-mcp-cloudbase` instead when6364- You need MySQL `CREATE TABLE`, `ALTER TABLE`, `INSERT`, `UPDATE`, `DELETE`, or `SELECT`65- The schema is small and already clear66- The user never asked for a visual model67- The task does **not** mention PostgreSQL / CloudBase PG / PG mode / `app.rdb()` / `queryPgDatabase` / `managePgDatabase` / RLS6869### Use this skill when7071- You need multi-entity relationship modeling72- You need Mermaid `classDiagram` output73- You want generated model structure and documentation74- You need a clean modeling pass before SQL implementation7576## How to use this skill (for a coding agent)77781. **Clarify the entity set**79 - Extract business entities, ownership, and relationship cardinality from the request.80 - Prefer 3-5 core entities unless the user clearly asks for more.81822. **Model first, then generate**83 - Draft Mermaid `classDiagram` content.84 - Validate names, field types, and relationships before calling modeling tools.85863. **Use the right tools**87 - Read/list existing models -> `manageDataModel(action="list"|"get"|"docs")`88 - Create a new model -> `modifyDataModel` (compatibility name; create-only)89904. **Publish carefully**91 - Prefer creating with unpublished or draft-like intent first.92 - Publish only after checking field names, required constraints, and relationship directions.9394## Mermaid generation rules9596### Naming9798- Class names -> PascalCase99- Field names -> camelCase100- Convert Chinese business descriptions into clear English identifiers101- Keep enum values human-readable when needed102103### Type mapping104105| Business meaning | Mermaid type |106| --- | --- |107| text | `string` |108| number | `number` |109| boolean | `boolean` |110| enum | `x-enum` |111| email | `email` |112| phone | `phone` |113| URL | `url` |114| image | `x-image` |115| file | `x-file` |116| rich text | `x-rtf` |117| date | `date` |118| datetime | `datetime` |119| region | `x-area-code` |120| location | `x-location` |121| array | `string[]` or another explicit array type |122123### Required structure conventions124125- Use `required()` only for fields the user explicitly marks as required.126- Use `unique()` only for explicit uniqueness needs.127- Use `display_field()` for the human-facing label field.128- Add concise `<<description>>` notes to important fields.129- Keep relationship labels tied to actual field names rather than vague business prose.130131## Minimal example132133```mermaid134classDiagram135 class User {136 username: string <<Username>>137 email: email <<Email>>138 display_field() "username"139 required() ["username", "email"]140 unique() ["username", "email"]141 }142143 class Order {144 orderNo: string <<Order Number>>145 totalAmount: number <<Total Amount>>146 userId: string <<User ID>>147 display_field() "orderNo"148 unique() ["orderNo"]149 }150151 Order "n" --> "1" User : userId152153 %% Class naming154 note for User "用户"155 note for Order "订单"156```157158## Tool usage guidance159160### Read existing models161162Use this before creating related models, checking naming consistency, or assessing how an existing model is defined:163164- `manageDataModel(action="list")`165- `manageDataModel(action="get", name="ModelName")`166- `manageDataModel(action="docs", name="ModelName")`167168### Create model169170Use `modifyDataModel` with:171172- a complete `mermaidDiagram`173- `action="create"` when you want to create new models174- a deliberate publish decision175- clear awareness that updating existing model structures is not currently supported by this tool176177## Best practices1781791. Prefer direct SQL unless the user clearly benefits from model-first design.1802. Keep the first model iteration small and reviewable.1813. Separate business entities from implementation-only helper fields.1824. Validate relationship direction and ownership before publishing.1835. After modeling, hand off actual MySQL SQL/table work to `relational-database-mcp-cloudbase` when needed. For PostgreSQL / CloudBase PG tables, hand off to `postgresql-development-cloudbase` instead.