$npx -y skills add Archive228/loopkit --skill sql-reviewReview SQL and ORM queries for correctness, safety, and performance before they ship.
| 1 | # SQL Review |
| 2 | - **Injection** — parameterized, always. No string interpolation into SQL. |
| 3 | - **N+1** — a query inside a loop? Replace with a join or a batched IN. |
| 4 | - **Missing index** — does the WHERE/JOIN/ORDER BY hit an indexed column? If not, the table scan will surface at scale. |
| 5 | - **Unbounded** — SELECT with no LIMIT on a growing table; a JOIN that fans out rows. |
| 6 | - **Transactions** — multi-write operations wrapped so a partial failure can't corrupt state. |
| 7 | - **Migrations** — reversible (up AND down), and safe on a live table (no blocking lock on a hot table at peak). |
| 8 | Output: each issue with the line and the rewrite. Show the EXPLAIN if performance is the concern. |