Install the "modeler" agent skill from https://github.com/sidequery/sidemantic/tree/main/plugins/sidemantic/skills/modeler into .claude/skills/modeler/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "modeler", then confirm the skill loads.
Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Type this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
skills CLI
$ npx skills add sidequery/sidemantic --skill modeler -a codex
Project install goes to .agents/skills/; add -g for ~/.codex/skills/.
Install the "modeler" agent skill from https://github.com/sidequery/sidemantic/tree/main/plugins/sidemantic/skills/modeler into .agents/skills/modeler/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "modeler", then confirm the skill loads.
Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add sidequery/sidemantic --skill modeler -a cursor
Project install goes to .agents/skills/; add -g for ~/.cursor/skills/.
Install the "modeler" agent skill from https://github.com/sidequery/sidemantic/tree/main/plugins/sidemantic/skills/modeler into .cursor/skills/modeler/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "modeler", then confirm the skill loads.
Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
skills CLI
$ npx skills add sidequery/sidemantic --skill modeler -a gemini-cli
Project install goes to .agents/skills/; add -g for ~/.gemini/skills/.
Install the "modeler" agent skill from https://github.com/sidequery/sidemantic/tree/main/plugins/sidemantic/skills/modeler into .gemini/skills/modeler/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "modeler", then confirm the skill loads.
Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
GitHub CLI
$ gh skill install sidequery/sidemantic modeler
Installs for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
skills CLI
$ npx skills add sidequery/sidemantic --skill modeler -a github-copilot
Project install goes to .agents/skills/; add -g for ~/.copilot/skills/.
Install the "modeler" agent skill from https://github.com/sidequery/sidemantic/tree/main/plugins/sidemantic/skills/modeler into .github/skills/modeler/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "modeler", then confirm the skill loads.
GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add sidequery/sidemantic --skill modeler -a opencode
OpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
Install the "modeler" agent skill from https://github.com/sidequery/sidemantic/tree/main/plugins/sidemantic/skills/modeler into .opencode/skills/modeler/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "modeler", then confirm the skill loads.
OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Facts
Skill name
modeler
GitHub stars
129
Token cost
~4.2k tokens
SKILL.md length
1,269 words
Files
6 (incl. references)
Skills in repo
3
Repo updated
First seen
Licence
Apache-2.0
At a glance
Build, validate, and manage semantic models using Sidemantic.
Works in 7 steps: Analyze the database schema → Create Model definitions → Define Dimensions → …
Asked to create a semantic layer
SKILL.md covers Quick Start, Generate Models from SQL Queries, Core Workflow and Segments, plus 7 more sections
Calls uv
What it does
Modeler is an agent skill from sidequery/sidemantic. Build, validate, and manage semantic models using Sidemantic. Use when asked to create a semantic layer, define metrics/dimensions, model a database schema, generate models from SQL queries, import from Cube/dbt/LookML, or set up analytics definitions. Prioritizes CLI-first workflows, with YAML and optional Python API usage for advanced automation.
Its SKILL.md is about 4.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/generation.md`, `references/migration.md` and `references/patterns.md`).
It sits in Databases, covering SQL, Data pipelines and ETL and Database schema design. It works with SQL, Python, dbt and DuckDB. The repository describes itself as: The universal metrics layer. Compatible with 15+ formats: Cube, MetricFlow, LookML, Omni, BSL, LDM, Cortex, Malloy, OSI, SML, TML, Hex, Rill, Superset. The licence is Apache-2.0.
When your agent uses it
Asked to create a semantic layer
Define metrics/dimensions
Model a database schema
Generate models from SQL queries
Example prompts
“/modeler”
Requirements
Python 3
Workflow steps
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit db203eb. It shows what the files ask for, not the result of running them.
Tool permissions
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Runs code
Shell commands in SKILL.md call:
uv
From the folder's file list and the shell code blocks in SKILL.md.
Network
No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Credentials
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Context cost
Modeler loads about 4.2k tokens when it runs, and up to ~21k if it reads all its reference files. Until then it costs about 90 tokens; SKILL.md has 1,269 words of instructions outside code blocks.
Always· name and description, kept in context so the agent knows when to use it
~90
When it runs· the whole SKILL.md, loaded when a task matches
~4.2k
With references· SKILL.md plus every file in references/, read only if the agent opens them
~21k
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
Safety
Auto-check passed
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
Download SKILL.mdSave it as .claude/skills/modeler/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
modeler
description
Build, validate, and manage semantic models using Sidemantic. Use when asked to create a semantic layer, define metrics/dimensions, model a database schema, generate models from SQL queries, import from Cube/dbt/LookML, or set up analytics definitions. Prioritizes CLI-first workflows, with YAML and optional Python API usage for advanced automation.
license
Apache-2.0
metadata.author
sidemantic
metadata.version
1.0
Sidemantic Modeler
Build semantic layers that map physical database tables to business-friendly dimensions and metrics. Sidemantic generates SQL from these definitions, handling joins, aggregations, granularity, and dialect differences automatically.
Quick Start
2-Minute First Success (CLI-first onboarding path)
bash
uv add sidemantic duckdb
mkdir -p models
cat > models/orders.yml <<'YAML'
models:
- name: orders
table: orders
primary_key: order_id
dimensions:
- name: status
type: categorical
metrics:
- name: revenue
agg: sum
sql: order_amount
- name: order_count
agg: count
YAML
uv run sidemantic validate models/ --verbose
uv run sidemantic info models/
uv run sidemantic query \
"SELECT revenue, status FROM orders ORDER BY revenue DESC LIMIT 5" \
--models models/ --connection duckdb:///data.duckdb --format json
Assumes an orders table already exists in data.duckdb with status and order_amount columns.
Use --format json or --format jsonl when consuming CLI results in automation;
use --plain for stable tab-separated text. Primary data is stdout and status is
stderr, so do not merge the streams before parsing.
YAML (preferred for file-based models)
yaml
models:
- name: orders
table: orders
primary_key: order_id
dimensions:
- name: status
type: categorical
- name: order_date
type: time
sql: created_at
granularity: day
metrics:
- name: revenue
agg: sum
sql: order_amount
- name: order_count
agg: count
Load and query:
python
from sidemantic import SemanticLayer
layer = SemanticLayer.from_yaml("models.yml", connection="duckdb:///data.duckdb")
result = layer.sql("SELECT revenue, status FROM orders")
Python API (advanced, optional)
python
from sidemantic import Model, Dimension, Metric, SemanticLayer
layer = SemanticLayer(connection="duckdb:///data.duckdb")
Model(
name="orders",
table="orders",
primary_key="order_id",
dimensions=[
Dimension(name="status", type="categorical"),
Dimension(name="order_date", type="time", sql="created_at", granularity="day"),
],
metrics=[
Metric(name="revenue", agg="sum", sql="order_amount"),
Metric(name="order_count", agg="count"),
],
)
result = layer.sql("SELECT revenue, status FROM orders")
Generate Models from SQL Queries
The fastest path when existing queries are available. The Migrator reverse-engineers semantic models by analyzing SQL: it extracts tables, columns, aggregations, joins, time dimensions, derived metrics, and window functions automatically.
CLI (bootstrap from a folder of .sql files)
bash
# Generate model YAML + rewritten queries from raw SQL
sidemantic migrate generate queries/ --output output/
# Check coverage: how well do existing models handle these queries?
sidemantic migrate check queries/ --models models/ --verbose
Python API (advanced/automation only)
python
from sidemantic import SemanticLayer
from sidemantic.core.migrator import Migrator
# Connect to your database (optional but improves inference via information_schema)
layer = SemanticLayer(connection="duckdb:///data.duckdb", auto_register=False)
migrator = Migrator(layer, connection=layer.conn)
# Feed it SQL queries (strings, not files)
queries = [
"SELECT status, SUM(amount) AS revenue, COUNT(*) AS orders FROM orders GROUP BY status",
"SELECT DATE_TRUNC('month', created_at), SUM(amount) FROM orders GROUP BY 1",
"SELECT c.region, SUM(o.amount) / COUNT(DISTINCT c.id) AS rev_per_customer "
"FROM orders o JOIN customers c ON o.customer_id = c.id GROUP BY 1",
]
report = migrator.analyze_queries(queries)
models = migrator.generate_models(report) # YAML-ready model dicts
graph_metrics = migrator.generate_graph_metrics(report, models) # cross-model metrics
rewritten = migrator.generate_rewritten_queries(report) # semantic SQL
# Write to disk
migrator.write_model_files(models, "output/models/")
migrator.write_rewritten_queries(rewritten, "output/rewritten_queries/")
# Print coverage report
migrator.print_report(report, verbose=True)
What the Migrator auto-detects
Pattern in SQL
What it generates
SUM(amount) / COUNT(*) / AVG(price)
Metric with matching agg
COUNT(DISTINCT user_id)
Metric with agg: count_distinct
SUM(amount) AS revenue
Metric named revenue (preserves aliases)
GROUP BY status
Dimension type: categorical
DATE_TRUNC('month', created_at)
Dimension type: time, granularity extracted from SQL (here: month)
Run coverage check to verify queries can be rewritten through the semantic layer
Iterate until coverage is high
For the full Migrator API (all methods, outputs, edge cases), load references/generation.md.
Core Workflow
Follow these steps when building a semantic model from a database schema.
Step 1: Analyze the database schema
Inspect tables, columns, data types, and foreign key relationships. Identify which tables hold transactional/event data (fact tables) and which hold descriptive attributes (dimension tables).
Step 2: Create Model definitions
For each table, create a Model with:
name: a short, snake_case identifier
table: schema-qualified table name (e.g., public.orders)
primary_key: the table's primary key column (default: id)
Use sql instead of table for derived/virtual tables built from a SQL expression.
Step 3: Define Dimensions
Add dimensions for columns used in GROUP BY or WHERE clauses. Choose the correct type:
Type
When to use
Example
categorical
Strings, enums, IDs for grouping
status, region
time
Dates/timestamps (enables granularity)
created_at, order_date
boolean
Computed true/false from SQL expression
sql: "amount > 100"
numeric
Numbers used for grouping, not aggregation
quantity_bucket
Time dimensions require granularity (one of: second, minute, hour, day, week, month, quarter, year). Queries use double-underscore syntax: orders.order_date__month.
Use sql when the dimension maps to a different column name or a computed expression. If omitted, defaults to a column matching name.
Set parent on dimensions to create drill-down hierarchies (e.g., country > state > city).
Step 4: Define Metrics
Add metrics for columns that should be aggregated.
Use filters on a metric to create filtered aggregations (e.g., filters: ["status = 'completed'"]). These become CASE WHEN expressions, not WHERE clauses.
Complex metrics (usually graph-level, in top-level metrics: section):
Graph-level metrics sit in the top-level metrics: section (outside models:). They reference model-level measures using model.metric syntax.
Step 5: Define Relationships
Connect models with relationships so Sidemantic can auto-generate JOINs.
Type
Direction
Example
many_to_one
This model has FK to other
orders -> customers
one_to_one
Unique FK
user -> user_profile
one_to_many
Other model has FK to this
customer -> orders
many_to_many
Through junction table
students <-> courses
Declare relationships on the model that owns the foreign key. For many_to_one, foreign_key defaults to {related_model}_id.
For many_to_many, specify through (junction model), through_foreign_key, and related_foreign_key.
Step 6: Validate and inspect
bash
# Validate definitions (checks for errors and warnings)
sidemantic validate models/ --verbose
# Quick summary of what's defined
sidemantic info models/
Step 7: Test with queries
bash
# Validate and inspect without writing code
uv run sidemantic validate models/ --verbose
uv run sidemantic info models/
# Execute semantic SQL through CLI
uv run sidemantic query \
"SELECT revenue, status FROM orders WHERE status = 'completed'" \
--models models/ --connection duckdb:///data.duckdb
Python API (optional):
python
# Structured query API
result = layer.query(
metrics=["orders.revenue"],
dimensions=["orders.status", "orders.order_date__month"],
filters=["orders.status = 'completed'"],
order_by=["orders.revenue DESC"],
limit=10,
)
# SQL interface (auto-rewrites through semantic layer)
result = layer.sql("SELECT revenue, status FROM orders WHERE status = 'completed'")
# Compile to SQL without executing
sql = layer.compile(metrics=["orders.revenue"], dimensions=["customers.region"])
Segments
Reusable named WHERE filters applied at query time. Unlike metric filters, segments affect all metrics in the query.
Segments are model-scoped and used as model.segment references at query time:
bash
uv run sidemantic query \
"SELECT revenue, status FROM orders WHERE completed_orders" \
--models models/ --connection duckdb:///data.duckdb
Python API (optional):
python
result = layer.query(
metrics=["orders.revenue"],
dimensions=["orders.status"],
segments=["orders.completed_orders"],
)
Show full SKILL.md (518 more words)Show less
Loading from Other Formats
CLI-first:
bash
uv run sidemantic info path/to/models/
uv run sidemantic validate path/to/models/ --verbose
Python API (optional):
python
from sidemantic import SemanticLayer, load_from_directory
layer = SemanticLayer(connection="duckdb:///data.duckdb")
load_from_directory(layer, "path/to/models/")
Auto-detects: Cube (.yml with cubes:), dbt MetricFlow (.yml with semantic_models:), LookML (.lkml), Malloy (.malloy), Rill, Hex, Snowflake Cortex, and more.
For detailed field mappings from each format, load references/migration.md.
Auto-Registration
When SemanticLayer() is created with auto_register=True (the default), it sets itself as the "current layer." Any Model() or Metric() constructed while a layer is active auto-registers with it. This is why the Quick Start examples don't call layer.add_model().
If you create Models before creating a SemanticLayer, they won't be registered. Either create the layer first, or use layer.add_model(model) explicitly.
Jinja2 Parameters
SQL expressions in models support Jinja2 templating:
yaml
models:
- name: orders
sql: "SELECT * FROM orders WHERE region = '{{ region }}'"
Pass values at query time:
python
result = layer.query(metrics=["orders.revenue"], parameters={"region": "US"})
CLI Reference
All commands are run as sidemantic <command>. Use --config path/to/sidemantic.yaml to load a config file with connection and model path settings.
Command
Purpose
validate [DIR] --verbose
Validate definitions, show errors and warnings
info [DIR]
Summary of models, dimensions, metrics, relationships
query [DIR] -c CONNECTION SQL
Execute SQL through the semantic layer (--format table/json/csv, --limit N)
migrator [DIR] --queries PATH
Coverage analysis: check how well models handle SQL queries
migrator --queries PATH --generate-models OUT
Bootstrap: generate model YAML from SQL queries
preagg recommend [DIR]
Recommend pre-aggregation tables from query patterns
Missing granularity on time dimensions. Every type: time dimension needs granularity: day (or similar).
Simple metric without agg. Metrics that are not complex types need an agg field (sum, count, avg, etc.) or a full SQL expression like sql: "SUM(amount)".
Unqualified fields in multi-model queries. Single-model SQL can use unqualified names (SELECT revenue FROM orders), but cross-model queries should use explicit model.field.
No relationship path between models. Cross-model queries require a chain of relationships connecting all involved models.
Using type: string or type: number for dimensions. The valid types are categorical, time, boolean, numeric.
Confusing model-level vs graph-level metrics. Model-level metrics use agg. Graph-level metrics (ratio, derived, etc.) go in the top-level metrics: section.
Plural relationship names create wrong FK defaults. Relationship named customers defaults FK to customers_id, not customer_id. Always set foreign_key explicitly.
SQL expressions with YAML special characters. Quote SQL containing :, #, {, or >.
Duplicate model or metric names. Names must be unique across the entire semantic layer.
Creating Models before SemanticLayer. With auto-registration (default), Models must be created after the SemanticLayer, or they won't register.
Modeler next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
A skill your agent uses when writing Snowflake SQL, building data pipelines with Dynamic Tables or Streams/Tasks, using Cortex AI functions, creating Cortex Agents, writing Snowpark Python…
A skill your agent uses when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse…
Build, validate, and manage semantic models using Sidemantic. Modeler is an agent skill from sidequery/sidemantic. Build, validate, and manage semantic models using Sidemantic.
When should I use Modeler?
Modeler fits situations like: asked to create a semantic layer; define metrics/dimensions; model a database schema; generate models from SQL queries.
How do I install Modeler in Claude Code?
Run `npx skills add sidequery/sidemantic --skill modeler -a claude-code`. Or copy the skill folder (plugins/sidemantic/skills/modeler in sidequery/sidemantic) into .claude/skills/modeler in your project. Claude Code loads it when a task matches its description.
How do I install Modeler in Codex?
Run `npx skills add sidequery/sidemantic --skill modeler -a codex`. Or copy the skill folder (plugins/sidemantic/skills/modeler in sidequery/sidemantic) into .agents/skills/modeler in your project. Codex loads it when a task matches its description.
Can I use Modeler in Cursor, Gemini CLI or GitHub Copilot?
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sidequery/sidemantic --skill modeler -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/modeler, .gemini/skills/modeler, .github/skills/modeler and .opencode/skills/modeler in your project.
What does Modeler need to run?
Going by SKILL.md and its folder, Modeler needs the command-line tools its instructions call (uv). Our summary lists: Python 3.
Does Modeler access the network?
SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Is Modeler safe to install?
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
What licence does Modeler use?
Modeler is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
How many tokens does Modeler use?
About 4.2k tokens (SKILL.md is roughly 17k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 17k tokens, read only when the agent opens those files.
What are the alternatives to Modeler?
Skills that share tags, products or a category with Modeler: Snowflake Development (sickn33/agentic-awesome-skills, 47k stars), Snowflake Development (alirezarezvani/claude-skills, 28k stars), Analytics Engineer (borghei/Claude-Skills, 874 stars) and Chdb SQL (vemetric/vemetric, 394 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Who maintains Modeler?
sidequery (a GitHub organization) maintains it in sidequery/sidemantic, which has 129 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 7, 2026.
Source: sidequery/sidemantic on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.