databricks-metric-views — Claude Code skill
This skill writes governed business metrics as YAML and checks whether a given measure belongs in a metric view at all.
npx skills add databricks/databricks-agent-skills --skill databricks-metric-views -a claude-codeWhat databricks-metric-views does
The workflow starts with profiling your schema and ends with a deployable definition. Bundled references cover the YAML spec and its patterns, SQL written against a metric view through MEASURE(), and the design rules for feeding metrics to Genie. There is also a decision gate: measures that shift with the user's filter, aggregate a per-entity result, or converge iteratively should become a governed Unity Catalog SQL function instead of a metric view.
Requirements are concrete. You need the Databricks CLI at version 1.0.0 or higher, a SQL warehouse you can use, SELECT on the source tables, and CREATE TABLE plus USE SCHEMA in the target schema. YAML version 1.1 needs Databricks Runtime 17.2+, while synonyms, display_name and format need 17.3+. No CLI, no skill.
Because Declarative Automation Bundles have no native metric-view resource, the skill shows how to commit the full SQL definition and apply it through a bundle-managed SQL job. That keeps the definition in version control while dashboards, Genie and ad-hoc SQL all read the same numbers.
What it helps with
- write revenue and order-count measures as YAML with separate dimensions
- build a KPI layer shared by dashboards, Genie and SQL queries
- define window measures such as moving averages and year-to-date totals
- decide whether a measure can live in a metric view or needs a SQL function
- keep a metric view definition in git and deploy it via a bundle
Example prompts for the agent
- Write a metric view for revenue and order counts over the
main.salesschema. - Check whether conversion rate works as a metric view or needs a governed SQL function.
- Give me a SQL query against the metric view using
MEASURE(), grouped by month.
How to install databricks-metric-views
1Skills CLI (Vercel)
npx skills add databricks/databricks-agent-skills --skill databricks-metric-views -a claude-code2Manually: put the files in place
~/.claude/skills/databricks-metric-views/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/databricks-metric-views/
1Skills CLI (Vercel)
npx skills add databricks/databricks-agent-skills --skill databricks-metric-views -a codex2Manually: put the files in place
.agents/skills/databricks-metric-views/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add databricks/databricks-agent-skills --skill databricks-metric-views -a cursor2Manually: put the files in place
.cursor/skills/databricks-metric-views/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install databricks/databricks-agent-skills databricks-metric-views2Manually: put the files in place
.github/skills/databricks-metric-views/SKILL.md1Skills CLI (Vercel)
npx skills add databricks/databricks-agent-skills --skill databricks-metric-views -a gemini-cli2Platform CLI
gemini skills install https://github.com/databricks/databricks-agent-skills --path skills/databricks-metric-viewsManually: put the files in place
.devin/skills/databricks-metric-views/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add databricks/databricks-agent-skills --skill databricks-metric-views -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about databricks-metric-views
How do I install databricks-metric-views in Claude Code?
Run npx skills add databricks/databricks-agent-skills --skill databricks-metric-views -a claude-code. The skill lands at ~/.claude/skills/databricks-metric-views/SKILL.md.
What does databricks-metric-views do?
It helps you define Unity Catalog business metrics in YAML — measures, dimensions, window calculations — and flags measures that do not fit a metric view and belong in a SQL function.
What do I need before using it?
The Databricks CLI at version 1.0.0 or higher, a SQL warehouse with CAN USE, and rights on the source and target tables. YAML version 1.1 requires Databricks Runtime 17.2+, and semantic metadata requires 17.3+.