Skip to main content
skill CX Codex

data-model-creation — Claude Code skill: setup and features

Designs multi-entity relational schemas using Mermaid class diagrams for Tencent CloudBase. Useful when you need visual modeling before generating database tables.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add TencentCloudBase/skills --skill data-model-creation -a claude-code
Open on GitHub

What data-model-creation does

This skill turns business entities and relationships into Mermaid classDiagram specifications. It uses CloudBase-specific data types like x-enum, x-file, or x-rtf, sets constraints, and calls manageDataModel or modifyDataModel to register the schema.

The author marked this skill as deprecated. Direct MySQL schema updates work better with relational-database-tool, while PostgreSQL or CloudBase PG environments should use DDL scripts through postgresql-development. Also, modifyDataModel only handles new schema definitions; updating existing model structures is not supported.

Sibling CloudBase skills must be present on the local filesystem. The agent resolves them via relative local paths and must not fetch remote markdown files over HTTP.

What it helps with

  • design multi-entity database structures using Mermaid class diagrams
  • define CloudBase schema fields with specialized media and enum types
  • inspect existing data models using manageDataModel
  • validate entity relationships before writing direct SQL

Example prompts for the agent

  • Design an e-commerce schema with User and Order entities using a Mermaid classDiagram
  • Inspect published models with manageDataModel
  • Draft a multi-table structure for a blog system before generating DDL

How to install data-model-creation

1Skills CLI (Vercel)

npx skills add TencentCloudBase/skills --skill data-model-creation -a claude-code

2Manually: put the files in place

~/.claude/skills/data-model-creation/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/data-model-creation/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about data-model-creation

How to install data-model-creation in Claude Code?

Run npx skills add TencentCloudBase/skills --skill data-model-creation -a claude-code. The file will be placed at ~/.claude/skills/data-model-creation/SKILL.md.

What is data-model-creation used for?

It provides an ER-style modeling workflow to design CloudBase schemas through Mermaid diagrams before writing SQL.

Can this skill modify existing CloudBase data models?

No, the underlying modifyDataModel tool only supports creating new models. Modifying existing schema structures is not supported.

Source text

SKILL.md · MIT
---
name: data-model-creation
description: "[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."
version: 2.36.1
license: MIT
alwaysApply: false
metadata:
  priority: "5"
  deprecated: "true"
---

## 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)

1. **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.

2. **Model first, then generate**
   - Draft Mermaid `classDiagram` content.
   - Validate names, field types, and relationships before calling modeling tools.

3. **Use the right tools**
   - Read/list existing models -> `manageDataModel(action="list"|"get"|"docs")`
   - Create a new model -> `modifyDataModel` (compatibility name; create-only)

4. **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

```mermaid
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

1. Prefer direct SQL unless the user clearly benefits from model-first design.
2. Keep the first model iteration small and reviewable.
3. Separate business entities from implementation-only helper fields.
4. Validate relationship direction and ownership before publishing.
5. 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.

© TencentCloudBase · MIT · TencentCloudBase/skills

Similar skills

All skills for Data and databases →

From the same set20

cloud-functions Guides the agent through building, deploying and debugging CloudBase Event and HTTP Functions. Useful when you need your own runtime code, not platform API calls. CX Codex +1 1,200installs ai-model-wechat A skill for calling AI models in WeChat Mini Programs through wx.cloud.extend.AI. Useful when you add text generation to a mini app and don't want to guess the call shapes. CX Codex +1 1,100installs cloud-storage-web Lets the agent upload and manage CloudBase storage files from browser code with @cloudbase/js-sdk, including temporary download links. CX Codex +1 1,000installs auth-tool-cloudbase Readies CloudBase authentication before you write client code: checks providers, publishable keys and login methods. CX Codex +1 1,000installs ai-model-nodejs A skill that teaches the agent to call AI models from a Node.js backend through @cloudbase/node-sdk: text, images, cloud functions, CloudRun. CX Codex +1 998installs cloudrun-development Backend development rules for CloudBase Run: deploying services with long connections, VPC database access, and diagnosing container deploy failures. CX Codex +1 983installs http-api-cloudbase Guides coding agents through direct HTTP calls to Tencent CloudBase platform services. Useful for Python or Go backends, mobile apps, and scripts without official SDKs. CX Codex +1 977installs auth-nodejs-cloudbase A skill for configuring server-side identity, user lookup, and custom login tickets in CloudBase backend services with the Node.js SDK. CX Codex +1 960installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor