Sql quality check
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).From its SKILL.md
npx -y skills add koriym/Koriym.SqlQuality --skill sql-quality-checkAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.5 KB, as published. Nobody here has run it
SQL Quality Check
Analyze SQL files for performance issues. Suitable for CI pipelines.
Arguments
$ARGUMENTS: SQL directory and params file (e.g., "tests/sql tests/params/sql_params.php")
Steps
1. Run Analysis
php bin/sql-quality analyze \
--sql-dir="$(echo $ARGUMENTS | cut -d' ' -f1)" \
--params="$(echo $ARGUMENTS | cut -d' ' -f2)" \
--format=json
2. Report Results
Parse the JSON output and report:
Summary Table:
| SQL File | Cost | Issues |
|---|---|---|
| file.sql | 497.95 | FullTableScan, IneffectiveSort |
Issue Severity:
- CRITICAL: FullTableScan, IneffectiveJoin (block release)
- WARNING: IneffectiveSort, TemporaryTableGrouping (review recommended)
- INFO: Other issues (minor impact)
3. Exit Status for CI
- Exit 0: No critical issues found
- Exit 1: Critical issues detected (FullTableScan, IneffectiveJoin)
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.
4. Output
DO NOT modify any files. Only report findings.