/sigma-skills:sigma-plugin-authoringfrom Sigma Skills
Builds, registers, hosts, embeds, and data-binds a custom Sigma plugin (@sigmacomputing/plugin) for visualizations without native Sigma equivalents like radial gauges, custom heatmaps, or sankeys. Covers the full lifecycle with a worked radial gauge example.
Ships in Sigma Skills. 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.
Sigma's native element kinds (bar-chart, kpi-chart, table, pivot-table,
point-map, …) cover most dashboards. Some source vizzes don't map to any of
them — a radial/semicircle gauge, a calendar heatmap, a sankey, a custom
ring/dial. For those, recreate the viz as a Sigma custom plugin
(@sigmacomputing/plugin): a single-file web app Sigma hosts inside a
workbook element, wired to real workbook data through an editor-panel
contract you define.
The plugin lifecycle: build → register → host → embed → bind → verify.
Building the rest of the workbook around the plugin (the data table it reads
from, KPIs/controls alongside it, page layout, the hidden data page) is the
sigma-workbooks skill's job — this skill only covers the plugin-specific
pieces. Authoring the underlying data model is sigma-data-models.
Before reaching for this skill, confirm there's genuinely no native fit:
check the sigma-workbooks skill's chart/KPI/table reference and, if still
unsure, query the OpenAPI's kind enum (see that skill's "Consulting the
OpenAPI" section). Only recreate as a plugin when the native surface is a
confirmed miss — plugins carry real lifecycle cost (hosting, registration,
re-registration on URL change) that a native chart doesn't.
A screenshot, mockup, or Claude design artifact is not itself a reason to
build a plugin. For a whole dashboard/app artifact, start with
sigma-workbooks/reference/workflows/from-image.md. App shell, headers, rails,
cards, buttons, controls, input tables, agents, and ordinary charts should be
native workbook elements. Return here only for an individual bespoke data
visualization whose marks/interactions have no native Sigma equivalent. Do not
rebuild an entire artifact as one HTML plugin merely to get pixel control; that
throws away native filtering, writeback, agent, accessibility, and workbook
composition behavior.
Single HTML file, vanilla JS, the SDK loaded via
<script src="https://unpkg.com/@sigmacomputing/plugin">. Declare the data
contract with client.config.configureEditorPanel([...]) — one entry per
variable your embed will bind (an element source, one or more column
bindings sourced from it, optional text/number config). Subscribe to the
data, render, and:
ResizeObserver to the render container that fully
recomputes and redraws on every resize (not CSS-only scaling) — see
reference/plugin-lifecycle.md §5 for why this is non-negotiable.client, or incomplete bound data) — see
§6.Use plugins/gauge/index.html (+ plugins/gauge/README.md) as the worked
example — a radial gauge with source/value/target/format editor-panel
vars. Copy its structure for a new archetype rather than starting from
scratch.
A plugin doesn't have to be display-only, either: it can be interactive
— write back to a control or trigger a workbook action from a click, a
selection, or an edit inside the plugin itself. See reference/patterns.md
for the writeback (variable + action-trigger) pattern and
reference/sdk-api.md for the full editor-panel config vocabulary and
client/hook API behind it.
This is the customer's call, not this skill's — any persistent public
static host they already use or prefer (their own S3/CDN, GitHub Pages,
Netlify, Vercel, Cloudflare Pages, …) works identically for registration and
embedding. localhost is fine for local dev/preview but is never a shared or
headlessly-rendered result; an ephemeral tunnel (free-tier ngrok, etc.) is
not a substitute for persistence either. Handoff is the default path —
hand the user the plugin file and the exact hosting + registration steps for
their chosen host; a turnkey automated static deploy is a fast-follow, not
built into this skill yet. Localhost is sufficient to build, preview, and
data-parity-verify the plugin; it is not sufficient for Sigma's
server-side rendering (headless screenshots, scheduled exports) — see
reference/plugin-lifecycle.md §2 before promising a screenshot.
ruby scripts/register-plugin.rb "<plugin name>" "<hosted URL>" "<description>"
# -> prints the pluginId on success
This calls PluginRegister.register_or_get, which is idempotent (safe to
re-run) and already handles the two registration gotchas that will otherwise
cost you a debugging session — a masked HTTP 404 that can accompany a
successful register, and a 403 that means registration is org-admin-gated
in this org (fall back to handoff, don't retry blindly). Full detail in
reference/plugin-lifecycle.md §1.
Emit the workbook-spec plugin element with the shared emitter — don't hand-write this JSON:
PluginEmbed.build(id:, plugin_id:, source_element_id:, bindings:, extra_config: {}) (scripts/plugin_embed.rb)
bindings maps each editor-panel column var to a columnId (e.g.
{"value" => "actual", "target" => "target"}); extra_config is any other
non-binding config (e.g. {"format" => ".0%"}). The emitter coerces every
value to a bare string and emits the correct config.source shape — see
examples/gauge-embed.json for a full output and
reference/plugin-lifecycle.md §3 for why string-coercion matters (the
failure mode is a silent, misleadingly generic error).
Put the plugin's source data element on its own hidden page if it
shouldn't be user-visible — visibleAsSource:false alone does not hide it
(§4). Then hand the finished element off to the sigma-workbooks skill's
normal create/update flow (POST /v2/workbooks / PUT /v2/workbooks/{id}/contents; the old /v2/workbooks/spec endpoints are deprecated).
source.elementId) via the standard workbook export flow and assert the
values match the source/warehouse. Works regardless of hosting.| File | When to load |
|---|---|
reference/plugin-lifecycle.md | Always, before registering or embedding. The full verified-gotcha reference: masked-404/403 registration, url set-once, hosting/localhost boundary, bare-string config shape, hidden backing page, ResizeObserver, synthetic fallback. |
reference/sdk-api.md | Before writing a plugin's editor-panel config or its data/variable/action wiring. The authoring-surface lookup: every editor-panel config type (element, column, text, variable, action-trigger, …), the config-value-by-type table, the vanilla-client-vs-React-hook side-by-side, the column-oriented element data shape, and defensive date parsing. |
reference/patterns.md | When the plugin needs to do more than display — JSON settings, edit-mode gating, the variable + action-trigger writeback pattern, dynamic editor-panel reconfiguration, variable-value unwrapping, action-effects, and multi-column roles. Includes a worked (not yet live-verified) click-to-filter writeback recipe. |
plugins/gauge/index.html + plugins/gauge/README.md | The worked example plugin (radial gauge, value vs. target) — copy/adapt its structure for a new archetype. |
examples/gauge-embed.json | A PluginEmbed.build output exemplar — the exact embed shape to match. |
This skill's worked example (plugins/gauge/) is a dependency-free single
HTML file — the SDK loaded via a CDN <script> tag, no build step. That's
the right default for a focused recreate-as-plugin: fast to iterate,
nothing to bundle, easy to hand off for hosting. For a larger, more
interactive plugin (several writeback fields, a real component tree, a
bespoke settings UI), a bundled React+TypeScript scaffold is a reasonable
alternative starting point instead of hand-rolling one — for example
neil-oliver/sigma-plugin-template,
a community scaffold. That's a pointer, not an endorsement or a
vendored dependency — this skill doesn't ship or maintain it.
sigma-workbooks skill.sigma-data-models skill.sigma-api skill. Its
common helper prefers a saved browser OAuth session and falls back to client
credentials; either method yields the SIGMA_API_TOKEN this skill needs.Invalid kind:"plugin" on workbook create/update. This is Sigma's masked
error for a malformed plugin element — almost always a config value that
isn't a bare string (an object/column-ref shape slipped in somewhere other
than source). Re-emit via PluginEmbed.build rather than hand-editing. See
reference/plugin-lifecycle.md §3.
Registration seems to fail but the plugin exists. Don't trust a non-2xx
POST /v2/plugins response alone — confirm via GET /v2/plugins by name (or
just use register-plugin.rb, which already does this). See §1.
403 registering the plugin. Org-admin-gated in this org. Hand off the
built bundle + exact steps to someone with admin credentials; don't drop the
viz or fabricate a pluginId.
Plugin looks fine at first load, then clips/garbles on resize. Missing or
incomplete ResizeObserver handling — it must fully recompute geometry from
the container's current box, not rely on CSS/viewBox scaling alone. See §5.
Need a screenshot but only have localhost. Sigma's server-side render
can't reach it. Report the gate as skipped (not passed) and note a public
host is needed for that check specifically — data-parity is unaffected. See
§2.
examples/gauge-embed.json (opens in a new tab)generated/cline/sigma-plugin-authoring.md (opens in a new tab)generated/codex/AGENTS.md (opens in a new tab)generated/continue/sigma-plugin-authoring.md (opens in a new tab)generated/cursor/rules/sigma-plugin-authoring.mdc (opens in a new tab)plugins/gauge/README.md (opens in a new tab)plugins/gauge/index.html (opens in a new tab)reference/patterns.md (opens in a new tab)reference/plugin-lifecycle.md (opens in a new tab)reference/sdk-api.md (opens in a new tab)scripts/lib/sigma_rest.rb (opens in a new tab)scripts/plugin_embed.rb (opens in a new tab)scripts/register-plugin.rb (opens in a new tab)scripts/test-gauge-plugin-static.rb (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub twells89/sigma-skills --plugin sigma-skills6 skills in this plugin
/custom-sql-to-data-modelScan 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./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./sigma-reportsBuild, validate, retrieve, and safely update Sigma report code representations through /v2/reports (contents). Use for fixed-layout or pixel-perfect reports, executive board packets, wide operational tables, invoices, statements, regulatory documents, PDF delivery, and bursting one copy per store/account/recipient. Covers reusable report scaffolds, report pages, absolute pixel layout, header/footer panels, common elements, verification, full-document 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-workbooksBuild, edit, and iterate on Sigma workbook specs — the JSON definition you POST to /v2/workbooks (as `contents`), 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.Other plugins' skills for the same job