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 skills add saajunaid/caddis-plugin --skill db-diagramgit clone --depth 1 https://github.com/saajunaid/caddis-pluginWrote 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/skills/saajunaid/caddis-plugin/db-diagram)<a href="https://agentmods.dev/skills/saajunaid/caddis-plugin/db-diagram"><img src="https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/db-diagram/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/skills/saajunaid/caddis-plugin/db-diagram"><img src="https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/db-diagram.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.00054 | $0.02422 |
| Opus 5.5 | $0.00022 | $0.00969 |
| Sonnet 5.5 | $0.00011 | $0.00484 |
| Haiku 4.5 | $0.00005 | $0.00242 |
Grade A, and why
db-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 25d 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 — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.
db-diagram — explain SQL as a diagram
Take a SQL artifact and produce a diagram that explains it to a human. Two output formats, one shared extraction: Mermaid (default — plain text, diffs cleanly, renders in VS Code/Gitea, regenerable) and Excalidraw (for a design review / ARB pack / slide — someone drags boxes around).
The structure is extracted deterministically by scripts/sql_to_graph.py (a real sqlglot-based
parser); you (the model) add the business narration on top. Never hand-derive the node graph when the
script can run — its whole value is reproducibility.
Two non-negotiable safety rules
- Never write to the database. Read-only by definition — no DDL, no DML, not even in a rolled-back transaction. The extractor only ever parses SQL text.
- Never guess schema. Inspect the actual tables/columns before diagramming. If you can't reach the database, diagram only what's provable from the SQL text and mark inferred elements clearly.
Step 1 — get the SQL
Resolve the argument:
- A file path → read that file.
- A database object name (proc/view/table) → look it up. Prefer a registered DB MCP tool if one
is available in the session; else
sqlcmd/psqlread-only; else ask the user to paste it. Never guess an object's body. - No argument → operate on the SQL in the current file/context, or ask.
- Multiple objects → diagram the relationships between them, in ONE diagram — not one diagram each.
Step 2 — run the deterministic extractor
python <skill-dir>/scripts/sql_to_graph.py --file <path> # Mermaid block (default)
python <skill-dir>/scripts/sql_to_graph.py --file <path> --format excalidraw # native .excalidraw JSON
python <skill-dir>/scripts/sql_to_graph.py --file <path> --format html --title "..." # self-contained page
python <skill-dir>/scripts/sql_to_graph.py --file <path> --format svg # self-contained .svg
python <skill-dir>/scripts/sql_to_graph.py --sql "<SELECT ...>" --json # full graph JSON
All five formats (mermaid | excalidraw | svg | html | json) come from one deterministic layout
— same SQL always produces byte-identical output, boxes are grid-aligned, and every label is wrapped to fit
inside its box.
What ships with it
1 file 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.
- 25d ago Changed · -30 tokens per session 402ed977d857
- 2mo ago Changed · -31 tokens per session 85e0f696a49a
- 2mo ago First seen · 149 lines · 115 tokens per session scan A acf0ca468b14
db-diagram is a skill published in the GitHub repository saajunaid/caddis-plugin (0 stars, last pushed 4d ago), licensed MIT. It adds 54 tokens to every session and 2,422 once invoked, about $0.0002 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-09-03.
db-diagram compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| db-diagramsaajunaid/caddis-plugin | Skill | 0 | 4d ago | MIT | A | 54 | Claude Code |
| goga-discoverqarium/goga | Skill | 46 | 8d ago | BSD-3-Clause | A | 31 | Claude Code, Codex |
| qdrant-integrationa5c-ai/babysitter | Skill | 1.9k | 29d ago | MIT | A | 21 | Claude Code |
| goga-review-planqarium/goga | Skill | 46 | 8d ago | BSD-3-Clause | A | 11 | Claude Code, Codex |
| goga-define-challengeqarium/goga | Skill | 46 | 8d ago | BSD-3-Clause | A | 6 | Claude Code, Codex |
| skill-creatoreigent-ai/eigent | Skill | 16k | today | Apache-2.0 | A | 35 | Claude Code, Codex |
| goga-prototype-contractsqarium/goga | Skill | 46 | 8d ago | BSD-3-Clause | A | 18 | Claude Code, Codex |