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
npx skills add borghei/Claude-Skills --skill sql-database-assistant -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/sql-database-assistant/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/sql-database-assistant/
1Skills CLI (Vercel)
npx skills add borghei/Claude-Skills --skill sql-database-assistant -a codex2Manually: put the files in place
.agents/skills/sql-database-assistant/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add borghei/Claude-Skills --skill sql-database-assistant -a cursor2Manually: put the files in place
.cursor/skills/sql-database-assistant/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install borghei/Claude-Skills engineering/sql-database-assistant/SKILL.md2Manually: put the files in place
.github/skills/sql-database-assistant/SKILL.md1Skills CLI (Vercel)
npx skills add borghei/Claude-Skills --skill sql-database-assistant -a gemini-cli2Platform CLI
gemini skills install https://github.com/borghei/Claude-Skills --path engineering/sql-database-assistantManually: put the files in place
.devin/skills/sql-database-assistant/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add borghei/Claude-Skills --skill sql-database-assistant -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.