skills/designing-semantic-model/SKILL.md
Use when the user asks to "design a Fabric semantic model", "create a TMDL model", "build a Fabric star schema", "convert dbt to TMDL", "scaffold a Fabric tabular model", "set up a Fabric dataset", "create a Power BI semantic model", or needs guidance on Microsoft Fabric TMDL file structure, naming conventions, DirectLake configuration, or Fabric semantic model architecture best practices. This skill is specifically for Microsoft Fabric and Power BI semantic models, not general data modeling.
npx skillsauth add accelerate-data/fabric-semantic-model designing-semantic-modelInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Guide the design and generation of Microsoft Fabric semantic models using TMDL (Tabular Model Definition Language).
Always start by scanning the working directory for a dbt project. Look for:
dbt_project.yml — confirms a dbt project existsmodels/ directory — contains model SQL filesmodels/**/schema.yml or models/**/_schema.yml — column definitions, descriptions, teststarget/manifest.json — compiled metadata (if available)If a dbt project is found, use it as the primary source. Fall back to the powerbi-remote MCP or user-provided schema only if no dbt project exists.
dbt_project.yml
models/
├── staging/ # stg_* models — SKIP these
│ ├── _sources.yml
│ └── stg_*.sql
├── intermediate/ # int_* models — SKIP these
│ └── int_*.sql
└── marts/ # fct_* and dim_* models — USE these
├── _schema.yml # Column descriptions, tests, relationships
├── fct_*.sql
└── dim_*.sql
fct_*, dim_*, mart_* — final consumption-layer modelsstg_*, int_*, base_* — transformation-layer models not meant for reportingdim_date, dim_calendar, or similar — this becomes the Calendar tableTMDL is a text-based, human-readable format for defining tabular semantic models. It uses indentation-based syntax (similar to YAML) and maps 1:1 to the Tabular Object Model (TOM).
Every TMDL model follows this layout:
model-name/
├── database.tmdl # Database name and compatibility level
├── model.tmdl # Model config, culture, ref ordering
├── relationships.tmdl # All inter-table relationships
├── expressions.tmdl # Shared M expressions / parameters
├── tables/
│ ├── Sales.tmdl # One file per table (columns, measures, partitions)
│ ├── Product.tmdl
│ └── Calendar.tmdl
├── roles/
│ └── RegionalManager.tmdl # One file per RLS role
└── perspectives/
└── ExecutiveSummary.tmdl # One file per perspective
objectType 'Object Name' (quote names with spaces/special chars using single quotes)propertyName: value (colon delimiter)= expression (equals delimiter)/// triple-slash above the object declarationtrue (e.g., isHidden means isHidden: true)ref table TableName defines collection orderingValid column data types: string, int64, double, dateTime, decimal, boolean, binary
Sales, Inventory, OrdersProduct, Customer, DateFor Fabric Lakehouse/Warehouse sources, use DirectLake mode:
table Sales
partition 'Sales-Partition' = entity
mode: directLake
source
entityName: sales
schemaName: dbo
expressionSource: DatabaseQuery
The entityName maps to the dbt model's materialized table name in the lakehouse (typically the model name, e.g., fct_sales). The expressionSource references a named expression in expressions.tmdl that defines the SQL endpoint connection.
| Element | Convention | Example |
|---------|-----------|---------|
| Tables | PascalCase, singular | Product, SalesOrder |
| Columns | PascalCase with spaces | Product Name, Order Date |
| Measures | Business-friendly, descriptive | Total Revenue, Sales Amount YTD |
| Key columns | End with Key or ID, hidden | Product Key (isHidden) |
| Display folders | Logical groupings | Revenue, Margins, Time Intelligence |
| Roles | Descriptive business names | Regional Sales Manager |
dbt uses snake_case. Always transform to the TMDL convention above. The sourceColumn property keeps the original dbt/database column name; the TMDL column name is the user-facing display name.
dbt_project.yml to get the project name (used as the semantic model name)models/marts/ (or equivalent mart layer)fct_* and dim_* model, extract: model name, description, columns with names/types/descriptions, tests (unique, not_null, relationships)target/manifest.json exists, use it for compiled column types and dependency graphdescription → TMDL table /// descriptiondescription → TMDL column /// descriptionrelationships tests → TMDL relationships (the model with the test is the many-side)unique + not_null tests → confirms a column is a valid key (isKey)snake_case) → TMDL display names (PascalCase With Spaces), with sourceColumn keeping the originalfct_, dim_) → stripped for clean business names (fct_sales → Sales)See references/dbt-to-tmdl.md for the complete mapping reference.
Create the standard folder layout. Generate database.tmdl, model.tmdl, table files with DirectLake partitions pointing to the dbt model names as entityName, and relationships.tmdl from dbt relationship tests.
Add basic measures to fact tables: row count, SUM for numeric amount/quantity columns. If a date dimension exists, suggest time intelligence measures.
Report: number of tables (fact vs dimension), relationships, measures, file paths created, and recommended next steps.
Read these reference files for detailed guidance:
references/tmdl-syntax.md — Complete TMDL syntax reference with examples for every object typereferences/star-schema-patterns.md — Common star schema patterns for different industriesreferences/dbt-to-tmdl.md — Mapping guide from dbt models/YAML to TMDLdevelopment
Use when the user asks to "validate my semantic model", "check my TMDL", "review my Fabric model", "audit my Power BI model", "run best practice checks", "lint my TMDL", or wants to verify correctness, naming conventions, relationship integrity, measure quality, or performance of a Microsoft Fabric semantic model. This skill validates TMDL files against Fabric best practices.
development
Use when the user asks to "write a DAX measure", "create DAX calculations", "add time intelligence", "calculate YTD", "year over year", "running total", "semi-additive measure", "parent-child hierarchy", "ABC classification", "new and returning customers", "dynamic segmentation", "currency conversion", "ranking", "cumulative total", "budget allocation", or any DAX formula authoring for a Microsoft Fabric or Power BI semantic model. This skill provides DAX patterns specifically formatted as TMDL for Fabric semantic models.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.