Build an initial analytics ontology or expand an existing Git-synced one. Evidence-backed definitions, user-defined domains, reviewable refactors and validation.
92%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
A semantic layer or BI model already declares metrics, joins and column docs that a person
wrote. ingest.py --declared <path> (repeatable, or --declared at intake) reads them, holds
every one against the schema export, and hands the survivors to the run as declared evidence.
Nothing from the layer is trusted on the way in.
--declared points at | Read by | Checked on |
|---|---|---|
A Power BI model saved as TMDL: the definition/ folder of a PBIP project's <name>.SemanticModel | adapters/semantic_layer.py, from_tmdl | The Snowflake TPC-H model in databricks-solutions/powerbi-on-databricks-migration-accelerator (samples-pbip/Snowflake.SemanticModel); the SQL warehouse model in RuiRomano/fabric-cli-powerbi-cicd-sample (SM_SalesSense.SemanticModel); and pbi-tools/sales-sample, whose tables read CSV files |
A dbt project using MetricFlow, in either spec: top-level semantic_models: and metrics: (classic), or semantic_model:, entities, dimensions and metrics on the dbt model itself (newer) | from_metricflow | dbt-labs/jaffle-sl-template (classic) and dbt-labs/jaffle-shop (newer) |
A Cube YAML data model (cubes:) | from_cube | The analytics model in tam159/next-role (analytics/cube/model) |
A LookML project (.lkml views and explores, refinements included) | from_lookml | Three projects over Google's public thelook_ecommerce data: bytecodeio/thelook_ecommerce, onesecondbefore/lookml-framework, looker-open-source/bqml_semantic_search_block |
| A declared-definitions JSON file, written by hand | load | the kit's own tests |
On the TPC-H model:
SUM(orders[o_totalprice]) becomes SUM(O_TOTALPRICE) on
TPCH_SF1.ORDERS). The other 25 filter through a related table, so they go to review.On the SQL warehouse model (Source{[Schema="raw",Item="sales"]}):
raw tables
its own notebook loads.UnitCost to ShippingCost and NetPrice to UnitCost in one
step, over a NetPrice an upstream query computes. So the model's "Total Unit Cost" is
rejected as computed in the model rather than mapped to a warehouse column, along with
every measure over a column the M adds.On the sales sample:
On the MetricFlow template (classic spec):
On jaffle-shop (newer spec):
On the three LookML projects, held against thelook_ecommerce's columns:
view: +orders) adds its
measure to the view it refines.On the Cube model:
quantile(0.5)(x), which does not parse as
standard SQL.A Power BI .pbix file is a compressed binary, so it is not read. Save the model as a PBIP
project, which writes TMDL, and point --declared at its definition/ folder.
A Power BI table is whatever its Power Query (M) source returns, so it maps to a warehouse table only through that source.
{[Name="TPCH_SF1",Kind="Schema"]} then {[Name="ORDERS",Kind="Table"]}
(Snowflake), or {[Schema="raw",Item="sales"]} (SQL Server, Fabric, PostgreSQL). A source
that starts from a shared query is followed into that query.Table.AddColumn) is not a
warehouse column, so a measure over it is rejected.Table.SelectRows) is recorded as a rule on that
table's population. The enrichment packet for the table states it, and no metric carries it.Both write SQL already, so their metrics ship as translated: false.
a / NULLIF(b, 0). A foreign entity joins the model whose primary entity it
names.{CUBE}. prefixes are dropped, its
filters become the metric's filter, and a number measure resolves its {measure}
references when none of them carries a filter. A join condition between two table cubes
becomes a join with its relationship.sql_table_name, or to the view's own name when it has
none. ${TABLE}. prefixes and ${dimension} references resolve to SQL. A measure's
filters become its filter: "yes"/"no" on a yes/no dimension, a value, -value, a
list, or a numeric comparison. A number measure resolves its ${measure} references when
none of them carries a filter. An explore's sql_on between two fields of two table views
becomes a join with its relationship.The kit translates DAX mechanically when the result is one aggregate over one table:
SUM, AVERAGE, MIN, MAX, COUNT, DISTINCTCOUNT over a column;COUNTROWS of a table;SUMX, AVERAGEX, MINX, MAXX over arithmetic on one table's columns;CALCULATE with filters on the same table;DIVIDE, and arithmetic between measures on the same table.The SQL is the kit's, not the owner's. A translated metric carries translated: true and its
DAX, never counts as the owner's text, and in METRICS-REVIEW.md it cannot reach ok on the
translation alone.
These go to review with their DAX, and none of them becomes a metric:
SAMEPERIODLASTYEAR, TOTALYTD, DATESINPERIOD and the rest);ALL, REMOVEFILTERS, USERELATIONSHIP, FILTER);VAR/RETURN blocks;METRICS-REVIEW.md lists them under "Declared definitions that are not metrics yet".
The two readers produce this shape, and a file written by hand uses it too:
{
"source": "where the definitions came from",
"metrics": [{"name": "", "expression": "SUM(AMOUNT)", "table": "SCHEMA.TABLE",
"filters": "STATUS = 'completed'", "description": "",
"translated": false, "original_expression": "", "language": "sql",
"cite": "file:line"}],
"joins": [{"left": "SCHEMA.A", "right": "SCHEMA.B", "on": ["A_ID = ID"],
"relationship": "many_to_one", "cite": "file:line"}],
"columns": [{"table": "SCHEMA.TABLE", "column": "STATUS", "description": "",
"enum_values": ["completed", "cancelled"], "cite": "file:line"}],
"tables": [{"table": "SCHEMA.TABLE", "description": "", "cite": "file:line"}],
"review": [{"name": "", "original_expression": "", "language": "", "reason": "",
"cite": "file:line"}],
"populations": [{"table": "SCHEMA.TABLE", "rule": "", "cite": "file:line"}]
}ingest.py checks:
enum_values list, which must be text values.What holds goes to workspace/declared.json. What does not goes under rejects in the same
file, each with its reason. Ingest prints the first few. What holds then enters the run:
apply_synthesis.py writes them as metric files once the domain tree is applied, for every
metric whose table is modelled. It never overwrites a file, skips a metric already defined
with the same expression and filter, and records the source, citation and any DAX under
declared, which emit.py moves to emit/provenance.json.declared.enum_values.description_source: semantic_layer. They rank below the repo's doc blocks and the warehouse comments, and above
a glossary..claude-plugin
.cursor-plugin
.tessl-plugin
adapters
skills
ontology-expansion
references
templates
tests
fixtures
dbt-roundtrip
models
expansion