Skip to main content
skill CX Codex

sql-database-assistant · borghei — Claude Code skill: what it does

sql-database-assistant — a skill for Claude Code that runs static linting on SQL queries, extracts schema documentation from DDL, and creates forward and rollback migrations.

LicenseRef-MIT-Commons-Clause 100 installs ★ 1,183 updated 2026-10-23

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add borghei/Claude-Skills --skill sql-database-assistant -a claude-code
Open on GitHub

What sql-database-assistant does

The skill evaluates SQL text using three bundled Python utilities. The query_optimizer.py script inspects queries for unindexed scans, SELECT *, leading wildcards in LIKE, missing WHERE clauses, and = NULL comparisons. The schema_explorer.py tool parses DDL definitions into tables, column types, default values, and foreign keys formatted as Markdown or JSON.

For schema versioning, migration_generator.py diffs two DDL snapshots to produce up and commented down steps. It halts with exit code 1 whenever dropped columns or altered types appear unless invoked with --allow-destructive. The scripts perform purely static parsing without database connections or query plans, and generated statements target PostgreSQL syntax. Renamed columns are handled as a drop followed by an add, meaning rollback commands reconstruct table structure but do not recover data. Running the tools requires Python.

What it helps with

  • Spot anti-patterns such as SELECT * and leading wildcards in raw SQL
  • Generate Markdown schema reference docs directly from a DDL file
  • Produce UP and DOWN migration SQL by diffing two schema files
  • Catch destructive schema changes in CI pipelines via non-zero exit codes

Example prompts for the agent

  • Review queries.sql for missing indexes and scan anti-patterns
  • Document table structures and keys from schema.sql in Markdown
  • Generate a migration diff from schema_v1.sql to schema_v2.sql

How to install sql-database-assistant

1Skills CLI (Vercel)

npx skills add borghei/Claude-Skills --skill sql-database-assistant -a claude-code

2Manually: put the files in place

~/.claude/skills/sql-database-assistant/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/sql-database-assistant/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about sql-database-assistant

How to install sql-database-assistant in Claude Code?

Run npx skills add borghei/Claude-Skills --skill sql-database-assistant -a claude-code in your terminal.

What does sql-database-assistant do?

It inspects SQL text for performance issues, generates schema documentation from DDL definitions, and builds migration scripts with rollbacks.

What is required to run sql-database-assistant?

It requires Python to execute the analysis scripts. It does not connect to a running database engine because all checks operate on raw SQL files.

Similar skills

All skills for Data and databases →

sql-database-assistant by other authors comes first.

sql-database-assistant Alireza Rezvani sql-database-assistant is a Claude Code skill that writes SQL, inspects schemas, reviews query performance, and prepares migrations for database and ORM work. CX Codex +1 727installs database-migrations-sql-migrations sickn33 database-migrations-sql-migrations — a skill for safe SQL database migrations with zero downtime. Generates migration scripts with rollback plans, data integrity checks, and strategies for PostgreSQL, MySQL, and SQL Server. CX Codex +1 1installs database-design MoizIbnYousaf database-design — a skill for schema design, migrations and query optimization on PostgreSQL, MySQL and NoSQL. Useful whenever the agent writes SQL. CX Codex +1 624installs database-design-patterns curiositech database-design-patterns guides relational schema design, 3NF normalization, index selection, and zero-downtime migrations using the expand-contract pattern. CX Codex +1 152installs Database Migrations taste f Database Migrations taste is a Claude Code prompt that guides safe database migrations with raw SQL, expand-contract changes, and safeguards against production locks. GP ChatGPT ★ 178,201repo stars 704-technologies-sql Juan Antonio Breña Moral The 704-technologies-sql skill guides schema design, SQL queries, indexes, and migrations without tying the advice to a Java framework. Use it for database reviews and changes. CX Codex +1 227installs sql-pro https://github.com/Jeffallan sql-pro optimizes slow SQL queries, designs database schemas, and fixes performance bottlenecks. Built for EXPLAIN plan tuning and cross-dialect migrations. CX Codex +1 6,900installs

From the same set120

The whole set →
analytics-tracking analytics-tracking is a Claude Code skill that builds and audits GA4 and GTM setups, structures event taxonomies, and troubleshoots broken conversions. CX Codex +1 104installs agent-protocol agent-protocol — a skill for Claude Code designs tool schemas and communication layers between AI agents. It targets setups using MCP, Google A2A, or OpenAI Function Calling. CX Codex +1 104installs ai-seo ai-seo — a skill for Claude Code prepares content to earn citations in AI search answers. It supports GEO work, LLM visibility reviews, and citability audits. CX Codex +1 102installs identify-assumptions identify-assumptions — a skill for Claude Code that uncovers product assumptions and scores impact against confidence. Runs before engineering experiments start or when team members debate delivery risks. CX Codex +1 102installs outcome-roadmap outcome-roadmap — a skill for Claude Code transforms feature backlogs into outcome-based roadmaps using Now/Next/Later horizons. Runs during quarterly planning and strategy alignment sessions. CX Codex +1 102installs dora-compliance-expert The dora-compliance-expert Claude Code skill assesses a financial entity’s readiness for DORA. It also classifies ICT incidents and helps plan oversight of external ICT providers. CX Codex +1 101installs email-template-builder The email-template-builder Claude Code skill builds transactional email template systems with React Email or MJML. It runs for email setup, design-system work, or deliverability debugging. CX Codex +1 100installs praxis-engineering The praxis-engineering plugin bundles eight engineering skills for architecture, DevOps, security, MCP, RAG, and code review in Claude Code. ★ 1,183repo stars

Project sponsors

Companies that keep this analytics open