sql-insight
Translate natural language to SQL, optimize query performance, and interpret EXPLAIN plans for SQLite and PostgreSQL.
Skill by zebbern
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/zebbern-sql-insight
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/sql-insight
What's inside
- Skill name
sql-insight- Description
- Translate natural language to SQL, optimize query performance, and interpret EXPLAIN plans for SQLite and PostgreSQL. Triggered when users ask to convert questions into SQL, improve slow queries, tune indexes, analyze execution plans, or mention keywords like NL2SQL, query tuning, or full table scan.
- License
- MIT
- Instructions
- 207 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (3)
- LICENSE
- SKILL.md
- sql_query_helper.py · scripts/
SKILL.md (first lines)
# sql-insight SQL query assistant — natural language to SQL translation, query optimization analysis, and EXPLAIN plan interpretation. ## Capabilities | Feature | Description | |---------|-------------| | Schema Extraction | Extracts database table structure (columns, types, indexes, foreign keys, sample data) to provide context for NL→SQL | | Natural Language → SQL | Translates natural language descriptions into SQL queries using schema context | | Query Optimization Analysis | Detects SQL anti-patterns based on 13 rules and provides optimization suggestions | | EXPLAIN Interpretation | Runs EXPLAIN and interprets the query plan, identifying full table scans, missing indexes, and more | ## Workflow ### Natural Language → SQL 1. Use the `schema` command to extract the database table structure 2. Use the schema as context to translate the user's natural language request into SQL 3. Use the `optimize` command to check if the generated SQL can be improved 4. Use the `explain` command to verify the query execution plan ```bash # Step 1: Extract schema (compact mode, suitable for LLM context) python3 scripts/sql_query_helper.py --db-path data.db schema --compact # Step 2: Analyze SQL optimization suggestions python3 scripts/sql_query_helper.py optimize "SELECT * FROM orders WHERE user_id = 100" # Step 3: View EXPLAIN execution plan python3 scripts/sql_query_helper.py --db-path data.db explain "SELECT * FROM orders WHERE user_id = 100" ``` ## Quick Start ### Schema Extraction ```bash # Extract full schema (JSON format, with sample data) python3 scripts/sql_query_helper.py --db-path data.db schema # Compact mode (plain text, suitable for embedding in prompts) python3 scripts/sql_query_helper.py --db-path data.db schema --compact # Skip data sampling python3 scripts/sql_query_helper.py --db-path data.db schema --sample-rows 0 # PostgreSQL python3 scripts/sql_query_helper.py --db-type postgres --dsn "host=localhost dbname=mydb user=reader" schema --compact ``` ### Query Optimization Analysis ```bash # Analyze SQL query (no database connection required, pure rule-based detection) python3 scripts/sql_query_helper.py optimize "SELECT * FROM orders o, users u WHERE o.user_id = u.id" python3 scripts/sql_query_helper.py optimize "SELECT name FROM users WHERE UPPER(email) LIKE '%@GMAIL.COM'" python3 scripts/sql_query_helper.py optimize "SELECT id, (SELECT COUNT(*) FROM orders WHERE user_id = u.id) AS order_count FROM users u" ``` ### EXPLAIN Interpretation ```bash # SQLite EXPLAIN python3 scripts/sql_query_helper.py --db-path data.db explain "SELECT * FROM orders WHERE user_id = 100" # PostgreSQL EXPLAIN python3 scripts/sql_query_helper.py --db-type postgres --dsn "host=localhost dbname=mydb" explain "SELECT * FROM orders WHERE user_id = 100" # PostgreSQL EXPLAIN ANALYZE (actually executes the query for real-world data) python3 scripts/sql_query_helper.py --db-type postgres --dsn "host=localhost dbname=mydb" explain --analyze "SELECT * FROM orders WHERE user_id = 100" ``` ## Detailed Usage ### Global Parameters | Parameter | Required | Default | Description | |-----------|----------|---------|-------------| | `--db-type` | No | sqlite | Database type: sqlite or postgres | | `--db-path` | For schema/explain (SQLite) | — | SQLite database file path | | `--dsn` | For schema/explain (PostgreSQL) | — | PostgreSQL connection string | ### Subcommands | Command | Requires Database | Description | |---------|-------------------|-------------| | `schema` | Yes | Extract database table structure | | `optimize <sql>` | No | SQL query optimization analysis (pure rule-based detection) | | `explain <sql>` | Yes | Run EXPLAIN and interpret the plan | ### schema Parameters | Parameter | Default | Description | |-----------|---------|-------------| | `--sample-rows, -n` | 3 | Number of sample rows per table (0 to skip sampling) | | `--compact` | false | Compact text output (suitable for embedding in prompts) | ### explain Parameters | Parameter | Default | Description | |-----------|---------|-------------| | `--analyze` | false | Use EXPLAIN ANALYZE (PostgreSQL only; actually executes the query) | ## Optimization Rules The `optimize` command detects the following 13 SQL anti-patterns: | Rule | Severity | Description | |------|----------|-------------| | avoid-select-star | warning | Avoid SELECT *; explicitly list column names | | unbounded-query | info | Missing WHERE and LIMIT clauses | | leading-wildcard-like | warning | LIKE '%...' causes index to be bypassed | | or-condition | info | OR conditions may prevent index usage | | not-in-subquery | warning | NOT IN (subquery) has poor performance | | scalar-subquery | warning | Scalar subqueries in SELECT execute row-by-row | | function-on-column | warning | Functions on columns in WHERE prevent index usage |
From zebbern/claude-code-guide, MIT.
More from zebbern/claude-code-guide
- 0.746score
audit-flow
ArunJRK
Interactive system flow tracing across CODE, API, AUTH, DATA, NETWORK layers with SQLite persistence and Mermaid export.
SkillCFreshness: C★ 4.7KClaude Code +9 - 0.740score
three-best-practices
three-agent-skills
Three.js performance optimization and best practices guidelines.
SkillCFreshness: C★ 4.7KClaude Code +9 - 0.740score
r3f-best-practices
three-agent-skills
React Three Fiber (R3F) and Poimandres ecosystem best practices.
SkillCFreshness: C★ 4.7KClaude Code +9 - 0.662score
project-sizing-guide
zebbern
Software project effort estimation assistant.
SkillCFreshness: C★ 4.7KClaude Code +9 - 0.662score
database-scout
zebbern
Explore SQLite and PostgreSQL databases: list tables, inspect schemas (columns/types/constraints), preview data, generate Mermaid ER diagrams, and run safe…
SkillCFreshness: C★ 4.7KClaude Code +9 - 0.662score
data-viz-renderer
zebbern
Generate self-contained HTML/SVG infographics from JSON data, including stat cards, bar charts, flow diagrams, and mixed dashboards.
SkillCFreshness: C★ 4.7KClaude Code +9 - 0.662score
http-load-profiler
zebbern
Run stepped HTTP load tests with ab/wrk, ramping concurrency levels to collect p50/p90/p99 latency, detect performance inflection points, and recommend…
SkillCFreshness: C★ 4.7KClaude Code +9 - 0.662score
chart-image
zebbern
Generate publication-quality PNG chart images from data, supporting line, bar, area, candlestick, pie, and heatmap charts.
SkillCFreshness: C★ 4.7KClaude Code +9 - 0.662score
code-to-diagram
zebbern
Analyze codebases and automatically generate architecture diagrams, flowcharts, and org charts.
SkillCFreshness: C★ 4.7KClaude Code +9 - 0.662score
dataset-quality-audit
zebbern
Run comprehensive quality checks on tabular data (CSV/Excel/TSV/JSON), detecting missing values, duplicates, outliers, format issues, and type inconsistencies…
SkillCFreshness: C★ 4.7KClaude Code +9 - 0.662score
code-vuln-audit
zebbern
Scan code for security issues: dependency vulnerabilities (npm/pip audit), secret leaks (regex and entropy analysis), and OWASP anti-patterns like SQL…
SkillCFreshness: C★ 4.7KClaude Code +9 - 0.662score
log-error-digest
zebbern
Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports.
SkillCFreshness: C★ 4.7KClaude Code +9
Compare and alternatives
Featured in
Signals
- Stars
- 4,678
- Forks
- 471
- Open issues
- 3
- Last commit (this folder)
- May 31, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/zebbern/claude-code-guide
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from zebbern
- 0.693score
api-fuzzing
zebbern
API fuzzing for bug bounty.
SkillAFreshness: A★ 131Claude Code +9 - 0.662score
data-viz-renderer
zebbern
Generate self-contained HTML/SVG infographics from JSON data, including stat cards, bar charts, flow diagrams, and mixed dashboards.
SkillCFreshness: C★ 4.7KClaude Code +9 - 0.662score
code-to-diagram
zebbern
Analyze codebases and automatically generate architecture diagrams, flowcharts, and org charts.
SkillCFreshness: C★ 4.7KClaude Code +9 - 0.662score
chart-image
zebbern
Generate publication-quality PNG chart images from data, supporting line, bar, area, candlestick, pie, and heatmap charts.
SkillCFreshness: C★ 4.7KClaude Code +9 - 0.662score
code-vuln-audit
zebbern
Scan code for security issues: dependency vulnerabilities (npm/pip audit), secret leaks (regex and entropy analysis), and OWASP anti-patterns like SQL…
SkillCFreshness: C★ 4.7KClaude Code +9 - 0.662score
database-scout
zebbern
Explore SQLite and PostgreSQL databases: list tables, inspect schemas (columns/types/constraints), preview data, generate Mermaid ER diagrams, and run safe…
SkillCFreshness: C★ 4.7KClaude Code +9
Cite this page
sql-insight skill. Agent Mart. https://agentmart.dev/skills/zebbern-sql-insight (last updated 2026-10-24)