/sigma-authoring:custom-sql-to-data-modelfrom Sigma Authoring (Workbooks + Data Models)
Scan Sigma workbooks for custom SQL elements, dedupe across workbooks, build or reuse Sigma data models, then repoint the workbooks via the v3alpha `:swapSources` endpoint. Use when you want to find ad-hoc SQL in workbooks and promote it to one reusable data model per unique query.
Ships in Sigma Authoring (Workbooks + Data Models). 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; scripts run unread.
End-to-end flow:
source.kind: "sql" elements (Phase 1).:swapSources from the plan, one workbook at a time (Phase 5).[Prefix/SNAKE_CASE] formulas left behind by
Sigma's auto-match (Phase 6).The key win versus the legacy GET/mutate/PUT approach: one workbook with N
SQL elements is one API call with N entries in sourceMapping, and the
auto-match handles formula rewrites — except for the rough edges Phase 6
catches.
Required env var: SIGMA_BASE_URL. For an interactive terminal, prefer a
one-time browser login through the sigma-api skill:
eval "$(bash <repo-root>/sigma-api/scripts/browser-login.sh)"
It keeps the refresh token exclusively in the OS keychain. For unattended
hosts, set SIGMA_CLIENT_ID and SIGMA_CLIENT_SECRET (Sigma Administration →
Developer Access) as the fallback.
The local get_token.py is a byte-identical synced copy of the canonical
sigma-api provider. In default auto mode it uses a cached/refreshable
browser session first, then a signed-in Sigma CLI profile, then client
credentials. Override with SIGMA_AUTH_MODE / --auth-mode (auto,
browser, sigma-cli, or client-credentials). Before any auth mode succeeds, the provider requires
a non-redirecting, valid-JSON GET /v2/whoami; 401, 403, non-JSON, and
redirect responses fail without emitting or writing the token.
Default (shell-neutral, works in bash/zsh/PowerShell/cmd): mint a token
with the stdlib-only Python script and let scripts/lib/sigma_rest.rb pick
it up automatically from auth.json — no eval, no shell-specific syntax:
python3 scripts/get_token.py --workdir /tmp/custom-sql-run
After verification, this writes /tmp/custom-sql-run/auth.json (mode 0600)
with the access token, base URL, mint timestamp, and auth method—never the
refresh token. Every Ruby script in this skill checks
$SIGMA_WORKDIR/auth.json (or ./auth.json) before invoking the same dual
provider, so point SIGMA_WORKDIR at the same directory (or run from inside
it):
export SIGMA_WORKDIR=/tmp/custom-sql-run
ruby scripts/scan-workbooks.rb
bash/zsh convenience (equivalent, but bash-only):
eval "$(bash scripts/get-token.sh)"
Tokens expire after ~1 hour. Using
SIGMA_TOKEN_MINTED_ATfrom the environment orauth.json, the Ruby wrapper proactively refreshes at 50 minutes through the dual provider and also refreshes/retries once on 401. Caller tokens with missing or malformed mint-age metadata remain in use until a 401. If authentication still fails, re-runbrowser-login.shwhen a browser refresh token was revoked, or verify the client credentials used as fallback.
eval "$(bash scripts/get-token.sh)" && ruby scripts/scan-workbooks.rb
Reads every workbook spec in the org, finds all elements where
source.kind == "sql", and writes custom-sql-manifest.json to the system
temp dir (Ruby's Dir.tmpdir — /tmp on macOS/Linux, %TEMP% on Windows).
Each entry:
{
"workbook_id": "25e21c63-...",
"workbook_name": "Custom Sql Test",
"folder_id": "fe98dc76-...",
"element_id": "6YSI-SjSmz",
"element_name": "Customer Dim SQL",
"connection_id": "ab12cd34-...",
"sql": "select * from DEMO_DB.DEMO.CUSTOMER_DIM",
"column_count": 18
}
element_id is the same value as the customSqlId consumed by :swapSources
in Phase 5 — no extra lookup needed.
Review the findings and confirm with the user which workbooks to convert.
eval "$(bash scripts/get-token.sh)" && ruby scripts/scan-data-models.rb
Writes dm-sql-index.json to the system temp dir (Dir.tmpdir). The scanner emits one entry per existing DM
element of either kind:
kind: "sql" — indexed by normalized SQL textkind: "warehouse-table" — indexed by a synthetic select * from <path>
string, so trivial SELECT * custom-SQL maps to the right table-backed DMEach entry also tracks dmElementCount (total elements in that DM) so the
planner can prefer focused DMs over kitchen-sink ones.
ruby scripts/plan-dedup.rb
Writes swap-plan.json to the system temp dir (Dir.tmpdir). The planner:
status: "existing" and picks the best target (same connection,
fewest DM elements, stable tiebreak). Otherwise marks it to-build.[REUSE] group 1: 3 occurrence(s)
SQL: select * from demo_db.demo.customer_dim
- Custom Sql Test / Custom Sql Test SQL (6YSI-SjSmz)
- Dedup Test Alpha / Customer Source (el-customers)
- Dedup Test Beta / Customer Source (el-customers-dup)
-> Customer Dim / Customer Dim (54d1f450-... / ROZzp25zn9)
[BUILD] group 2: 1 occurrence(s)
SQL: with monthly as ( select employee_id, date_trunc('month', date) as month, …
- Dedup Test Alpha / OT Summary (el-ot-summary)
-> needs new DM (connection ab12cd34-..., folder fe98dc76-...)
Summary: 3 unique SQL strings → 1 reuse, 2 build. 5 total swap actions.
Confirm with the user before continuing — a [REUSE] decision is only as
good as the picked candidate. If the heuristic picked the wrong DM, edit
swap-plan.json (in the system temp dir) to point target.dataModelId /
target.elementId at the preferred DM before Phase 5.
Build one DM per to-build group in the plan. Phases 1.5 → 2 → 3 → 4 — only
the to-build groups need this; reuse groups skip straight to Phase 5.
A group is "one unique SQL across N workbook occurrences" — build a single DM with one element wrapping that SQL, then the same DM/element pair gets referenced by every occurrence in the swap call. Do not build per-workbook.
For each to-build group:
mcp__sigma-data-model__convert_sql_to_sigma
statements = [{"name": "<group label>", "sql": "<representative sql>"}]
connection_id = "<connection_id from manifest>"
database = ""
schema = ""
database / schema are inferred from the SQL.
| SQL type | Converter output | Action |
|---|---|---|
SELECT * / SELECT cols from one table | Single warehouse-table element, no columns | Fetch columns — see below |
SELECT with JOINs | Multiple warehouse-table elements + relationships | Use as-is |
SELECT with aggregates (GROUP BY) | Elements + metrics array | Check child usage — see note below |
CTEs (WITH ...) | Element with path: ["CTE_NAME"] — fake table | Discard — build manually |
| Subqueries / implicit joins | Custom SQL element | Use as-is |
Aggregated SQL with GROUP BY: The warehouse-table + metrics shape only exposes GROUP BY dimensions as direct columns; aggregates land in
metrics. If child workbook elements reference aggregate columns as direct columns, the DM page must use asqlsource instead — build manually with the full SQL and enumerate all output columns.
The swap auto-matches columns between source and target by display name,
case- and punctuation-insensitive (CUSTOMER_KEY ↔ Customer Key). Most
columns match cleanly. The auto-match has known silent misses — see
Phase 6 — but those are post-swap-repairable, so don't over-engineer at
build time. Just ensure the DM column name fields are reasonable display
names ("Total Hours", "OT Hours", …), not SQL aliases.
| Source kind | Formula inside the DM element | Formula in workbook referencing the DM |
|---|---|---|
warehouse-table | [TABLE_NAME/Column Name] | [DM Element Name/Column Name] |
sql | [Custom SQL/SQL_ALIAS] | [DM Element Name/Column Display Name] |
Key rules:
sql DM element, the formula prefix is always the literal string Custom SQL —
never the element's own name field.name field),
not by server-assigned column id. Display names are stable across DM PUTs;
column IDs are reassigned every PUT.def col(sql_alias, display=None):
title = display or sql_alias.replace("_", " ").title()
return {"id": sql_alias, "name": title, "formula": f"[Custom SQL/{sql_alias}]"}
When the converter returns a warehouse-table element with no columns:
mcp__sigma-mcp-v2__search query="<TABLE_NAME>" entityTypes=["table"] → inodeIdmcp__sigma-mcp-v2__describe object={"type":"table","inodeId":"<inodeId>"} → column namesformula: [TABLE/<col>], name: "<Title Case>".When the converter returns path: ["CTE_NAME"], that CTE name is being used
as a fake warehouse table path. Discard the converter output and build a
sql element by hand with the full CTE in source.statement. Enumerate the
output columns from the final SELECT.
Always set folderId from the plan's representative.folder_id (taken
from the source workbook's own folder — guaranteed real).
eval "$(bash scripts/get-token.sh)" && \
curl -s -X POST \
-H "Authorization: Bearer $SIGMA_API_TOKEN" \
-H "Content-Type: application/json" \
-d @/tmp/<name>-datamodel-spec.json \
"$SIGMA_BASE_URL/v2/dataModels/spec" \
| ruby -r yaml -r json -r date -e "
d = YAML.safe_load(STDIN.read, permitted_classes: [Date, Time])
if d['dataModelId']
puts 'SUCCESS dataModelId: ' + d['dataModelId'].to_s
else
puts 'ERROR: ' + d.inspect
end
"
Response is YAML — never pipe to
jq.
After POST, fetch the spec back with Accept: application/json to learn the
server-assigned element IDs:
curl -s -H "Authorization: Bearer $SIGMA_API_TOKEN" -H "Accept: application/json" \
"$SIGMA_BASE_URL/v2/dataModels/<dataModelId>/spec" \
| jq '.pages[].elements[] | {id, name}'
Update the plan: fill in target.dataModelId / target.elementId on every
to-build entry with the new IDs.
For each newly-built DM:
mcp__sigma-mcp-v2__describe
object = {"type": "datamodel", "dataModelId": "<dmId>"}
Then for each element listed:
mcp__sigma-mcp-v2__describe
object = {"type": "datamodel-element", "dataModelId": "<dmId>", "elementId": "<elId>"}
mcp__sigma-mcp-v2__query
query = { "type": "datamodel", "dataModelId": "<dmId>",
"sql": "SELECT * FROM \"datamodel\".\"<elId>\" LIMIT 3" }
Column identifiers in the SQL are the server-assigned IDs from the
describe DDL, not display names.
If anything fails, fix and re-PUT before Phase 5.
:swapSourcesEndpoint: POST /v3alpha/workbooks/{workbookId}:swapSources.
The call atomically:
source.kind: "sql" → "data-model" on each root SQL element,[Custom SQL/SQL_ALIAS] to
[DM Element Name/Display Name],If a root SQL element has name: null (or empty string), child elements
that referenced it used the implicit prefix "Custom SQL". The swap rewrites
the root's own formulas correctly but breaks child formulas to
[Missing node/...] — and reversing the swap does not fix them; the
"Missing node" placeholder is sticky and requires a manual spec edit to
recover.
Always set a real name on each unnamed root SQL element before swapping,
and update any child formulas that used the Custom SQL prefix to use the
new name. Then the swap auto-rewrites cleanly.
The workbook body is wrapped, not flat (verified live 2026-08; re-keyed 2026-11).
GET /v2/workbooks/{id}?includeContents=true,POST /v2/workbooks, andPUT /v2/workbooks/{id}/contentsall nestschemaVersion/elements/pages/layoutunder a top-levelcontentskey (the deprecated/specendpoints called itdocument);name/response-only fields stay outside it, andPUTtakes only{contents: {...}}— seesigma-workbooks'sreference/specification/schema.md. The snippet below unwrapsspec['contents']before touching the flatelementsarray, and re-wraps just the document for the PUT body. The oldGET/PUT .../specendpoints are deprecated; data-model/v2/dataModels/specis not.
require 'json'
require 'tmpdir'
WB = '<workbookId>'
raw = `curl -s -H "Authorization: Bearer $SIGMA_API_TOKEN" -H "Accept: application/json" "$SIGMA_BASE_URL/v2/workbooks/#{WB}?includeContents=true"`
spec = JSON.parse(raw)
doc = spec['contents'] # schemaVersion/elements/pages/layout live here
manifest = JSON.parse(File.read(File.join(Dir.tmpdir, 'custom-sql-manifest.json')))
new_names = manifest
.select { |m| m['workbook_id'] == WB }
.to_h { |m| [m['element_id'], m['element_name']] }
# Children that referenced a root we're renaming
child_parent = {}
doc['elements'].each do |el|
parent = el.dig('source', 'elementId')
child_parent[el['id']] = parent if parent && new_names.key?(parent)
end
doc['elements'].each do |el|
if new_names.key?(el['id'])
el['name'] = new_names[el['id']] if el['name'].to_s.strip.empty?
elsif (parent = child_parent[el['id']])
new_prefix = new_names[parent]
(el['columns'] || []).each do |col|
col['formula'] = col['formula']&.gsub('[Custom SQL/', "[#{new_prefix}/")
end
end
end
# PUT takes ONLY {contents: ...} — no name/folderId/response-only fields.
File.write(File.join(Dir.tmpdir, 'wb-pre-swap.json'), JSON.pretty_generate({ 'contents' => doc }))
curl -s -X PUT \
-H "Authorization: Bearer $SIGMA_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @/tmp/wb-pre-swap.json \
"$SIGMA_BASE_URL/v2/workbooks/<workbookId>/contents"
Skip this step only if every root SQL element already has a non-empty
nameAND no child formula references[Custom SQL/...].
:swapSources per workbook, batchedFor each workbook in the plan, batch all of that workbook's swaps into a single call. The example below assumes the plan groups Alpha's two SQL elements together; the planner output gives you the mapping.
WB="<workbookId>"
curl -s -X POST \
-H "Authorization: Bearer $SIGMA_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"sourceMapping": [
{ "from": { "type": "custom-sql", "customSqlId": "<element_id 1>" },
"to": { "type": "data-model", "dataModelId": "<dmId 1>", "elementId": "<elId 1>" } },
{ "from": { "type": "custom-sql", "customSqlId": "<element_id 2>" },
"to": { "type": "data-model", "dataModelId": "<dmId 2>", "elementId": "<elId 2>" } }
]
}' \
"${SIGMA_BASE_URL}/v3alpha/workbooks/${WB}:swapSources"
Shell gotcha: the URL contains a
:which collides with parameter expansion in zsh/bash. Always wrap the variable in braces:${WB}:swapSources, not$WB:swapSources(bad substitutionerror).
A successful response is HTTP 200 with body {}.
The endpoint has two specific behaviors to guard against:
| Behavior | Symptom | Mitigation |
|---|---|---|
Bogus from.customSqlId (typo or stale) | HTTP 200, {} — silent no-op | Re-list /v2/workbooks/{id}/sources and assert no custom-sql entries remain |
Bogus to (e.g. wrong DM elementId) | HTTP 400 "Element X not found in data model" | Match each plan entry's target against the Phase 3 readback |
curl -s -H "Authorization: Bearer $SIGMA_API_TOKEN" \
"${SIGMA_BASE_URL}/v2/workbooks/${WB}/sources" | jq '[.[] | .type] | unique'
# expect: ["data-model"] (or empty / no custom-sql)
columnMapping override (proactive)The swap auto-matches columns by display name, case- and punctuation-
insensitive. If you know in advance that some DM column display names won't
match the custom-SQL aliases (and won't auto-resolve), pass columnMapping
in the same request:
{
"sourceMapping": [
{
"from": { "type": "custom-sql", "customSqlId": "..." },
"to": { "type": "data-model", "dataModelId": "...", "elementId": "..." },
"columnMapping": [
{ "fromColumn": ["C_KEY"], "toColumn": ["customer_key"] },
{ "fromColumn": ["TOTAL_REV"], "toColumn": ["lifetime_revenue"] }
]
}
]
}
For cases you didn't anticipate, Phase 6 cleans up after the fact.
The auto-match has documented silent misses: short uppercase aliases and
some token patterns survive the swap as [Prefix/SNAKE_CASE] even though
the DM element's column display name is something like OT Hours. The
broken formula:
Column "[OT Summary/OT_HOURS]" does not exist.[OT Summary/OT Flag]) — the child returns the same error
string as a data value, not a query failure.The audit script walks each workbook's elements, finds formulas of the form
[Prefix/UPPERCASE_TOKEN] where the local sibling column's id matches
the token but its display name differs, and rewrites the suffix to the
display name. Warehouse-table prefixes are left alone.
# audit specific workbooks
ruby scripts/audit-formulas.rb <workbookId> [<workbookId> ...]
# or audit every workbook touched by the current plan
ruby scripts/audit-formulas.rb --from-plan
The script reports N formula(s) repaired per workbook. Idempotent — safe
to re-run.
After audit, re-validate with MCP to confirm the cells now return data, not error strings:
mcp__sigma-mcp-v2__query
query = {"type": "workbook", "workbookId": "<wb>",
"sql": "SELECT <cols> FROM \"workbook\".\"<elementId>\" LIMIT 3"}
:swapSources)If :swapSources doesn't fit (e.g., a partial swap, or a column remap that's
easier as a spec edit), the older GET/mutate/PUT approach still works. The
cost: you keep prefix/display-name rewrite logic in sync with the DM, you
must strip response-only fields, and layout edits may get rebuilt server-
side. Prefer :swapSources whenever it works.
/tmp/wb-spec.yamlhere is a savedGET /v2/workbooks/{id}?includeContents=trueresponse (sendAccept: application/yaml; the default is JSON) — which, like every workbook body, nestsschemaVersion/elements/pages/layoutundercontents(earlier saved/specresponses usedocument; see the wrapper note in Phase 5, andsigma-workbooks'sreference/specification/schema.md). The snippet unwrapsspec['contents'] || spec['document']before touchingelements, and the PUT body is just the re-wrappedcontents— not the full GET response.
require 'yaml'; require 'json'; require 'date'
spec = YAML.safe_load(File.read('/tmp/wb-spec.yaml'), permitted_classes: [Date, Time])
doc = spec['contents'] || spec['document'] # schemaVersion/elements/pages/layout live here
conversions = {
'<root_element_id>' => {
dataModelId: '<dataModelId>',
elementId: '<server-assigned-element-id>',
elementName: '<DM element name, e.g. Customer Dim>'
}
}
root_ids = conversions.keys.to_set
child_parent = {}
doc['elements'].each do |el|
parent = el.dig('source', 'elementId')
child_parent[el['id']] = parent if parent && root_ids.include?(parent)
end
doc['elements'].each do |el|
if (conv = conversions[el['id']])
el['name'] = conv[:elementName]
el['source'] = { 'kind' => 'data-model', 'dataModelId' => conv[:dataModelId], 'elementId' => conv[:elementId] }
(el['columns'] || []).each do |col|
display = col['id'].split('_').map(&:capitalize).join(' ')
col['formula'] = "[#{conv[:elementName]}/#{display}]"
end
elsif (parent = child_parent[el['id']])
new_prefix = conversions[parent][:elementName]
(el['columns'] || []).each { |c| c['formula'] = c['formula']&.gsub('[Custom SQL/', "[#{new_prefix}/") }
end
end
# PUT takes ONLY {contents: ...} — no name/folderId/response-only fields.
File.write('/tmp/wb-updated.json', JSON.pretty_generate({ 'contents' => doc }))
curl -s -X PUT \
-H "Authorization: Bearer $SIGMA_API_TOKEN" \
-H "Content-Type: application/json" \
-d @/tmp/wb-updated.json \
"$SIGMA_BASE_URL/v2/workbooks/<workbookId>/contents"
The same v3alpha shape works for DMs:
POST /v3alpha/dataModels/{dataModelId}:swapSources
Use this when a DM itself contains a custom-SQL element you want to promote.
Same sourceMapping[].from / .to shape; same silent-no-op gotcha for
bogus from.customSqlId. Not part of the standard Phase 1–6 flow — included
for completeness.
| Error / symptom | Cause | Fix |
|---|---|---|
Token missing or malformed | Token expired between commands | Re-run python3 scripts/get_token.py --workdir "$SIGMA_WORKDIR" (shell-neutral), or eval "$(bash scripts/get-token.sh)" in bash — chain the latter with && |
:swapSources returns HTTP 200 {} but nothing changed | from.customSqlId doesn't match a real element (typo or already swapped) | Re-list /v2/workbooks/{id}/sources; assert no custom-sql entries remain |
Element X not found in data model (400) on :swapSources | to.elementId doesn't exist in the DM | Use the server-assigned ID from Phase 3, not your authoring ID |
bad substitution on the curl URL | Shell expanded $WB:swapSources as a parameter modifier | Wrap in braces: ${WB}:swapSources |
Child element formulas show [Missing node/...] after swap | Root SQL element was unnamed; the implicit "Custom SQL" prefix lost its referent | Sticky — must be fixed manually. Pre-swap: name the root element AND rewrite child formulas to use that name |
Query returns an error string inside a data cell, e.g. Column "[OT Summary/OT_HOURS]" does not exist | Auto-match silently missed a SNAKE_CASE column alias; formula points at a column ID the DM doesn't expose | Run scripts/audit-formulas.rb --from-plan (Phase 6). For repeat offenders, pass columnMapping in the swap call proactively |
service_error 500 on a swap whose to.definition contains SQL with single quotes | Heredoc / shell expansion mangled the SQL string | Use a JSON file with -d @<file> instead of inline -d '...', or escape carefully |
| Plan picked the wrong reuse target | The DM with the lowest dmElementCount and matching connection was not the most appropriate | Edit swap-plan.json (system temp dir) to point target.dataModelId / target.elementId at the preferred DM before Phase 5 |
Invalid array: ...columns, got undefined | Converter returned no columns (SELECT * case) | Fetch columns via mcp__sigma-mcp-v2__describe and add them manually |
formula: Invalid string: undefined | Column missing formula field | Every column needs formula — [Custom SQL/SQL_ALIAS] for sql, [TABLE/COL] for warehouse-table |
Circular column reference | Formula used the column's own display name with no prefix | Use [Custom SQL/SQL_ALIAS] — bare [Display Name] self-references |
Unknown column '[ALIAS]' | Bare alias with no prefix | Add the Custom SQL prefix: [Custom SQL/ALIAS] |
dependency not found: formula reference 'element name/col' | Used element's own name as formula prefix inside the element | Inside a sql element, always use [Custom SQL/...], never [ElementName/...] |
document parent must be a folder | folderId points to a workbook or DM, not a folder | Use folder_id from the manifest — taken from the workbook's own folder, always a real folder |
Converter returns path: ["CTE_NAME"] | Converter treated CTE name as a warehouse table path | Discard converter output; build a source.kind: "sql" element manually |
Column '[Element/id]' does not exist after DM PUT | DM PUT reassigned column IDs — old IDs are stale | Workbook formulas must use display names not IDs: [Element Name/Column Display Name] |
dataModelId missing from response | POST failed silently | Check the full response for a message field |
| Metric columns missing on child elements referencing aggregated SQL | warehouse-table + metrics approach; child references aggregate as a direct column | Rebuild the DM page as a sql source with all output columns enumerated explicitly |
generated/cline/custom-sql-to-data-model.md (opens in a new tab)generated/codex/AGENTS.md (opens in a new tab)generated/continue/custom-sql-to-data-model.md (opens in a new tab)generated/cursor/rules/custom-sql-to-data-model.mdc (opens in a new tab)refs/environment.md (opens in a new tab)scripts/audit-formulas.rb (opens in a new tab)scripts/bootstrap.ps1 (opens in a new tab)scripts/bootstrap.sh (opens in a new tab)scripts/browser-login.sh (opens in a new tab)scripts/doctor.ps1 (opens in a new tab)scripts/doctor.sh (opens in a new tab)scripts/get-token.sh (opens in a new tab)scripts/get_token.py (opens in a new tab)scripts/lib/browser-login-platform.sh (opens in a new tab)scripts/lib/code_rep.rb (opens in a new tab)scripts/lib/formula_audit.rb (opens in a new tab)scripts/lib/ruby_compat.rb (opens in a new tab)scripts/lib/sigma_rest.rb (opens in a new tab)scripts/lib/workbook_sql.rb (opens in a new tab)scripts/plan-dedup.rb (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
5 skills in this plugin
/sigma-apiAuthenticate 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-data-modelsAuthor, 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 existing warehouse tables, add metrics or relationships to an existing model, change a model's source, edit columns, or round-trip a data model spec through code. **Out of scope: converting from another BI tool's format (dbt, LookML, Tableau, Power BI, Alteryx, etc.).** Those conversions are handled by the Sigma data-model converter (browser tool + MCP) — point users there when they paste source-format input. Requires an SIGMA_API_TOKEN — obtain via the sigma-api skill first.npx claudepluginhub sigmacomputing/sigma-migration-skills --plugin sigma-authoring