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.
npx agentmods add skills/andre-salvati/databricks-template/sql-diagramnpx skills add andre-salvati/databricks-template --skill sql-diagramgit clone --depth 1 https://github.com/andre-salvati/databricks-templateWhat 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 | $0.00121 | $0.03247 |
| Opus 5 | $0.00060 | $0.01623 |
| Sonnet 5 | $0.00024 | $0.00649 |
| Haiku 4.5 | $0.00012 | $0.00325 |
Grade A, and why
sql-diagram 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 3d 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.
How it starts
The opening of the file, as written. The whole thing — 182 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Diagramming a SQL query
Diagram a SQL query and explain what it shows — either its execution steps or its column lineage.
Steps
- Get the SQL. If the user named a file, use it. If the query is embedded in Python (most of this
repo's SQL lives in f-strings under
scripts/), extract it to a scratch.sqlfile first and replace the interpolated placeholders with literals —sqlglotparses SQL, not f-strings. - Pick the mode.
mode=plan(the default) answers "what does this query do, step by step";mode=lineageanswers "where does this output column come from". When the user asks about joins, stages, filters or ordering, they wantplan. - Run
make sql-diagram sql=<path> name=<basename> comments=1via Bash. It writes three files toreports/sql-diagram/:<basename>.sql(the query as analysed),.mmdand.svg. All ofreports/is gitignored generated output — nevergit add -fout of it. To keep a diagram as a committed example, copy the trio into.claude/skills/sql-diagram/examples/and re-run against the copied.sql; because that file is the post-substitution query, the run reproduces the diagram exactly, which is why the.sqlis kept beside the picture. Pass--stdouttoscripts/sql_diagram.pyfor a throwaway look with no files written. - Read the
.mmd, show it in a ```mermaid fence, and explain it (see below). The.svgis the same graph for linking from prose where no Mermaid renderer is available. - Simulate the query on small data (see Simulation) and deliver the diagram and
the trace together as one HTML page in
reports/sql-diagram/<basename>.html.
Explaining a query and reviewing one are different jobs. For an explanation the diagram is
enough. For a review, read the .sql alongside it and treat the graph as an index into the text:
it is authoritative on scans, joins and join predicates, and silent on filters, windows and
projections (see the blind spots below). Defects severe enough to produce wrong numbers usually live
in exactly the parts the picture omits.
What ships with it
4 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.
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.
- 3d ago First seen · 182 lines · 121 tokens per session scan A 8766b60b237e
sql-diagram is a skill published in the GitHub repository andre-salvati/databricks-template (83 stars, last pushed 27d ago), licensed Apache-2.0. It adds 121 tokens to every session and 3,247 once invoked, about $0.0006 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-30.
Other skills, from other repositories
data-parity
Validate that two tables or query results are identical — or diagnose exactly how they differ. Discover schema, identify keys, profile cheaply, then diff. Use for migration validation, ETL regression, and query refactor verification.
dbt-develop
REQUIRED before writing or modifying ANY dbt model. Invoke this skill FIRST whenever a task says "create", "build", "add", "modify", "update", "fix", or "refactor" a dbt model, staging file, mart, incremental, or snapshot. Skipping this skill is the leading cause of silent-correctness bugs — models that compile and…
dbt-troubleshoot
Debug dbt errors — compilation failures, runtime database errors, test failures, wrong data, and performance issues. Use when something is broken, producing wrong results, or failing to build. Powered by altimate-dbt.
dbt-schema-verify
REQUIRED after building or modifying ANY dbt model that has columns declared in schema.yml / models.yml. Run altimate-dbt schema-verify --model to diff actual columns against the spec, and treat any mismatch verdict as "not done." The most common reason "the build is green but the tests still fail" is that the model…
cost-report
Analyze Snowflake query costs and identify optimization opportunities.
dbt-test
Add schema tests, unit tests, and data quality checks to dbt models. Use when validating data integrity, adding test definitions to schema.yml, writing unit tests, or practicing test-driven development in dbt. Powered by altimate-dbt.