/omni-analytics:omni-model-builderfrom omni-analytics
Creates and edits Omni Analytics semantic model definitions (views, topics, dimensions, measures, relationships, query views, composite topics, aggregate tables) using YAML through the Omni CLI. Handles model modifications, field additions, joins, and branch promotion.
Ships in omni-analytics. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Create and modify Omni's semantic model through the YAML API — views, topics, dimensions, measures, relationships, and query views.
Use
omni-model-explorerfirst to understand the existing model.
omni config list # several profiles? ask the user which, then: omni config use <name>
omni whoami whoami # confirms auth and lists your permissions
omni update check -o json 2>/dev/null || true # updateAvailable: true? tell the user and share both upgrade commands
If
omniisn't installed, ask the user to install it (CLI README). On an auth error: a setOMNI_API_TOKENoverrides the profile, so retry once without it (env -u OMNI_API_TOKEN omni whoami whoami); otherwise followomni agent-help(Auth) to have the user sign in.
You need Modeler or Connection Admin permissions. Add -o json to any command to force structured output for parsing (default auto is human in a TTY, JSON when piped).
Omni composes a model from the schema layer (generated from the database), the shared model (governed fields, relationships, and topics), workbook models (ad hoc fields in one workbook), and branches, where shared-model changes are made before a merge: model-layers.md.
Before writing any SQL expression, look up the connection's dialect: find the model's connectionId with omni models list, then read its dialect from omni connections list (the connection name is not a reliable guide). omni models delete also trashes the workbooks, dashboards, and child extension models built on the model; confirm that with the user before running it. Commands, and creating a new SHARED model: sql-dialect.md.
When the database schema changes (new, deleted or renamed columns, type changes), refresh the schema layer with omni models refresh <modelId> (requires Connection Admin; --branch-id is required when the connection has branch-based schema refresh and rejected when it doesn't). When to run it, its side effects, the impact check for deleted or renamed columns, and connection errors: schema-refresh.md.
If the columns haven't changed but SQL field or view errors remain after their cause was fixed elsewhere, such as a warehouse grant, run omni models reparse <modelId> (CLI ≥ 1.6.0) on the shared model or shared extension.
Merging is a separate step that the user starts. Run omni models merge-branch, or any other merge, promote or ship to the shared model, only when the user has told you in this conversation to merge, ship, publish, promote or make it live. A "build", "add" or "model this" request is complete when the branch is created, written, validated and tested.
None of these is permission to merge:
When downstream content needs a field or view that isn't merged yet, use a branch-bound draft (omni-content-builder → branch-bound drafts). When a merge is needed, ask ("Ready for me to merge <branch> into the shared model?") and wait for an explicit yes. If a harness or permission layer blocks the merge, report it and ask; do not look for another way around it.
omni models list --model-id <sharedModelId> --include activeBranches. Someone else may have merged it; writes then fail with Branch does not exist, and drafts bound to it may already be published (check omni documents list-drafts <identifier>). If it was merged, diff your local YAML against the shared model and start a new branch for further changes.COUNT(*) vs COUNT(DISTINCT <key>) on every fact), implied units (value ÷ quantity per category, to catch a "hours" column that holds money), and where history starts (older records may need an opening balance). Ask the business owner what an ambiguous term ("fee type", "status") means before building on a guess.yaml-create, not create-field, update-field, update-view, update-topic or models update: they can report success without making the change.sql: in a child layer (extension, workbook model, branch) of a sql: query view; that layer then ignores changes to the parent's SQL. Before editing such a view, read --mode extension: a view-level sql: you didn't write is that copy. Tell the user, and remove it only with their OK.omni models --help # List all model operations
omni models yaml-create --help # Show flags for writing YAML
omni models yaml-create --schema # Print the body's JSON schema + a filled example (no token)
Always work in a branch — never write directly to production — and first check you can branch. Branching requires full-model access. Run
omni whoami whoami --model-id <modelId>:QUERY_FULL_MODELpresent → you can create a branch (andUPDATEpresent → you can merge/promote it, else open a PR / request a merge); absent → you can't branch — a one-off field belongs in the document's workbook model instead (omni-content-builder→ Updating a Dashboard's Model). Full permission→capability map:omni-admin→ Model Roles & Caller Access.
Hub-and-spoke: write to the model ID you were given.
omni models create-branch <modelId> --name "my-feature-branch"
The response model.id is your branchId — a UUID you'll pass to all subsequent API calls. To list existing branches at any time:
omni models list --include activeBranches
Shared extensions: pair the extension's ID with a branch from
omni models list --base-model-id <extensionId> --model-kind BRANCH, else the shared model's branch.
On a git-connected model, never hand-edit model YAML in git. Author through Omni on a branch and ship with
omni models commit(Step 3); Omni's next sync deletes model files that exist only in git. Files that aren't model content (OWNERS, CI config, docs) can be committed directly: git-connected-models.md.
omni models yaml-create <modelId> --body '{
"fileName": "my_new_view.view",
"yaml": "dimensions:\n order_id:\n primary_key: true\n status:\n label: Order Status\nmeasures:\n count:\n aggregate_type: count",
"mode": "combined",
"branchId": "{branchId}",
"commitMessage": "Add my_new_view with status dimension and count measure"
}'
Editing an existing file: read it whole with
--mode combined, write it whole with"mode": "combined", read it back in both modes. Exceptions:
"mode": "merged", on a branch only: forrelationships, to drop an override, and to expose a query view column the shared model ignores (Dimensions).- New file: either mode. Delete: empty
yaml,"mode": "extension", if inherited; elseyaml-delete --mode extension.extends: edit the combined read and add nothing the parent already provides (a key with the parent's value is stored as a duplicate); don't write fully-resolved content back.
fileNameis the exactyaml-getkey, folder prefix included; a mismatch silently creates a duplicate (inspect a branch).
On a dbt-connected model, omni models branch-dbt-get shows the dbt environment a branch compiles against: model-layers.md.
Every YAML write must be validated and tested before merging — a field can be valid YAML yet produce wrong results or broken queries.
# 1. Validate: a new is_warning:false issue in a file you changed blocks; fix it first
omni models validate <modelId> --branch-id <branchId>
# 2. Query the changed fields: no error, and cache_metadata.num_rows > 0 (there is no summary.row_count)
omni query run --body '{"query":{"modelId":"<modelId>","table":"your_view","fields":["your_view.new_dimension","your_view.new_measure"],"limit":10,"join_paths_from_topic_name":"your_topic"},"branchId":"<branchId>"}'
# 3. Read it back: the field is present, and not duplicated at a second path
omni models yaml-get <modelId> --file-name your_view.view --branch-id <branchId>
Spot-check that values look right (a sum isn't returning a count; booleans read true/false), and if a field references another view include fields from both to confirm the join resolves. Triage of errors that predate your change, join-path tests, natural-language validation and the full checklist: validation-and-testing.md.
Running totals, moving averages, period-over-period change, percent-of-total and ranks are table calculations on the query result:
omni-query→references/table-calculations.md. Model an in-warehouse field only when the window must span rows outside the result set.
Ask the user to confirm before shipping. Changes applied to the production model cannot be easily undone. Only ship after validation and testing pass (Step 2).
Check omni models git-get <modelId>: a git-connected model ships as a PR with omni models commit; otherwise merge in Omni with omni models merge-branch <modelId> <branchName>. Both paths: shipping-a-branch.md.
After either path, confirm new topics and views resolve against the production model (no --branch-id): list the views, get-topic the topic, validate, and run a query whose summary.missing_fields is []. If anything is missing, re-author it through Omni and never patch it by hand in git: post-merge-verification.md.
Model files are views (.view), topics (.topic), composite topics (.composite_topic) and the relationships file: model-layers.md. Writing and deleting: Step 1.
Every view that participates in joins MUST have a real
primary_key: truedimension. Without a row-unique primary key, queries that join to this view can produce fanout errors or incorrect aggregations. Use the table's natural unique identifier (e.g.,id,order_id,user_id). If no single column is unique, build a key dimension that concatenates row-level columns that are jointly unique, for examplesql: ${order_id} || '-' || ${line_number}; on dialects without implicit casts, such as BigQuery, cast non-string columns to strings first. If you cannot define a row-unique expression, do not mark a dimension asprimary_key: trueyet; fix the grain first or avoid joining the view until a real key exists. Why: troubleshooting.md.
dimensions:
order_id:
primary_key: true
status:
label: Order Status
created_at:
label: Created Date
measures:
count:
aggregate_type: count
total_revenue:
sql: ${sale_price}
aggregate_type: sum
format: currency_2
Your extension YAML can override a schema-layer field of the same name, and the field keeps its schema-layer type; when a column has no schema-layer base dimension yet, refresh the schema first. Examples and yaml-get --mode read-back: model-layers.md.
See modelParameters.md for the complete list of 35+ dimension parameters, format values, and timeframes.
Two gotchas: a raw column auto-maps by name (no sql: needed); there is no ${TABLE} construct — ${TABLE}.column errors Column "__omni_scoped" not found at validate/query time (reference fields via ${field}/${view.field}).
See references/modelParameters.md (24+ params, all 13 aggregate types) and references/yaml-filter-syntax.md (filter operators + measure-filter examples). Prefer a measure filters: block for filtered aggregates over CASE WHEN/WHERE in sql — keep sql focused on the value being aggregated.
Reach for a filter-only field when one user choice should change how a field is computed rather than which rows are kept: report by created date or shipped date, show revenue or order count in the same KPI, apply a threshold the viewer sets. Don't reach for it to hide or show fields (use topic fields:), to filter rows (an ordinary filter), or when the two variants deserve their own topics (see "new topic vs adding to"). Shapes, binding, validation: templated-filters.md.
Reach for an aggregate table when the same fact rollup is queried repeatedly at a coarser grain than the table (daily or monthly tiles over an event-level fact) and a pre-aggregated table exists or can be built. Declare it with a materialized_query block on a view, one per table, described against the base view; Omni reads it when a query fits and falls back to the fact table when not. Confirm with a planOnly query headed -- Query rewritten to use materialized view. Never map a window-function field (ROW_NUMBER, RANK, LAG, a running total) or a *_distinct_on measure, and never set limit or offset in materialized_query: each returns wrong results or stops Omni from using the table. Pin a table that holds part of the history to its dates, keep every row in the base view, and write date boundaries in model SQL as >= and <. Rules, filter pins, joined views, what not to declare and known issues: aggregate-awareness.md.
Reach for level_of_detail when a measure has to be computed at a grain other than the query's: a per-customer total on every order row (fixed:), a finer aggregate summarized up (always_include:), or an amount held at a coarser grain while finer dims are on the report (always_exclude:). Grain matching, the outer-aggregate rule, template reuse and verification: level-of-detail.md.
A field whose sql references another view breaks in any topic that doesn't join that view; where to define it instead: topic-scoped-definitions.md.
Before concluding a view doesn't exist, check the schemas yaml-get didn't load: troubleshooting.md.
Before writing a topic, confirm every view it references exists with
omni models yaml-get <modelId>, using the fallback above for a view in a schema that isn't loaded.
Adding to an existing topic is usually right when the request's base view matches its base view. Create a new topic when the subject (base view), always-applied constraints, or audience differ; ask the requestor when it is a judgment call, and build new topics on a branch. Criteria and key topic elements: writing-topics.md.
Topic default_filters, always_where_filters, and always_having_filters use the measure-filter condition syntax in yaml-filter-syntax.md; a docs-search tip is in writing-topics.md.
One query over two facts that share dimensions but no join, or one fact under two conditions: when to reach for a composite topic and when not to, authoring, and the query shape: composite-topics.md.
Global relationships are defined in the shared relationships file and are available across all topics. Use these for standard, reusable joins, and set relationship_type (many_to_one, one_to_many, one_to_one, many_to_many) to match the data, which prevents fanout. Example and when to use each type: global-relationships.md.
One-off joins and joining the same table more than once (one extends: alias per role), and the joins: entry the view also needs: topic-scoped-definitions.md · examples: topic-scoped-relationships.md.
A topic's views: block can set display_order, override labels, and add topic-only fields, aliases, and query views. Rules: topic-scoped-definitions.md · examples: topic-scoped-views.md.
A query view needs a primary key (primary_key: true on one dimension) or joins to it fan out; confirm which field is unique before writing unless the query makes it clear, and ask the user when they are unsure. Rules, including the FROM alias a sql: block with ${view.field} references needs: query-views.md · examples: query-view-examples.md.
Fixes for frequent validation errors (unknown view, no join path, duplicate field name, invalid YAML, fanout, column not found, a duplicate view at the repo root) and for a model out of sync with the database: troubleshooting.md.
Omni docs pages for each modeling topic: docs-links.md.
evals/evals.json (opens in a new tab)references/aggregate-awareness.md (opens in a new tab)references/composite-topics.md (opens in a new tab)references/docs-links.md (opens in a new tab)references/editing-existing-files.md (opens in a new tab)references/git-connected-models.md (opens in a new tab)references/global-relationships.md (opens in a new tab)references/level-of-detail.md (opens in a new tab)references/model-layers.md (opens in a new tab)references/modelParameters.md (opens in a new tab)references/post-merge-verification.md (opens in a new tab)references/query-view-examples.md (opens in a new tab)references/query-views.md (opens in a new tab)references/schema-refresh.md (opens in a new tab)references/shipping-a-branch.md (opens in a new tab)references/sql-dialect.md (opens in a new tab)references/templated-filters.md (opens in a new tab)references/topic-scoped-definitions.md (opens in a new tab)references/topic-scoped-relationships.md (opens in a new tab)references/topic-scoped-views.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub exploreomni/omni-agent-skills --plugin omni-analytics12 skills in this plugin
/omni-adminAdminister an Omni Analytics instance — manage connections, users, groups, user attributes, permissions, schedules, and schema refreshes via the Omni CLI. Use this skill whenever someone wants to manage users or groups, set up permissions on a dashboard or folder, configure user attributes, create or modify schedules, manage database connections, refresh a schema, set up access controls, provision users, or any variant of "add a user", "give access to", "set up permissions", "who has access", "configure connection", "refresh the schema", or "schedule a delivery"./omni-ai-evalEvaluate Omni AI accuracy using Omni's built-in eval system — define a prompt set, run a judged eval against a model (or branch), and read the accuracy-judge verdicts. Use this skill whenever someone wants to evaluate Omni AI, benchmark Blobby, run regression tests, compare AI output across branches or model-context changes, measure AI quality, run A/B tests on model changes, assess the impact of an ai_context or modeling change, or any variant of "run evals", "test Blobby", "benchmark query generation", "compare AI results", "regression test", "how accurate is the AI", or "measure the impact of my changes"./omni-ai-optimizerOptimize an Omni Analytics model for Blobby, the Omni Agent — configure ai_context, ai_fields, synonyms, sample_queries, and ai_settings. Use this skill whenever someone wants to improve AI accuracy in Omni, make Blobby smarter, add AI context or example questions, curate which fields the AI sees, personalize AI context by user attribute, diagnose context-window pruning or truncation, raise a topic's AI context budget, control which topics AI can reach, troubleshoot why Blobby gives wrong answers, or any variant of "make the AI better", "Blobby isn't answering correctly", "optimize for AI", or "teach the AI about our data"./omni-content-builderCreate, update, and manage Omni Analytics documents and dashboards programmatically — document lifecycle, drafts, tiles, visualizations, filters, controls, and layouts — using the Omni CLI. Use this skill whenever someone wants to build a dashboard, create a workbook or document, add tiles or charts, configure dashboard filters or controls, set up a KPI view, lay out or rearrange tiles and pages, edit a dashboard as a draft and publish it, change dashboard settings, rename/move/duplicate/delete a dashboard, modify dashboard-level model customizations like workbook-specific joins or fields, or build and edit an Omni app (custom HTML content in place of a dashboard) — including casual phrasings like "make a dashboard for…", "add a chart to…", or "clean up this dashboard's layout" that don't name the skill. Load it before any document API call, even when a local build script exists. For running a query or pulling metrics use omni-query; for adding a field to the shared model use omni-model-builder./omni-content-explorerFind, browse, and organize content in Omni Analytics — dashboards, workbooks, folders, and labels — using the Omni CLI. Use this skill whenever someone wants to find an existing dashboard, search for content, list workbooks, browse folders, see what dashboards exist, find popular reports, download a dashboard as PDF or PNG, set an alert on a dashboard tile, favorite content, manage labels on documents, or any variant of "find the dashboard about", "what reports do we have", "show me our dashboards", "where is the sales report", "download this dashboard", or "alert me when this changes". This skill locates and organizes content; to inspect what a dashboard tile actually queries — its fields, filters, and sorts — use omni-query./omni-embedEmbed Omni Analytics dashboards in external applications — URL signing, custom themes, iframe events, entity workspaces, and permission-aware content — using the @omni-co/embed SDK and Omni CLI. Use this skill whenever someone wants to embed a dashboard, sign an embed URL, customize the embedded theme, handle embed events, listen for clicks or drills in the iframe, send filters to an embedded dashboard, set up entity workspaces, look up embed users, build a permission-aware content list, white-label an embedded dashboard, or any variant of "embed this dashboard", "customize the iframe theme", "handle click events from the embed", "filter the embedded dashboard", "set up embedding", or "what dashboards can this user see".Other plugins' skills for the same job