用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/GeorgeDoors888/GB-Power-Market-JJ --skill nocobase-data-modeling命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
超级简历 WonderCV 出品,3000 万用户信赖。简历分析、段落改写、JD 岗位匹配、自动匹配职位、PDF 导出、AI 求职导师(面试准备/薪资谈判/职业规划/多版本简历策略)。 触发条件:用户提供简历、要求简历点评/打分/反馈、希望改写某个简历部分、 希望将简历与岗位 JD 匹配、咨询求职建议或面试准备,或提到 CV/简历/求职。 不触发条件:用户讨论普通写作(非简历)、询问其他文档, 或讨论与求职和职业发展无关的话题。
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
调用久吾智能体API进行文本或文件分析处理。支持两种调用方式:(1) 文本内容分析 - 传入name(智能体名称)、docno(文档编号)、content(文本内容);(2) 文件分析 - 传入name、docno和files(文件列表)进行智能评审。适用于合同评审、需求评审、文档审查等场景。当用户要求评审合同、分析条款、审查文档、需求评审、合同条款分析、或需要对文本和文件进行AI智能分析时触发。
基于 SOC 职业分类
正在显示 SKILL.md
| name | nocobase-data-modeling |
| description | Guide AI to build NocoBase data models — tables, fields, relations, and seed data |
| triggers | ["建模","创建表","数据表","字段","关系","collection","data model","create table"] |
| tools | ["nb_execute_sql","nb_setup_collection","nb_register_collection","nb_sync_fields","nb_upgrade_field","nb_create_relation","nb_list_collections","nb_list_fields"] |
You are guiding the user to create data models in NocoBase. Follow this exact workflow.
NocoBase uses a hybrid approach — SQL for bulk column creation (fast), API for metadata management (interface/UI config).
Why not pure API? Creating fields one-by-one via API is slow and has quirks. SQL CREATE TABLE creates all columns in one shot, then syncFields imports them into NocoBase.
For maximum efficiency, use the batch tools:
nb_execute_sql("CREATE TABLE IF NOT EXISTS nb_crm_customers (...); CREATE TABLE IF NOT EXISTS nb_crm_contacts (...); ...")
Put all tables in a single SQL statement. This is much faster than creating them one by one.
nb_setup_collection("nb_crm_customers", "客户",
'{"status":{"interface":"select","enum":[{"value":"潜在","label":"潜在","color":"default"},{"value":"已签约","label":"已签约","color":"green"}]},"phone":{"interface":"phone"},"email":{"interface":"email"},"description":{"interface":"textarea"}}',
'[{"field":"contacts","type":"o2m","target":"nb_crm_contacts","foreign_key":"customer_id"},{"field":"opportunities","type":"o2m","target":"nb_crm_opportunities","foreign_key":"customer_id"}]')
This single call does: register → create system fields → sync → upgrade ALL field interfaces → create ALL relations. One call per table instead of 10+.
IMPORTANT: Process tables in dependency order — parent tables first (those referenced by FK), then child tables.
Use individual tools when you need fine-grained control:
nb_{module}_{entity} (e.g. nb_pm_projects)Use nb_execute_sql to create tables with all columns:
CREATE TABLE IF NOT EXISTS nb_pm_projects (
id BIGSERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
code VARCHAR(50),
status VARCHAR(50) DEFAULT '草稿',
priority VARCHAR(20) DEFAULT '中',
description TEXT,
start_date DATE,
budget NUMERIC(12,2),
sort INTEGER DEFAULT 0,
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
);
Rules:
id BIGSERIAL PRIMARY KEYVARCHAR for enum-like fields (will upgrade to select later)NUMERIC(p,s) for money/decimalDATE for date-only, TIMESTAMPTZ for datetimeTEXT for long contentsort INTEGER DEFAULT 0 if ordering is neededcreated_at, updated_at, created_by_id, updated_by_id columns in SQL — they are created via API in Step 4Use nb_register_collection for each table:
nb_register_collection("nb_pm_projects", "Projects")
nb_register_collection("nb_pm_categories", "Categories", tree="adjacency-list")
tree="adjacency-list" for parent-child hierarchiesUse nb_sync_fields to import DB columns + create system fields:
nb_sync_fields(collection="nb_pm_projects")
This does two things:
syncFields to import all DB columnsCRITICAL: System fields (createdBy/updatedBy) MUST be created via API because they auto-generate FK columns. Creating them via SQL breaks the config.
Use nb_upgrade_field to change fields from default 'input' to correct types:
nb_upgrade_field("nb_pm_projects", "status", "select",
enum='[{"value":"active","label":"Active"},{"value":"done","label":"Done"}]')
nb_upgrade_field("nb_pm_projects", "start_date", "date")
nb_upgrade_field("nb_pm_projects", "budget", "number", precision=2)
nb_upgrade_field("nb_pm_projects", "description", "textarea")
Common interfaces:
| Interface | Use for |
|---|---|
input | Short text (default) |
textarea | Long text |
select | Single choice (needs enum) |
multipleSelect | Multiple choice (needs enum) |
radioGroup | Radio buttons (needs enum) |
checkbox | Boolean toggle |
number | Decimal numbers |
integer | Whole numbers |
percent | Percentage |
date | Date only |
datetime | Date + time |
email | Email with validation |
phone | Phone number |
markdown | Markdown editor |
json | JSON editor |
sort | Drag-sort field |
Use nb_create_relation for associations:
nb_create_relation("nb_pm_tasks", "project", "m2o", "nb_pm_projects", "project_id", label="name")
nb_create_relation("nb_pm_projects", "tasks", "o2m", "nb_pm_tasks", "project_id")
Relation types:
m2o (belongsTo): Task belongs to a Project. FK column on the source table.o2m (hasMany): Project has many Tasks. FK column on the target table.m2m (belongsToMany): Needs through, other_key params.o2o (hasOne): One-to-one.Rule: The FK column (e.g. project_id) must exist in the DB table. Create it in Step 2.
Use nb_execute_sql to insert initial data:
INSERT INTO nb_pm_categories (name, code, sort) VALUES
('Development', 'DEV', 1),
('Design', 'DSN', 2),
('Marketing', 'MKT', 3);
Seed data tips:
enum options defined in Step 5After completing all steps:
nb_list_collections(filter="nb_pm_") — verify all tables registerednb_list_fields("nb_pm_projects") — verify fields have correct interfacesnb_upgrade_field("orders", "status", "select",
enum='[{"value":"pending","label":"Pending","color":"gold"},{"value":"completed","label":"Completed","color":"green"},{"value":"cancelled","label":"Cancelled","color":"red"}]')
Enum JSON format: Each option is {"value":"x","label":"x","color":"colorName"}. Color names: red, green, blue, orange, gold, purple, cyan, grey, default. Value and label are usually the same for Chinese apps.
nb_upgrade_field("products", "tags", "multipleSelect",
enum='[{"value":"hot","label":"Hot","color":"red"},{"value":"new","label":"New","color":"blue"}]')
nb_upgrade_field only updates the field's NocoBase metadata (interface, uiSchema). It does NOT alter the database column. The DB column stays VARCHAR — NocoBase handles enum display in the UI layer.
CREATE TABLE nb_pm_categories (
id BIGSERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
parent_id BIGINT REFERENCES nb_pm_categories(id),
sort INTEGER DEFAULT 0
);
nb_register_collection("nb_pm_categories", "Categories", tree="adjacency-list")
Create all SQL tables first, register all, then sync once, then upgrade all. This is more efficient than processing one table at a time.
Running nb_upgrade_field on an already-upgraded field is safe — it will detect the current interface matches and skip. Use this when you need to fix enum options or add colors to existing select fields.