Agent skill · data analytics · github
sql-code-review
Universal SQL code review assistant that performs comprehensive security, maintainability, and code quality analysis across all SQL databases (MySQL, PostgreSQL, SQL Server, Oracle). Focuses on SQL injection prevention, access control, code standards, and anti-pattern detection. Complements SQL optimization prompt for complete development coverage.
Why this skill is useful
Provides domain-specific knowledge on SQL security, performance optimization, and maintainability best practices that the AI wouldn't reliably generate on its own.
What it needs
About 5k tokens when loaded. Last updated 2026-08-07. 37,534 stars on the source repository.
What this skill does
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 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 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 Aggregate and Window Functions 🛠️ Code Quality & Maintainability SQL Style & Formatting Naming Conventions Consistent Naming: Tables, columns, constraints follow consistent patterns Descriptive Names: Clear, meaningful names for database objects Reserved Words: Avoid using database reserved words as identifiers Case Sensitivity: Consistent case usage across schema Schema Design Review Normalization: Appropriate normalization level (avoid over/under-normalization) Data Types: Optimal data type choices for storage and performance Constraints: Proper use of PRIMARY KEY, FOREIGN KEY, CHECK, NOT NULL Default Values: Appropriate default values for columns 🗄️ Database-Speci …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills github/sql-code-review