| name | skill-creator |
| description | Create a new business domain Semantic Model skill (YAML) for DataTalk. Triggered when the user asks to define business metrics, create a semantic model for a new domain, or build a skill for a specific business area. 当用户要求为业务域创建语义模型、定义业务指标、或创建新技能时使用。forked_from: anthropics/skills@<upstream-sha-pending> |
Skill Creator for DataTalk
Purpose
Create business domain Semantic Model YAML skills for DataTalk. Each skill represents a business domain (e.g., orders, subscriptions, users) with entities, dimensions, measures, metrics, and literal mappings.
Output Channel
All skill output MUST go through datatalk_skill_create — never use Write or file-system tools directly. This ensures the model goes to pending/ for user review before becoming active.
Semantic Model YAML Schema
The output is a YAML document following the DataTalk Semantic Model DSL (dbt MetricFlow subset + DataTalk extensions):
name: <domain-name>
version: 1
description: <string>
last_modified: <ISO8601>
authored_by: ai_inferred
entities:
- name: <entity-name>
type: primary
physical:
database: <db>
schema: <schema>
table: <table>
primary_key: [<col>, ...]
foreign_keys:
- column: <col>
ref: <entity>.<col>
description: <string>
dimensions:
- name: <dim-name>
entity: <entity-name>
expr: <sql-expression>
type: categorical
time_granularity: day
label_zh: <中文标签>
label_en: <English Label>
description: <string>
measures:
- name: <measure-name>
entity: <entity-name>
agg: sum
expr: <sql-expression>
filter: <sql-where>
label_zh: <中文标签>
label_en: <English Label>
description: <string>
metrics:
- name: <metric-name>
type: ratio
numerator: <measure-name>
denominator: <measure-name>
base: <measure-or-metric>
time_offset: <duration>
label_zh: <中文标签>
label_en: <English Label>
description: <string>
literal_mappings:
<dimension-name>:
<natural-value>: <db-value>
Workflow
- Understand the domain: Ask the user which business area they want to model, or infer from schema exploration
- Explore the schema: Use
datatalk_read_schema to discover tables, columns, and relationships
- Draft the model: Write YAML with entities, dimensions, measures, metrics
- Submit via
datatalk_skill_create: Call the action with name and yaml_text. The backend writes to pending/ for user review
Rules
- domain name must match
^[a-z][a-z0-9_]{0,63}$
- Every dimension/measure/metric MUST have both
label_zh and label_en
- Measure
entity and agg are required
- Entity
physical.table is required
- Metric type
ratio requires numerator + denominator
- Never modify existing model files directly — always use
datatalk_semantic_propose_change for modifications