sql-rules

sql-rules is a skill for Claude Code, Codex from datagallery-ai/dataagent. It costs 76 tokens per session (403 once invoked), scanned A, original, Apache-2.0.

A set of rules for writing and reviewing production SQL that creates warehouse tables or inserts warehouse data. It covers separate rules for table definitions and data-inserting statements, including how the files should be stored.

In plain words
What is it for?
Use it when creating, reviewing, or modifying warehouse DDL or DML, especially when a task delivers both a table definition and an INSERT file.
Why use it?
It prevents common inconsistencies in table definitions and data-loading SQL, such as mismatched columns or partitions. It also keeps generated SQL out of the read-only rules directory.

Skill for Claude CodeCodex

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

Good fit Use it when creating, reviewing, or modifying warehouse DDL or DML, especially when a task delivers both a table definition and an INSERT file.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/datagallery-ai/dataagent/sql-rules
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.

Any agent
npx skills add datagallery-ai/dataagent --skill sql-rules
Clone the repo
git clone --depth 1 https://github.com/datagallery-ai/dataagent

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 sql-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/datagallery-ai/dataagent/sql-rules/github.svg)](https://agentmods.dev/skills/datagallery-ai/dataagent/sql-rules)
Your own site
<a href="https://agentmods.dev/skills/datagallery-ai/dataagent/sql-rules"><img src="https://agentmods.dev/badge/skills/datagallery-ai/dataagent/sql-rules/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.

agentmods 80×15 button for sql-rules

Your own site · 80×15
<a href="https://agentmods.dev/skills/datagallery-ai/dataagent/sql-rules"><img src="https://agentmods.dev/badge/skills/datagallery-ai/dataagent/sql-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 403 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00076 $0.00403
Opus 5.5 $0.00030 $0.00161
Sonnet 5.5 $0.00015 $0.00081
Haiku 4.5 $0.00008 $0.00040

Measured 2d ago against content hash e995a5360f83, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sql-rules 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 2d 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.

dataagent/plugins/de-agent/skills/sql-rules/SKILL.md · 36 lines

What it actually says

SQL Rules(数仓生产规范)

文档内容

  • references/ddl_rules.md:DDL 的建表语法规则。
  • references/dml_rules.md:DML 的 INSERT 语法规则和通用规则(含空值判断、CAST 方言类型约束等)。

读取原则

  • 编写、修改或审核 DDL(create_<table>.sql)之前,使用 read_file 读取:
references/ddl_rules.md
  • 编写、修改或审核 DML(insert_<table>.sql)之前,使用 read_file 读取:
references/dml_rules.md
  • 同时交付 DDL 和 DML 时,先读取 DDL 规则编写 DDL;审核或修改 DML 前再读取 DML 规则,并核对两者的分区列集合和字段顺序。

使用约定

  • 本 skill 目录为只读;生成的 DDL/DML 写入 当前会话 outputs/sql,禁止写入 skill 目录。
  • DDL 专属规则维护在 references/ddl_rules.md,DML 与通用查询规则维护在 references/dml_rules.md。不要把规则复制进 主 Agent 的数据工程指令 或其他文档,避免多份漂移。
  • 修改已有 DML 时遵循最小变更原则:只改规范所必需的部分,不重构无关逻辑。
Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 36 lines · 76 tokens per session scan A e995a5360f83

Subscribe to this mod's changes

sql-rules is a skill published in the GitHub repository datagallery-ai/dataagent (748 stars, last pushed 3d ago), licensed Apache-2.0. It adds 76 tokens to every session and 403 once invoked, about $0.0003 per session on Opus 5.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-11-28.

Related

sql-rules compared with skills from other repositories

sql-rules next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
sql-rulesdatagallery-ai/dataagentSkill7483d agoApache-2.0A76Claude Code, Codex
fetch-dataagentscope-ai/QwenPaw-DataSkill2085d agoApache-2.0A286Claude Code, Codex
cm-skillsagentscope-ai/QwenPaw-DataSkill2085d agoApache-2.0A73Claude Code, Codex
query-odpsagentscope-ai/QwenPaw-DataSkill2085d agoApache-2.0A111Claude Code, Codex
sql-analysisrunxhq/runxSkill106yesterdayApache-2.0A43Claude Code, Codex
setup-data-workspacedanielrosehill/Claude-Data-Analyst-pluginSkill1327d agoMITA73Claude Code
documentdb-collection-adminKnuckles-Team/documentdb-mcpSkill24d agoMITA78Claude Code, Codex