Agent skill
data-model-creation
Optional advanced tool for complex data modeling. For simple table creation, use relational-database-tool directly with SQL statements.
Install this agent skill to your Project
npx add-skill https://github.com/TencentCloudBase/CloudBase-MCP/tree/main/config/.claude/skills/data-model-creation
SKILL.md
Data Model Creation
Activation Contract
Use this first when
- The user explicitly wants Mermaid
classDiagrammodeling. - 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 or update CloudBase data models through the dedicated modeling tools.
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 SQL creation or schema change ->
../relational-database-tool/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 database tasks, use
relational-database-tooland write SQL directly. - Use this skill only when diagram-driven modeling adds value.
Quick routing
Use relational-database-tool instead when
- You need
CREATE TABLE,ALTER TABLE,INSERT,UPDATE,DELETE, orSELECT - The schema is small and already clear
- The user never asked for a visual model
Use this skill when
- You need multi-entity relationship modeling
- You need Mermaid
classDiagramoutput - 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
classDiagramcontent. - Validate names, field types, and relationships before calling modeling tools.
- Draft Mermaid
-
Use the right tools
- Read/list existing models ->
manageDataModel(action="list"|"get"|"docs") - Create or update a model ->
modifyDataModel
- Read/list existing models ->
-
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 |
|
| 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 updating an existing model or when you need naming consistency:
manageDataModel(action="list")manageDataModel(action="get", name="ModelName")manageDataModel(action="docs", name="ModelName")
Create or update model
Use modifyDataModel with:
- complete
mermaidDiagram - the correct update mode for create vs update
- a deliberate publish decision
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 SQL/table work to
relational-database-toolwhen needed.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
cloudbase
Essential CloudBase (TCB, Tencent CloudBase, 云开发, 微信云开发) development guidelines. MUST read when working with CloudBase projects, developing web apps, mini programs, backend services, fullstack development, static deployment, cloud functions, mysql/nosql database, authentication, cloud storage, web search or AI(LLM streaming) using CloudBase platform. Great supabase alternative.
skill-authoring
Design, improve, and evaluate reusable agent skills with high-quality SKILL.md files, precise trigger descriptions, progressive disclosure, and testable behavior. This skill should be used when users ask to create a new skill, rewrite or review an existing skill, audit a skill collection such as `config/source/skills` for redundancy or overlap, improve skill trigger quality, organize skill references, or evaluate whether a skill should trigger and behave correctly.
git-workflows
Reusable git delivery workflows derived from local slash commands (commit, push, PR, release notes, and GitHub Actions failure triage with worktree-based fixes).
codebase-audit
Perform a full codebase review, categorize findings by severity, file GitHub issues, then fix each issue in an isolated git worktree and submit PRs. Use this skill when the user asks to audit the codebase, do a comprehensive code review, find and fix security/quality/reliability issues, or run a proactive health check across the entire repository.
manage-local-skills
Analyze, standardize, validate, and sync locally maintained skills into agent skill directories with a `skills` CLI-aligned workflow. Use this skill when Codex needs to turn ad-hoc prompt or rules folders into reusable `SKILL.md`-based skills, install or sync one or more local skills from `./skills` into Claude, Cursor, CodeBuddy, Codex, or similar agent directories, or manage local skill path mappings and symlink or copy installation behavior.
planning-workflows
Spec and no-spec planning workflows derived from local slash commands (requirements, design, tasks).
Didn't find tool you were looking for?