From sql-quality
Analyze SQL files for performance issues like full table scans, ineffective joins, and inefficient queries. Reports findings in a CI-friendly format without modifying files. Detects critical issues (FullTableScan, IneffectiveJoin) and warnings (IneffectiveSort, TemporaryTableGrouping).
How this skill is triggered — by the user, by Claude, or both
Slash command
/sql-quality:sql-quality-checkThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Analyze SQL files for performance issues. Suitable for CI pipelines.
Analyze SQL files for performance issues. Suitable for CI pipelines.
$ARGUMENTS: SQL directory and params file (e.g., "tests/sql tests/params/sql_params.php")php bin/sql-quality analyze \
--sql-dir="$(echo $ARGUMENTS | cut -d' ' -f1)" \
--params="$(echo $ARGUMENTS | cut -d' ' -f2)" \
--format=json
Parse the JSON output and report:
Summary Table:
| SQL File | Cost | Issues |
|---|---|---|
| file.sql | 497.95 | FullTableScan, IneffectiveSort |
Issue Severity:
Report format for CI:
SQL Quality Check: FAILED
- 3 critical issues found
- 2 warnings found
Critical:
1_full_table_scan.sql: FullTableScan (cost: 497.95)
4_no_index_on_join.sql: IneffectiveJoin (cost: 234.50)
Run '/sql-quality-fix' to auto-fix these issues.
DO NOT modify any files. Only report findings.
npx claudepluginhub koriym/koriym.sqlquality --plugin sql-qualityAnalyzes PHP code for SQL query efficiency issues including SELECT *, missing index hints, unnecessary joins, full table scans, suboptimal WHERE clauses, ORDER BY without indexes, and large OFFSET pagination.
Reviews SQL queries for performance anti-patterns, missing indexes, N+1 queries, and unsafe operations. Analyzes raw SQL, ORM queries, and migration scripts for optimization.
Analyzes SQL queries for slow patterns (N+1, full scans, bad joins), reads EXPLAIN plans, recommends indexes, and rewrites queries with explanations.