sql-code-review

sql-code-review is a skill for Claude Code, Codex from OKHP3/skillz. It costs 65 tokens per session (2,141 once invoked), scanned A, original, MIT.

A SQL review assistant for examining database queries and code across MySQL, PostgreSQL, SQL Server, Oracle, and other SQL databases. It checks security, performance, maintainability, access control, and common SQL mistakes.

In plain words
What is it for?
Use it to review queries for SQL injection, permission design, data protection, audit logging, encryption, and general code quality.
Why use it?
It helps catch unsafe query construction, excessive permissions, sensitive-data exposure, and database-specific anti-patterns before they cause problems. It also checks whether SQL is maintainable.

Skill for Claude CodeCodex

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

Good fit Use it to review queries for SQL injection, permission design, data protection, audit logging, encryption, and general code quality.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/okhp3/skillz/sql-code-review
View source ↗ OKHP3/skillz
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 OKHP3/skillz --skill sql-code-review
Clone the repo
git clone --depth 1 https://github.com/OKHP3/skillz

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/okhp3/skillz/sql-code-review/github.svg)](https://agentmods.dev/skills/okhp3/skillz/sql-code-review)
Your own site
<a href="https://agentmods.dev/skills/okhp3/skillz/sql-code-review"><img src="https://agentmods.dev/badge/skills/okhp3/skillz/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/okhp3/skillz/sql-code-review"><img src="https://agentmods.dev/badge/skills/okhp3/skillz/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,141 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 original No closer match found 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.02141
Opus 5 $0.00032 $0.01071
Sonnet 5 $0.00013 $0.00428
Haiku 4.5 $0.00006 $0.00214

Measured 5d ago against content hash 3f359d49372c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 5d 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

Copies of this mod

1 near-identical copy found in the catalogue:

community/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. 5d ago First seen · 302 lines · 65 tokens per session scan A 3f359d49372c

Subscribe to this mod's changes

sql-code-review is a skill published in the GitHub repository OKHP3/skillz (3 stars, last pushed today), licensed MIT. It adds 65 tokens to every session and 2,141 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

ontoly-software-graph

Use Ontoly's deterministic Software Graph and MCP capabilities for architecture review, request tracing, dependency analysis, configuration lookup, and impact analysis before falling back to source-file search.

anbeime/skill · 41 tokens

kelly-pr-review

GitHub pull request review desk (Busabase App-in-Skill) using the gh CLI for real GitHub access, an AirApp review UI for human approval, and a trusted gh pr review execution step. Use when the user invokes /kelly-pr-review or $kelly-pr-review, asks to review GitHub PRs, generate a PR review batch…

mr-kelly/skills · 94 tokens

SQL Query Optimizer

Reviews SQL queries for performance issues and rewrites them with optimized execution plans.

Notysoty/openagentskills · 20 tokens

db-review

Reviews database schemas, queries, and migrations for correctness, performance, security, and best practices. Use when reviewing SQL migration files or when the user mentions database review, schema review, or query audit.

tranhieutt/software_development_department · 43 tokens

drupal-security-review

Use when auditing Drupal 11 custom modules/themes for security issues such as unsafe input handling, XSS risks, SQL injection, and access control gaps.

siva01c/claude-plugins · 35 tokens

find-verified-code-review-agent

Find a Verified Code Review Agent. Agent discovery, trust verification, and capability routing powered by Aidress — the coordination registry for autonomous AI agents. Use for software agent discovery, trust verification, and capability routing — via Aidress (https://api.aidress.ai).

Aidress-ai/aidress-skill-find-verified-code-review-agent · 61 tokens