Skip to content
Back to skills

Sql Antipatterns

ASecurity

Forbidden SQL patterns — SELECT *, missing CONCURRENTLY on indexes, unsafe migrations, missing FK indexes. Applies when editing SQL files.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 21, 2026
ai-agentsgosql

Works with

  • cursor

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned October 21, 2026

npx -y skills add emgiezet/aisdlc --skill sql-antipatterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sql Antipatterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sql Antipatterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/emgiezet-sql-antipatterns/badge)](https://www.skillsdirectory.com/skills/emgiezet-sql-antipatterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sql-antipatterns
description: Forbidden SQL patterns — SELECT *, missing CONCURRENTLY on indexes, unsafe migrations, missing FK indexes. Applies when editing SQL files.
user-invocable: false
---

# SQL anti-patterns — do not write these

Checks run automatically after each edit. Findings reference the IDs below.

## Errors
- AP-SQL-002 — Always `CREATE INDEX CONCURRENTLY` in migrations on live tables; run outside a transaction.
- AP-SQL-003 — Add columns nullable first, backfill, then add constraint `NOT VALID` → `VALIDATE CONSTRAINT`.

## Warnings
- AP-SQL-001 — Name every column in SELECT; never use `SELECT *` in application queries.
- AP-SQL-004 — Create an index on every foreign key column; missing FK indexes cause full-table scans.
- AP-SQL-006 — Use `ALGORITHM=INPLACE, LOCK=NONE` or gh-ost for large-table MySQL ALTERs.
- AP-SQL-007 — Paginate with keyset/cursor (`WHERE id > ?`) instead of `OFFSET`; OFFSET degrades at scale.

Details for any ID: `reference/<ID>.md`

Files in this skill

  • SKILL.md1013 B
  • reference/AP-SQL-001.md522 B
  • reference/AP-SQL-002.md578 B
  • reference/AP-SQL-003.md850 B
  • reference/AP-SQL-004.md753 B
  • reference/AP-SQL-005.md716 B
  • reference/AP-SQL-006.md566 B
  • reference/AP-SQL-007.md564 B
  • reference/AP-SQL-008.md690 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.