sql-code-review

sql-code-review is a skill for Claude Code, Codex from rockyflux/yq-workflow. It costs 65 tokens per session (2,140 once invoked), scanned A, a copy of sql-code-review, MIT.

A reviewer for SQL, the language used to query and manage relational databases. It checks security, performance, maintainability, permissions, and database-specific anti-patterns across MySQL, PostgreSQL, SQL Server, and Oracle.

In plain words
What is it for?
Use it to review selected SQL or a whole project, including parameterized queries, permissions, sensitive data handling, audit logging, encryption, and query quality.
Why use it?
It helps uncover SQL injection risks, excessive data exposure, weak access controls, and query or schema problems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to review selected SQL or a whole project, including parameterized queries, permissions, sensitive data handling, audit logging, encryption, and query quality.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rockyflux/yq-workflow/sql-code-review
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add rockyflux/yq-workflow --skill sql-code-review
Clone the repo
git clone --depth 1 https://github.com/rockyflux/yq-workflow

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sql-code-review

README.md
[![agentmods](https://agentmods.dev/badge/skills/rockyflux/yq-workflow/sql-code-review/github.svg)](https://agentmods.dev/skills/rockyflux/yq-workflow/sql-code-review)
Your own site
<a href="https://agentmods.dev/skills/rockyflux/yq-workflow/sql-code-review"><img src="https://agentmods.dev/badge/skills/rockyflux/yq-workflow/sql-code-review/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sql-code-review

Your own site · 80×15
<a href="https://agentmods.dev/skills/rockyflux/yq-workflow/sql-code-review"><img src="https://agentmods.dev/badge/skills/rockyflux/yq-workflow/sql-code-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,140 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00065 $0.02140
Opus 5.5 $0.00026 $0.00856
Sonnet 5.5 $0.00013 $0.00428
Haiku 4.5 $0.00006 $0.00214

Measured 1mo ago against content hash 2e67c2fa2875, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sql-code-review scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to sql-code-review — 4 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

templates/base-skills/sql-code-review/SKILL.md · 302 lines

How it starts

The opening of the file, as written. The whole thing — 302 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SQL Code Review

Perform a thorough SQL code review of ${selection} (or entire project if no selection) focusing on security, performance, maintainability, and database best practices.

🔒 Security Analysis

SQL Injection Prevention

-- ❌ CRITICAL: SQL Injection vulnerability
query = "SELECT * FROM users WHERE id = " + userInput;
query = f"DELETE FROM orders WHERE user_id = {user_id}";

-- ✅ SECURE: Parameterized queries
-- PostgreSQL/MySQL
PREPARE stmt FROM 'SELECT * FROM users WHERE id = ?';
EXECUTE stmt USING @user_id;

-- SQL Server
EXEC sp_executesql N'SELECT * FROM users WHERE id = @id', N'@id INT', @id = @user_id;

Access Control & Permissions

  • Principle of Least Privilege: Grant minimum required permissions
  • Role-Based Access: Use database roles instead of direct user permissions
  • Schema Security: Proper schema ownership and access controls
  • Function/Procedure Security: Review DEFINER vs INVOKER rights

Data Protection

  • Sensitive Data Exposure: Avoid SELECT * on tables with sensitive columns
  • Audit Logging: Ensure sensitive operations are logged
  • Data Masking: Use views or functions to mask sensitive data
  • Encryption: Verify encrypted storage for sensitive data

⚡ Performance Optimization

Query Structure Analysis

-- ❌ BAD: Inefficient query patterns
SELECT DISTINCT u.* 
FROM users u, orders o, products p
WHERE u.id = o.user_id 
AND o.product_id = p.id
AND YEAR(o.order_date) = 2024;

-- ✅ GOOD: Optimized structure
SELECT u.id, u.name, u.email
FROM users u
INNER JOIN orders o ON u.id = o.user_id
WHERE o.order_date >= '2024-01-01' 
AND o.order_date < '2025-01-01';

Index Strategy Review

  • Missing Indexes: Identify columns that need indexing
  • Over-Indexing: Find unused or redundant indexes
  • Composite Indexes: Multi-column indexes for complex queries
  • Index Maintenance: Check for fragmented or outdated indexes

Join Optimization

  • Join Types: Verify appropriate join types (INNER vs LEFT vs EXISTS)
  • Join Order: Optimize for smaller result sets first
  • Cartesian Products: Identify and fix missing join conditions
  • Subquery vs JOIN: Choose the most efficient approach

Read the full file on GitHub · 302 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 302 lines · 65 tokens per session scan A 2e67c2fa2875

Subscribe to this mod's changes

sql-code-review is a skill published in the GitHub repository rockyflux/yq-workflow (2 stars, last pushed 1mo ago), licensed MIT. It adds 65 tokens to every session and 2,140 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to sql-code-review, differing in 4 lines, and is treated as a copy.

Related

Other skills, from other repositories

triage-contributor-pr

Triage open pull requests from external contributors to prisma/orm and produce a per-PR verdict with evidence. Use when a maintainer asks to triage, evaluate, assess, or review the queue of incoming contributor PRs, to decide whether a fork PR is safe to run CI on, to check whether a PR is in scope for its version…

prisma/orm · 131 tokens

review-implement-phase

Implements triaged review actions, commits focused fixes, and posts Done plus resolves threads. Use when the user wants only the implementation phase of the review-framework workflow.

prisma/orm · 38 tokens

no-bare-casts

Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.

prisma/orm · 52 tokens

review-prs

Review a GitHub pull request in the googleapis/mcp-toolbox repo against the team's reviewer checklist: PR title/description conventions, linked issue, logic errors and unhandled edge cases, breaking changes, test coverage, docs updates, security (input handling), and new dependencies. Use whenever a maintainer asks…

googleapis/mcp-toolbox · 162 tokens

migration-review

Review database migration files when a change adds or modifies paths under migrations/. Use it before merge to collect forward, rollback, locking, and data-safety evidence.

rohitg00/ai-engineering-from-scratch · 35 tokens

ln-57-persistence-auditor

Audits queries, transactions, consistency and persistence resource lifetimes; read-only.

levnikolaevich/claude-code-skills · 25 tokens