sql-database-assistant

sql-database-assistant is a skill for Claude Code, Codex from Morningstar202604/awesome-skillkit. It costs 45 tokens per session (3,932 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

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/morningstar202604/awesome-skillkit/sql-database-assistant
Any agent
npx skills add Morningstar202604/awesome-skillkit --skill sql-database-assistant
Clone the repo
git clone --depth 1 https://github.com/Morningstar202604/awesome-skillkit

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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,932 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 $0.00045 $0.03932
Opus 5 $0.00023 $0.01966
Sonnet 5 $0.00009 $0.00786
Haiku 4.5 $0.00005 $0.00393

Measured 4d ago against content hash 145df2dbde77, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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.

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

How it starts

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

SQL Database Assistant - POWERFUL Tier Skill

Overview

The operational companion to database design. While database-designer focuses on schema architecture, ERD modeling, and multi-tenancy patterns, this skill covers the day-to-day: writing queries, optimizing performance, generating migrations, and bridging the gap between application code and database engines.

Core Capabilities

  • Natural Language to SQL — translate requirements into correct, performant queries
  • Schema Exploration — introspect live databases across PostgreSQL, MySQL, SQLite, SQL Server
  • Query Optimization — EXPLAIN analysis, index recommendations, N+1 detection, rewrite patterns
  • Migration Generation — up/down scripts, zero-downtime strategies, rollback plans
  • ORM Integration — Prisma, Drizzle, TypeORM, SQLAlchemy patterns and escape hatches
  • Multi-Database Support — dialect-aware SQL with compatibility guidance

Tools

Script Purpose
scripts/query_optimizer.py Static analysis of SQL queries for performance issues
scripts/migration_generator.py Generate migration file templates from change descriptions
scripts/schema_explorer.py Generate schema documentation from introspection queries

Natural Language to SQL

Translation Patterns

When converting requirements to SQL, follow this sequence:

  1. Identify entities — map nouns to tables
  2. Identify relationships — map verbs to JOINs or subqueries
  3. Identify filters — map adjectives/conditions to WHERE clauses
  4. Identify aggregations — map "total", "average", "count" to GROUP BY
  5. Identify ordering — map "top", "latest", "highest" to ORDER BY + LIMIT

Common Query Templates

Top-N per group (window function)

SELECT * FROM (
  SELECT *, ROW_NUMBER() OVER (PARTITION BY department_id ORDER BY salary DESC) AS rn
  FROM employees
) ranked WHERE rn <= 3;

Running totals

SELECT date, amount,
  SUM(amount) OVER (ORDER BY date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS running_total
FROM transactions;

Read the full file on GitHub · 463 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. 4d 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 (1 stars, last pushed yesterday), licensed Apache-2.0. It adds 45 tokens to every session and 3,932 once invoked, about $0.0002 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

prisma-postgres-setup

Set up a new Prisma Postgres database and connect it to a local project using the Management API. Use when asked to "set up a database", "create a Prisma Postgres project", "get a connection string", "connect my app to Prisma Postgres", or "provision a database".

nitrocloudofficial/nitrostack · 67 tokens

prisma-client-api

Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".

nitrocloudofficial/nitrostack · 64 tokens

prisma-mongodb-upgrade

Decision and migration guide for Prisma ORM MongoDB projects on v6, which have no upgrade path to v7. Use when a MongoDB project asks about upgrading Prisma, when "upgrade to prisma 7" comes up in a project with provider = "mongodb", or when evaluating a move to Prisma Next. Triggers on "upgrade prisma mongodb"…

nitrocloudofficial/nitrostack · 95 tokens

search

Search 2500+ curated ChatGPT and LLM open-source repositories. Use when the user asks to find tools, libraries, or repos related to ChatGPT, LLMs, RAG, agents, langchain, NLP, AI development, or any open-source AI tooling.

taishi-i/awesome-ChatGPT-repositories · 57 tokens

shuorenhua

检查和清理中英文文本里的 AI 套路,适用于“去 AI 味”“说人话”“自然一点”“别像模板”“先标问题”这类改写和审稿需求;按场景控制力度,同时保留事实、术语、语域和责任主体。.

MrGeDiao/shuorenhua · 68 tokens

33-b2b-lead-gen-global

Use when the user needs B2B pipeline work — ICP and account lists, prospecting, cold email and LinkedIn outbound sequences, lead scoring, MQL to SQL handoff, sales decks, objection handling, demo scripts, CRM pipeline hygiene, and RevOps reporting. Trigger on 'find leads', 'prospect list', 'cold email sequence'…

minhnv0807/ai-business-skills · 172 tokens