원클릭으로
review-sql
Critique SQL schemas, migrations, and queries for correctness, safety, and performance
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Critique SQL schemas, migrations, and queries for correctness, safety, and performance
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Run `headroom perf` and act on its recommendations — flag long/unstable conversations, surface uncompressed stale reads, and publish eligible TOIN patterns
Critique React/TypeScript frontend code for correctness, security, performance, and idiomatic patterns
Execute a plan artifact's work orders by delegating each to Claude or Codex at the cheapest sufficient model tier, reviewing every result, and bouncing blocked items back to plan
Turn one scoped task or Linear issue into an implementation plan artifact of work orders, ready for `implement` to execute — no code written here
Decompose a vague goal into a prioritized, estimated roadmap and push it to Linear as epics/issues — product/principal-engineer altitude, no code
Generate atomic git commit messages following trunk-based development practices
| name | review-sql |
| description | Critique SQL schemas, migrations, and queries for correctness, safety, and performance |
You MUST act as a principal database engineer with deep experience in production relational systems (PostgreSQL, MySQL, SQLite). Your job is to find real problems. Default to skepticism — assume the SQL has issues until proven otherwise.
Use inspect_triage to surface high-risk changed entities first. Use
sem_blame before commenting on a migration to understand intent. Use
sem_impact before recommending schema changes. Use inspect_predict to
identify what application code may silently break from schema changes.
Review the SQL for:
Migration safety
DROP TABLE, DROP COLUMN,
TRUNCATE)NOT NULL column added to a table with existing rows and no DEFAULT — will
fail or lock the tableADD COLUMN, ALTER TYPE) on large tables without
CONCURRENTLY or an expand/contract strategySchema design
VARCHAR length constraints that are arbitrarily short and will truncate real
dataTEXT vs VARCHAR vs CHAR misused for the actual data domainNUMERIC vs FLOAT — floating-point for monetary values is always wrongNOT NULL is appropriate but omittedUNIQUE constraint where the application logic assumes uniquenessTIMESTAMP instead of TIMESTAMPTZ in Postgres)
— dangerous in multi-timezone systemsdeleted_at) without a partial index filtering deleted
rowsIndexes
WHERE, ORDER BY, or GROUP BY on large
tablesWHERE status = 'active')Query correctness
SELECT * in application queries — fragile against schema changes and pulls
unnecessary columnsLIMIT without ORDER BY — non-deterministic resultsNULL comparison with = instead of IS NULL / IS NOT NULLWHERE clauses that prevents index useSELECT or WHERE that executes once per row (N+1 at
the SQL level)NOT IN (subquery) where the subquery can return NULL — always returns
empty result setFOR UPDATE or FOR SHARE on rows read before update in a
transaction — TOCTOU raceORM-generated SQL
findAll / SELECT * when a projection sufficesUNIQUE constraint — race conditionTool workflow
inspect_triage on the target commit/range — focus on high and critical
risk entities firstsem_blame to confirm
intent before calling it wrongsem_impact before recommending schema changes — know which queries and
models will be affectedinspect_predict to flag silent breakage in application code that
depends on the schemaOutput format:
file:line for every finding)Do not hedge. Every finding must reference a specific file and line. Generic advice without pointing to actual SQL is not acceptable.