om-grounded-sql

om-grounded-sql is a skill for Claude Code, Codex from calvinchengx/data-agent-service. It costs 24 tokens per session (762 once invoked), scanned A, original, Apache-2.0.

A method for writing SQL only from definitions and fields recorded in a data catalog. A data catalog documents what business terms, metrics, tables, and columns mean.

In plain words
What is it for?
Finding catalog definitions, reading metric formulas and table details, translating those definitions into SQL, and stopping when the catalog cannot support the requested answer.
Why use it?
It reduces the risk of producing plausible numbers from the wrong table, metric, or business definition by requiring the meaning and source to be checked first.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/calvinchengx/data-agent-service/om-grounded-sql
Any agent
npx skills add calvinchengx/data-agent-service --skill om-grounded-sql
Clone the repo
git clone --depth 1 https://github.com/calvinchengx/data-agent-service

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for om-grounded-sql

README.md
[![agentmods](https://agentmods.dev/badge/skills/calvinchengx/data-agent-service/om-grounded-sql.svg)](https://agentmods.dev/skills/calvinchengx/data-agent-service/om-grounded-sql)
Your own site
<a href="https://agentmods.dev/skills/calvinchengx/data-agent-service/om-grounded-sql"><img src="https://agentmods.dev/badge/skills/calvinchengx/data-agent-service/om-grounded-sql.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 762 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00024 $0.00762
Opus 5 $0.00012 $0.00381
Sonnet 5 $0.00005 $0.00152
Haiku 4.5 $0.00002 $0.00076

Measured 5d ago against content hash 94e3eae5ebc6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

om-grounded-sql scanned grade A with 0 findings 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 5d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agent/skills/om-grounded-sql/SKILL.md · 49 lines

How it starts

The opening of the file, as written. The whole thing — 49 lines — stays where its author put it; the contents beside it link to each section on GitHub.

The method, step by step. Skipping a step is how a plausible wrong number gets reported.

1. Extract the business terms, then search the catalog for each one

Pull the nouns and measures out of the question (" by for "). Call the catalog's search_metadata once per term. Read the glossary terms and metrics in the result before any table — a term with a definition is the question's meaning; a table is only where the data lives.

2. Read the entity, not the hit list

A search hit is a name and a score. Call get_entity_details on the glossary term, metric, or table you intend to use and read:

  • description — the definition in prose. Look for exclusions ("excludes…", "only…", "as of…"), units, and the period convention.
  • on a metric: expression / formula and unitOfMeasurement. The formula is the definition. Translate it into SQL literally — do not simplify, re-derive, or "improve" it.
  • on a table: columns[].description, columns[].tags, tableConstraints (keys), and owners. A column description that says "use for " is an instruction.
  • on a glossary term: relatedTerms and tags — a term that points to a table or column is telling you where it is computed.

3. Choose the asset the catalog recommends

When one table is described as the reporting aggregate for a measure and another is the raw fact, prefer the aggregate. Re-deriving a figure from raw facts is only right when the question needs a breakdown the aggregate does not carry — and then the aggregate's description tells you the grain you must reproduce.

4. Describe before you reference

Call the warehouse's describe_table for every table in the query. Take column names, types, and join keys from that call only. Never infer a join from similar names.

5. Write exactly one SELECT, then run it

One statement. No DDL, no DML, no CTE that writes, no multiple statements. Do not add a row limit — the executor applies the ceiling. Prefer explicit column lists over *; the access rules are per column and a withheld column in * fails the whole query.

Read the full file on GitHub · 49 lines

Changes

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.

  1. 5d ago First seen · 49 lines · 24 tokens per session scan A 94e3eae5ebc6

Subscribe to this mod's changes

om-grounded-sql is a skill published in the GitHub repository calvinchengx/data-agent-service (0 stars, last pushed 3d ago), licensed Apache-2.0. It adds 24 tokens to every session and 762 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

azure-resource-manager-mysql-dotnet

Azure MySQL Flexible Server SDK for .NET. Database management for MySQL Flexible Server deployments. Use for creating servers, databases, firewall rules, configurations, backups, and high availability. Triggers: "MySQL", "MySqlFlexibleServer", "MySQL Flexible Server", "Azure Database for MySQL", "MySQL database…

microsoft/skills · 87 tokens

azure-resource-manager-postgresql-dotnet

Azure PostgreSQL Flexible Server SDK for .NET. Database management for PostgreSQL Flexible Server deployments. Use for creating servers, databases, firewall rules, configurations, backups, and high availability. Triggers: "PostgreSQL", "PostgreSqlFlexibleServer", "PostgreSQL Flexible Server", "Azure Database for…

microsoft/skills · 97 tokens

azure-postgres-ts

Connect to Azure Database for PostgreSQL Flexible Server from Node.js/TypeScript using the pg (node-postgres) package. Use for PostgreSQL queries, connection pooling, transactions, and Microsoft Entra ID (passwordless) authentication. Triggers: "PostgreSQL", "postgres", "pg client", "node-postgres", "Azure PostgreSQL…

microsoft/skills · 94 tokens

azure-mgmt-mongodbatlas-dotnet

Manage MongoDB Atlas Organizations as Azure ARM resources using Azure.ResourceManager.MongoDBAtlas SDK. Use when creating, updating, listing, or deleting MongoDB Atlas organizations through Azure Marketplace integration. This SDK manages the Azure-side organization resource, not Atlas clusters/databases directly.

microsoft/skills · 64 tokens

azure-resource-manager-redis-dotnet

Azure Resource Manager SDK for Redis in .NET. Use for MANAGEMENT PLANE operations: creating/managing Azure Cache for Redis instances, firewall rules, access keys, patch schedules, linked servers (geo-replication), and private endpoints via Azure Resource Manager. NOT for data plane operations (get/set keys, pub/sub) …

microsoft/skills · 114 tokens

azure-resource-manager-sql-dotnet

Azure Resource Manager SDK for Azure SQL in .NET. Use for MANAGEMENT PLANE operations: creating/managing SQL servers, databases, elastic pools, firewall rules, and failover groups via Azure Resource Manager. NOT for data plane operations (executing queries) - use Microsoft.Data.SqlClient for that. Triggers: "SQL…

microsoft/skills · 109 tokens