Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/twells89/sigma-migration-skillsnpx agentmods add rules/twells89/sigma-migration-skills/custom-sql-to-data-modelWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/twells89/sigma-migration-skills/custom-sql-to-data-model)<a href="https://agentmods.dev/rules/twells89/sigma-migration-skills/custom-sql-to-data-model"><img src="https://agentmods.dev/badge/rules/twells89/sigma-migration-skills/custom-sql-to-data-model/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/twells89/sigma-migration-skills/custom-sql-to-data-model"><img src="https://agentmods.dev/badge/rules/twells89/sigma-migration-skills/custom-sql-to-data-model.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00065 | $0.06902 |
| Opus 5.5 | $0.00026 | $0.02761 |
| Sonnet 5.5 | $0.00013 | $0.01380 |
| Haiku 4.5 | $0.00006 | $0.00690 |
Grade A, and why
custom-sql-to-data-model scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 24d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
curl -s -X POST \ Copies of this mod
1 near-identical copy found in the catalogue:
- custom-sql-to-data-model — 88% identical, 15 lines differ
How it starts
The opening of the file, as written. The whole thing — 624 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Scan Sigma workbooks for custom SQL elements, dedupe across workbooks, build or reuse Sigma data models, then repoint the workbooks via the v3alpha
:swapSourcesendpoint. Use when you want to find ad-hoc SQL in workbooks and promote it to one reusable data model per unique query.
Custom SQL → Data Model
End-to-end flow:
- Scan workbooks for
source.kind: "sql"elements (Phase 1). - Scan data models to index every existing SQL or warehouse-table source (Phase 1.5).
- Group manifest entries by normalized SQL; for each group, decide reuse an existing DM element or build a new one (Phase 1.5 → plan).
- Build DMs only for the to-build groups (Phase 2 / 3 / 4).
- Drive
:swapSourcesfrom the plan, one workbook at a time (Phase 5). - Audit and repair residual
[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.
Prerequisites
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 client credentials. Override with
SIGMA_AUTH_MODE / --auth-mode (auto, browser, or
client-credentials). Before either 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.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 24d ago Changed · +23 lines afc5076d7d66
- 2mo ago First seen · 601 lines · 65 tokens per session scan A f235f76cda06
custom-sql-to-data-model is a cursor rule published in the GitHub repository twells89/sigma-migration-skills (18 stars, last pushed 8d ago), licensed MIT. It adds 65 tokens to every session and 6,902 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
prefer-assertions-over-defensive-checks
Prefer assertions over defensive checks when data is guaranteed to be valid.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
config-validation-and-normalization
Config validation and normalization responsibilities (defineConfig normalizes, the orm section schema validates and resolves paths, the loader reports per-section diagnostics).