semantic-layer
Skill3 starsChanged 31 days agoMITView on GitHub
Implements or reviews MetricFlow and dbt semantic-layer artifacts when that stack is detected in the repository. Use for semantic models, entities, dimensions, measures, metrics, or saved queries after a canonical metric contract exists; it does not introduce dbt Semantic Layer into projects that do not already use it.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- JingHao-Leon/fde-case-labtheir own version, first seen Sep 13, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- JingHao-Leon/fde-case-lab★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository24 other files it gives its agents.
- analytics-requirementsSkill
- api-pipelineSkill
- bi-modelSkill
- build-modelSkill
- data-model-reviewSkill
- data-profileSkill
- data-quality-investigationSkill
- dbt-healthSkill
- explain-data-codeSkill
- freshness-investigationSkill
- incremental-modelSkill
- metric-definitionSkill
- migration-planSkill
- model-documentationSkill
- model-testsSkill
- project-profileSkill
- pr-reviewSkill
- refactor-modelSkill
- rename-modelSkill
- source-setupSkill
- sql-reviewSkill
- trace-lineageSkill
- validate-dbtSkill
- yaml-maintenanceSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 9 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Use only when local repository evidence detects this stack.
- Distinctive: line 22
If no MetricFlow/dbt semantic layer is detected, report that fact and stop.
- Very specific: line 26
Default silently to Work mode.
- Very specific: line 36
Read .ae/exercise.json and .ae/project.yml when present.
- Distinctive: line 40
Treat conflicting or absent syntax evidence as an unknown.
- Distinctive: line 42
Search for duplicate metric names and calculations in dbt, semantic, and BI artifacts.
- Distinctive: line 52
Version fit: every property is supported by the repository's evidenced dbt/MetricFlow version.
- Distinctive: line 59
Use formal Evidence, Risk, Recommendation, and Verification findings with severity and confidence for reviews and material semantic risks.
- Distinctive: line 82
Search models, semantic artifacts, exposures, and BI files for duplicate definitions and downstream references.
- Distinctive: line 88
Never print profiles, credentials, compiled sensitive SQL, or sampled protected data.
- Distinctive: line 90
Do not claim runtime validity, data correctness, or availability from static semantic configuration.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- Generated by scripts/build_targets.py from src/skills. Edit the source and rebuild; changes made here are overwritten. -->Self-contained install.
<skill-dir>is the directory holding this file: substitute its absolute path in the commands below and run them from the repository root. Read<skill-dir>/references/operating-rules.mdbefore acting; it holds the toolkit's always-on rules, which this install cannot load on its own. This install has no safety hooks, so the approvals those rules describe rest on you and the agent rather than on an enforced gate.
Semantic Layer
Implement or review repository-native MetricFlow/dbt semantic artifacts. Business meaning comes from an approved metric contract, not from YAML.
First decision: is the definition settled?
Before writing a metric, search models, semantic YAML, analyses, BI files, and docs for existing calculations of it. If the request or an approved contract does not fix the definition and the repository holds more than one live candidate, return the candidates, where each is used, and how their values differ, then ask which one becomes official. No semantic file is written that turn. Choosing the candidate that is closest to existing semantic resources is still choosing for the requester.
When to use
- Review or author dbt semantic models, entities, dimensions, measures, metrics, and saved queries supported by the detected project version.
- Diagnose static definition, grain, join, time, or metric-contract mismatches in an existing MetricFlow/dbt stack.
- Use only when local repository evidence detects this stack.
- If no MetricFlow/dbt semantic layer is detected, report that fact and stop; do not introduce one or substitute another vendor.
Mode and prerequisites
Default silently to Work mode. Use Learn only when teaching is requested and Assessment only when evaluation without answers is requested or .ae/exercise.json requires it.
Require or mark missing:
- Canonical metric contract, owner, consumers, and acceptance cases.
- Project root, dbt version evidence, package/configuration files, and semantic artifact locations.
- Model grains, keys, relationships, time dimensions, measures, and downstream consumers.
Detection and convention procedure
- Read
.ae/exercise.jsonand.ae/project.ymlwhen present. - Build a current local inventory of
dbt_project.yml, dependency files, semantic YAML,manifest.json, andsemantic_manifest.json. An artifact not opened in this workflow is not evidence. - Detect MetricFlow/dbt use from repository configuration or existing semantic resources. File names or a generic
metricsdirectory alone are insufficient. - Infer resource syntax, property names, YAML placement, naming, entity types, time granularity, package boundaries, and version conventions from detected local files and version evidence.
- Treat conflicting or absent syntax evidence as an unknown. Never invent a schema based on a remembered dbt or MetricFlow release.
- Trace the canonical contract to physical models, confirming model grain, entity keys, relationships, time spine/time dimensions, measure aggregation, filters, and valid dimensions.
- Search for duplicate metric names and calculations in dbt, semantic, and BI artifacts. Report duplicate authority rather than reconciling it silently.
- Author the smallest repository-native artifact set or review the submitted set against the checks below.
Semantic checks
- Grain and entities: each semantic model has an evidenced row grain; entity roles and keys support intended joins.
- Measures: aggregation behavior, non-additive dimensions, units, nulls, and expression inputs match the contract.
- Metrics: type, inputs, filters, windows, offsets, time behavior, and zero-denominator handling match canonical semantics.
- Dimensions: types, valid values, time configuration, and exposure of sensitive attributes are intentional.
- Joins: entity paths do not permit fanout, ambiguous routes, or unintended many-to-many aggregation.
- Version fit: every property is supported by the repository's evidenced dbt/MetricFlow version.
- Consumers: saved queries and downstream BI references preserve filters, dimensions, and time semantics.
Evidence required
Cite each inspected file, resource name, model expression, contract clause, and artifact metadata used. Label compiled artifacts as stale or unmatched when recency cannot be established. Static configuration establishes intent, not successful parsing, queryability, or current warehouse values.
Use formal Evidence, Risk, Recommendation, and Verification findings with severity and confidence for reviews and material semantic risks. For straightforward implementation, report Changed, Why, Verified, and Remaining uncertainty.
Failure modes
- Introducing MetricFlow/dbt because a semantic layer sounds desirable.
- Translating an ambiguous KPI directly into semantic YAML.
- Assuming current syntax, defaults, supported metric types, or calendar behavior.
- Treating an entity declaration as proof of key uniqueness or join cardinality.
- Defining the same metric independently in semantic and BI layers.
- Claiming successful parsing or runtime results without current local evidence.
- Exposing protected dimensions through broadly accessible metrics or saved queries.
Output contract
For implementation, return # dbt Semantic Layer with: Changed; Why, including contract alignment and entities/joins; Verified; Remaining uncertainty. For a review, add evidence-backed findings, consumer impact, and material semantic risks.
For implementation, show the intended file paths and concise artifact content. For review, lead with supported findings ordered by severity. If the stack is not detected, return NOT DETECTED with the searched scope and do not produce speculative YAML.
Verification
- Compare every measure and metric field to the canonical contract and acceptance cases.
- Confirm resource names and properties against the detected local version and existing examples.
- Walk one normal join and one fanout or boundary scenario per critical metric.
- Search models, semantic artifacts, exposures, and BI files for duplicate definitions and downstream references.
- Propose exact targeted parse or semantic validation commands only as a user-run verification plan; do not execute them.
Safety and repository writes
- Local Basic only: use local files and user-provided material. Never call MCP, access a warehouse, execute dbt, install packages, or contact dbt services.
- Never print profiles, credentials, compiled sensitive SQL, or sampled protected data.
- Explicitly requested reversible artifact edits may proceed without a second approval. Preview and obtain approval before changing canonical metric meaning, access behavior, published contracts, deleting files, or expanding scope.
- Do not claim runtime validity, data correctness, or availability from static semantic configuration.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

