sigma-data-models
Create, 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 author a new data model from a description, export/inspect/download an existing model's spec, edit columns or metrics, change a model's source, add relationships or row-level filters, or otherwise round-trip a data model through code. Requires an SIGMA_API_TOKEN — obtain via the sigma-api skill first.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-10
- Stars
- ★ 23
- Forks
- 8
01 前言 Front Matter
- name
- sigma-data-models
- description
- Create, 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 author a new data model from a description, export/inspect/download an existing model's spec, edit columns or metrics, change a model's source, add relationships or row-level filters, or otherwise round-trip a data model through code. Requires an SIGMA_API_TOKEN — obtain via the sigma-api skill first.
02 资源文件 11
- 参考文档reference/column-level-security.md2.1 KB
- 参考文档reference/columns.md7.3 KB
- 参考文档reference/controls.md6.7 KB
- 参考文档reference/filters.md2.2 KB
- 参考文档reference/folders-groupings.md1.6 KB
- 参考文档reference/formatting.md1.3 KB
- 参考文档reference/metrics.md1.9 KB
- 参考文档reference/modeling.md7.4 KB
- 参考文档reference/relationships.md1.5 KB
- 参考文档reference/sources.md10.7 KB
- 参考文档reference/workflows/crud.md15.1 KB
03 SKILL.md 正文
Sigma Data Models (Create / Get / Update)
Round-trip a Sigma data model spec — the JSON definition of pages, sources, columns, metrics, relationships, filters, controls, folder groupings, and column-level security — through the Sigma REST API.
Auth: Authenticate via the sigma-api skill first to set $SIGMA_BASE_URL and $SIGMA_API_TOKEN. This skill assumes both are already exported. If neither is set but the sigma CLI is installed and sigma auth status 2>&1 reports a valid token, set SIGMA_API_TOKEN=$(sigma auth token) and set SIGMA_BASE_URL to https:// plus the API host that sigma auth status prints (see the sigma-cli skill). Tokens are short-lived, so re-read the token in each new shell.
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/modeling.md |
Any new model that combines tables or defines metrics. Grain, fan-out, joining facts to dimensions, per-entity or lifetime totals with Rollup, ratio metrics ("per square foot", "per employee"), metric vs. column, "define it once" requests, and when custom SQL is warranted. |
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. |
Workflows Index
| File | When to load |
|---|---|
reference/workflows/crud.md |
Authoring a new model, retrieving an existing model's spec, or modifying / editing / adding to / changing the source of an existing model. Always load before any POST / GET / PUT against /v2/dataModels endpoints. Contains the ID-semantics table (GET is the source of truth), full step-by-step CREATE / GET / UPDATE recipes including the verify step and how to get the model's link, and the mixed-ID rule for relationships in updates. |
ID Conventions
Cross-cutting rules. Per-workflow ID semantics (what's stored on create, what to preserve on update, mixed cross-references) live in reference/workflows/crud.md.
- Short alphanumeric IDs for generated entities:
"page-1","table-orders","col-revenue". - Warehouse column IDs follow
"inode-<tableId>/<COLUMN_NAME>"— use"<YOUR_TABLE_INODE>/<COL_NAME>"as a placeholder. - Control
idis the element ID;controlIdis the formula reference name — keep them distinct.
Unsupported Features
Call out any of these before presenting the final spec:
- Multiple tables with identical names in the same data model
- Input tables, Python elements, and UI elements
- Referencing Sigma elements in custom SQL
- Partial updates — the create and update endpoints both require the full representation
04 同仓库更多 Skills
sigma-workbooks
Build, edit, and iterate on Sigma workbook specs — the JSON definition you send as `contents` in a POST to /v2/workbooks, covering pages, layout, controls, charts, KPIs, tables, formulas, and sources. The Sigma OpenAPI is the source of truth for every shape and field; this skill adds navigation, style guidance, and proven recipes for effective dashboards and operational apps. Use when the user wants to construct a dashboard from a spec, generate a Sigma app (planning, approval, allocation, or exception), reproduce a screenshot/mockup/Claude design artifact as a native Sigma app, add or modify pages / elements / controls / formulas, validate a spec before submission, or work through the workbook spec lifecycle programmatically. Requires an SIGMA_API_TOKEN — obtain via the sigma-api skill first.
sigma-reports
Build, validate, retrieve, and safely update Sigma report code representations through /v2/reports. Use for fixed-layout or pixel-perfect reports, executive board packets, wide operational tables, invoices, statements, regulatory documents, and PDF delivery. Covers reusable report scaffolds, report pages, absolute pixel layout, header/footer panels, common elements, verification, full-contents replacement, and workbook conversion to reports. Do not use for responsive dashboards; use sigma-workbooks instead. Requires SIGMA_API_TOKEN from the sigma-api skill.
sigma-cli
Drive the full Sigma Computing REST API surface from the local `sigma` binary (Sigma CLI) and its OpenAPI-generated command tree. Use whenever the user wants to call any Sigma endpoint from the command line, needs a uniform `--params` / `--json` shape across resources, wants to install or configure the CLI, or asks about `sigma api …`, `sigma auth login`, `list-prefixes`, or `schema`. Prefer this skill over raw `curl` when the user has the `sigma` binary installed; fall back to `sigma-api` for OAuth fundamentals and direct HTTP.
sigma-api
Authenticate against the Sigma Computing REST API and obtain a bearer token. Use whenever the user wants to call the Sigma API directly with curl/HTTP, exchange OAuth client credentials for an access token, sign in interactively via a browser OAuth login (authorization-code + PKCE), configure SIGMA_BASE_URL / SIGMA_CLIENT_ID / SIGMA_CLIENT_SECRET, troubleshoot 401/403 responses, or pick the right Sigma API hostname for their cloud. Use as a prerequisite when another Sigma skill needs an SIGMA_API_TOKEN.
sigma-workbooks
暂无简介
sigma-reports
暂无简介