Sigma data models

From twells89/sigma-skills · View interactive version

Sigma data models is an AI agent skill from the GitHub repository twells89/sigma-skills. Author, retrieve, or modify a Sigma data model spec (the JSON/YAML semantic-layer definition with sources, columns, metrics, relationships, filters, controls, folder groupings, and column-level security) by calling the Sigma REST API directly. Use when the user wants to build a new data model from e

How to use this skill

Skill file

Sigma Data Models (Author / Get / Update)

Build a Sigma data model spec — the JSON definition of pages, sources, columns, metrics, relationships, filters, controls, folder groupings, and column-level security — and round-trip it through the Sigma REST API.

This skill is for authoring from existing warehouse tables: a user knows their warehouse, wants to expose specific tables as a Sigma data model with the right joins, metrics, and governance, and needs help composing the spec. Conversions from other BI-tool formats (dbt schema.yml, LookML views, Tableau TDS, Power BI PBIT, Alteryx YXMD, etc.) are not in this skill — direct users to the Sigma data-model converter MCP / browser tool, which already handles those mappings.

Auth: Authenticate via the sigma-api skill first to set

$SIGMA_BASE_URL and $SIGMA_API_TOKEN. Its common get-token.sh path

prefers a saved interactive browser session and falls back to

SIGMA_CLIENT_ID / SIGMA_CLIENT_SECRET for unattended use. This skill

assumes the resulting token is already present.

Requirements: curl, jq, base64. Your Sigma API credentials must have permission to create or edit data models, plus "Can edit" access on the destination folder (for create) or the existing data model (for update). If a request returns 403, ask your Sigma admin to confirm the credential's permissions.

Reference Index

Feature-specific JSON patterns live in reference/. Load each file when you identify the corresponding feature in the user's request — don't read every file up-front.

| File | When to load |

|------|--------------|

| reference/columns.md | Calculated columns, formula columns, derived columns; renaming a column, changing a formula, warehouse-column ID conventions, column reference rules. |

| reference/metrics.md | Metrics, aggregate measures, metric timelines, time-series / trend metrics; adding a metric to an existing table or changing aggregation. |

| reference/relationships.md | Relationships, foreign-key linking, related tables, cross-table lookups; adding a relationship between an existing element and a new one (mixed-ID rule — see workflows/crud.md). |

| reference/sources.md | Custom SQL sources, join sources, union sources, transpose sources; swapping a model's source kind on an existing model. |

| reference/filters.md | Row filters, where clauses, date range filters, top-N; adding/removing a filter on an existing model. |

| reference/folders-groupings.md | Folders, column groupings, column ordering, sort, organize columns; reordering existing columns. |

| reference/column-level-security.md | Column-level security (CLS), data masking, restrict columns by team / user attribute; applying CLS to an existing column. |

| reference/controls.md | List/dropdown, text input, text area, number input, number range, date, date range, slider, range slider, segmented, switch, checkbox, top-N controls; adding a control to an existing page. |

| reference/formatting.md | Column or metric formatting — currency, percentage, date format, decimals, datetime; reformatting a column or metric on an existing model. |

| reference/calc-columns.md | Calculated / derived / formula columns on a DM element. Covers shape, formula references, and the window-function silent-error gotcha (CountOver/SumOver etc. fail in DM element calc cols → workarounds). |

Workflows Index

| File | When to load |

|------|--------------|

| reference/workflows/discover.md | Read first when starting a new model. Find the connection, resolve table paths, fetch every paginated column-metadata page, declare the expected grain, and prove source/join cardinality before drafting. Without this, columns after the API's default first 50 can appear missing and a spec can compile while every aggregate is wrong. |

| reference/workflows/authoring.md | Composition judgment calls — one big model vs many small, SQL source vs warehouse-table, joins in the model vs in workbooks, naming conventions, where to put metrics, folder placement, when to materialize. |

| reference/workflows/crud.md | POST / GET / PUT against /v2/dataModels endpoints. Always load before any API call. Contains the ID-semantics contrast (CREATE remap vs GET source-of-truth vs UPDATE preserve), full step-by-step recipes, and the mixed-ID rule for relationships in updates. |

| reference/workflows/validate.md | Pre-submit checklist + decoding common errors (400 / 403 / 409) + the "pull a known-working model and diff" pattern when guessing isn't working. |

ID Conventions

Cross-cutting rules. Per-workflow ID semantics (remap vs preserve vs mixed cross-references) live in reference/workflows/crud.md.

Unsupported Features

Call out any of these before presenting the final spec:

Cross-Skill References

Out of Scope (use a different tool)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.