sql-database-assistant

sql-database-assistant is a skill for Claude Code, Codex from Morningstar202604/awesome-skillkit. It costs 69 tokens per session (4,497 once invoked), scanned A, original, Apache-2.0.

An assistant for working with SQL databases and database libraries such as Prisma, Drizzle, TypeORM, and SQLAlchemy. It helps translate requirements into queries, inspect schemas, analyze query performance, and create migration templates.

In plain words
What is it for?
Use it to write or optimize SQL, explore PostgreSQL, MySQL, SQLite, or SQL Server schemas, detect N+1 query patterns, recommend indexes, and prepare reversible or low-downtime migrations.
Why use it?
It reduces the manual work of writing database queries, finding slow operations, understanding existing tables, and planning schema changes safely.

Skill for Claude CodeCodex

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

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 scripts/schema_explorer.py --sqlite assets/sample.db --table users --json # bundled sample DB (users/orders, two tables); swap in app.db for your real.

Good fit Use it to write or optimize SQL, explore PostgreSQL, MySQL, SQLite, or SQL Server schemas, detect N+1 query patterns, recommend indexes, and prepare reversible or low-downtime migrations.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Morningstar202604/awesome-skillkit
agentmods
npx agentmods add skills/morningstar202604/awesome-skillkit/sql-database-assistant

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-database-assistant

README.md
[![agentmods](https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/sql-database-assistant/github.svg)](https://agentmods.dev/skills/morningstar202604/awesome-skillkit/sql-database-assistant)
Your own site
<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/sql-database-assistant"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/sql-database-assistant/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-database-assistant

Your own site · 80×15
<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/sql-database-assistant"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/sql-database-assistant.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,497 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.00069 $0.04497
Opus 5.5 $0.00028 $0.01799
Sonnet 5.5 $0.00014 $0.00899
Haiku 4.5 $0.00007 $0.00450

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

Security

Grade A, and why

sql-database-assistant 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 28d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/migration_generator.py, scripts/query_optimizer.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

site/skills/programming/database/sql-database-assistant/SKILL.md · 417 lines

How it starts

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

SQL Database Assistant

The day-to-day companion to database-designer. database-designer focuses on schema architecture, ERD modeling, and multi-tenancy patterns; this skill covers the everyday: writing queries, optimizing performance, generating migrations, and bridging app code with the database engine.

Workflow

This skill proceeds through the following main flow; detailed rules for each stage are in the corresponding sections below:

  1. Take the request: distinguish whether it's "write as SQL", "optimize existing SQL", or "design/migrate a schema" (see Natural-language-to-SQL / Query optimization / Migration generation)
  2. Feel out the schema: confirm the table structure and column types, don't guess (see Schema exploration)
  3. Produce: hand over the SQL or migration script, and state the assumptions (see Delivery criteria)
  4. Optimize and validate: when there's a performance problem, run index and execution-plan analysis (see Query optimization)
  5. Self-check: run it against the safety red lines and failure table before delivering

When the target database differs, first confirm dialect differences in the Multi-database support section to avoid syntax incompatibility.

Core Capabilities

  • Natural-language to SQL — translate a request into a correct and efficient query
  • Schema exploration — introspect live PostgreSQL, MySQL, SQLite, and SQL Server databases
  • Query optimization — EXPLAIN analysis, index recommendations, rewrite patterns
  • Migration generation — up/down scripts, zero-downtime strategies, rollback plans
  • ORM integration — Prisma, Drizzle, TypeORM, SQLAlchemy patterns and escape hatches

Tools

Script Purpose
scripts/query_optimizer.py Statically analyze SQL queries for performance problems
scripts/migration_generator.py Generate migration-file templates from a change description
scripts/schema_explorer.py Turn introspection results (or a SQLite file) into schema docs

Read the full file on GitHub · 417 lines

Files

What ships with it

5 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. 28d ago Changed · -2 lines · -7 tokens per session 4795ef0f4986
  2. 1mo ago Changed · -2 lines ab180115ffe5
  3. 1mo ago Changed · -42 lines · +31 tokens per session 1eae40979fba
  4. 1mo ago First seen · 463 lines · 45 tokens per session scan A 145df2dbde77

Subscribe to this mod's changes

sql-database-assistant is a skill published in the GitHub repository Morningstar202604/awesome-skillkit (0 stars, last pushed 23d ago), licensed Apache-2.0. It adds 69 tokens to every session and 4,497 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-08-31.

Related

Other skills, from other repositories