$npx -y skills add TencentCloudBase/cloudbase-skills --skill data-model-creation[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/managePgDat
| 1 | ## Standalone Install Note |
| 2 | |
| 3 | If this environment only installed the current skill, start from the CloudBase main entry and use the published `cloudbase/references/...` paths for sibling skills. |
| 4 | |
| 5 | - CloudBase main entry: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/SKILL.md` |
| 6 | - Current skill raw source: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/data-model-creation/SKILL.md` |
| 7 | |
| 8 | Keep local `references/...` paths for files that ship with the current skill directory. When this file points to a sibling skill such as `auth-tool` or `web-development`, use the standalone fallback URL shown next to that reference. |
| 9 | |
| 10 | # Data Model Creation |
| 11 | |
| 12 | ## Activation Contract |
| 13 | |
| 14 | ### Use this first when |
| 15 | |
| 16 | - The user explicitly wants Mermaid `classDiagram` modeling. |
| 17 | - The task needs complex multi-entity relational design, visual ER-style output, or generated data-model structure rather than direct SQL. |
| 18 | - 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. |
| 19 | |
| 20 | ### Read before writing code if |
| 21 | |
| 22 | - The request mentions data model, ER diagram, Mermaid, relationship graph, or enterprise schema design. |
| 23 | - The user wants to reuse or update an existing published model. |
| 24 | |
| 25 | ### Then also read |
| 26 | |
| 27 | - Direct MySQL SQL creation or schema change -> `../relational-database-tool/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/relational-database-tool/SKILL.md`) |
| 28 | - PostgreSQL / CloudBase PG schema work -> `../postgresql-development/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/postgresql-development/SKILL.md`) |
| 29 | - Broader feature planning before schema work -> `../spec-workflow/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/spec-workflow/SKILL.md`) |
| 30 | |
| 31 | ### Do NOT use for |
| 32 | |
| 33 | - Simple `CREATE TABLE`, `ALTER TABLE`, or CRUD tasks. |
| 34 | - Document-database collection design. |
| 35 | - Frontend-only data-shape discussions with no modeling requirement. |
| 36 | |
| 37 | ### Common mistakes / gotchas |
| 38 | |
| 39 | - Using Mermaid modeling for a task that only needs one or two SQL statements. |
| 40 | - Mixing SQL-table design and NoSQL collection design in the same model. |
| 41 | - Generating diagrams without first deciding entity boundaries and ownership relations. |
| 42 | - Publishing a new model before validating the generated fields and relationships. |
| 43 | |
| 44 | ### Minimal checklist |
| 45 | |
| 46 | - Confirm Mermaid modeling is actually needed. |
| 47 | - List the core entities and relationships first. |
| 48 | - Decide whether this is a new model or an update. |
| 49 | - Keep the initial model small unless the user explicitly wants a large enterprise schema. |
| 50 | |
| 51 | ## Overview |
| 52 | |
| 53 | This skill is an **advanced modeling path**, not the default path for database work. |
| 54 | |
| 55 | - For most MySQL database tasks, use `relational-database-tool` and write SQL directly. If the task says PostgreSQL, CloudBase PG, PG mode, `app.rdb()`, `queryPgDatabase`, `managePgDatabase`, or RLS, use `postgresql-development` instead. |
| 56 | - Use this skill only when diagram-driven modeling adds value. |
| 57 | |
| 58 | ## Quick routing |
| 59 | |
| 60 | ### Use `relational-database-tool` instead when |
| 61 | |
| 62 | - You need MySQL `CREATE TABLE`, `ALTER TABLE`, `INSERT`, `UPDATE`, `DELETE`, or `SELECT` |
| 63 | - The schema is small and already clear |
| 64 | - The user never asked for a visual model |
| 65 | - The task does **not** mention PostgreSQL / CloudBase PG / PG mode / `app.rdb()` / `queryPgDatabase` / `managePgDatabase` / RLS |
| 66 | |
| 67 | ### Use this skill when |
| 68 | |
| 69 | - You need multi-entity relationship modeling |
| 70 | - You need Mermaid `classDiagram` output |
| 71 | - You want generated model structure and documentation |
| 72 | - You need a clean modeling pass before SQL implementation |
| 73 | |
| 74 | ## How to use this skill (for a coding agent) |
| 75 | |
| 76 | 1. **Clarify the entity set** |
| 77 | - Extract business entities, ownership, and relationship cardinality from the request. |
| 78 | - Prefer 3-5 core entities unless the user clearly asks for more. |
| 79 | |
| 80 | 2. **Model first, then generate** |
| 81 | - Draft Mermaid `classDiagram` content. |
| 82 | - Validate names, field types, and relationships before calling modeling tools. |
| 83 | |
| 84 | 3. **Use the right tools** |
| 85 | - Read/list existing models -> `manageDataModel(action="list"|"get"|"docs")` |
| 86 | - Create a new model -> `modifyDataModel` (compatibility name; create-only) |
| 87 | |
| 88 | 4. **Publish carefully** |
| 89 | - Prefer creating with unpublished or draft-like i |