sql-anti-pattern-linter
Installation
SKILL.md
When to invoke
- You want a lightweight, fast static check on SQL before review.
- You suspect performance issues from patterns like
SELECT *or non-sargable filters.
Inputs needed
--sql_file: Path to a.sqlfile.--out_json: Path to write findings as JSON.
Workflow
- Read SQL text.
- Run heuristic rule checks (regex-based):
SELECT *WHEREclause using functions on indexed-looking columns (e.g.,LOWER(col)=...)- Leading wildcard
LIKE '%foo' ORchains on same column- Implicit joins via comma in
FROM a, b NOT IN (subquery)null-trap risk- Missing
WHEREonUPDATE/DELETE
- Emit findings with rule id, severity, message, and line number when detectable.