sql-code-review
Universal SQL code review guidance for security, maintainability, access control, data protection, SQL injection prevention, schema quality, and anti-patterns.
Skill by imported-and-adapted-by-lucy-camilo
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/camiloandresgtruniandes-sql-code-review
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, data, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/sql-code-review
What's inside
- Skill name
sql-code-review- Description
- Universal SQL code review guidance for security, maintainability, access control, data protection, SQL injection prevention, schema quality, and anti-patterns. Trigger: when reviewing SQL, migrations, stored procedures, or database-access queries.
- License
- Apache-2.0
- Metadata
- author: imported-and-adapted-by-lucy-camilo · version: 1.1
- Instructions
- 306 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
## OpenClaw SQL Safety Rules
- Prefer review/analysis over executing SQL.
- Never run destructive SQL (`DROP`, `TRUNCATE`, mass `DELETE`/`UPDATE`, schema changes) without explicit user approval and backup/rollback context.
- Do not run `EXPLAIN ANALYZE` or production diagnostics that execute expensive queries unless the user confirms environment safety.
- Avoid exposing PII/secrets from query results; inspect schemas/plans instead of raw data when possible.
- Database-specific guidance must be checked against the actual database engine/version and repo standards.
# 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
```sql
-- ❌ 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
```sql
-- ❌ 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
### Aggregate and Window Functions
```sql
-- ❌ BAD: Inefficient aggregation
SELECT user_id,
(SELECT COUNT(*) FROM orders o2 WHERE o2.user_id = o1.user_id) as order_count
FROM orders o1
GROUP BY user_id;
-- ✅ GOOD: Efficient aggregation
SELECT user_id, COUNT(*) as order_count
FROM orders
GROUP BY user_id;
```
## 🛠️ Code Quality & Maintainability
### SQL Style & Formatting
```sql
-- ❌ BAD: Poor formatting and style
select u.id,u.name,o.total from users u left join orders o on u.id=o.user_id where u.status='active' and o.order_date>='2024-01-01';
-- ✅ GOOD: Clean, readable formatting
SELECT u.id,
u.name,
o.total
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
WHERE u.status = 'active'
AND o.order_date >= '2024-01-01';
```
### 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-Specific Best Practices
### PostgreSQL
```sqlFrom CamiloAndresGTRUniandes/lucy-ai, Apache-2.0.
More from CamiloAndresGTRUniandes/lucy-ai
- 0.605score
igniteui-angular-theming
imported-and-adapted-by-lucy-camilo
Ignite UI for Angular theming: palettes, Sass themes, typography, elevations, component tokens, dark/light themes, spacing, sizing, and roundness.
SkillBFreshness: B★ 19Claude Code +9 - 0.605score
igniteui-angular-grids
imported-and-adapted-by-lucy-camilo
Ignite UI for Angular data grids: flat, tree, hierarchical, pivot, grid lite, columns, editing, selection, grouping, export, remote data, paging, state, sizing.
SkillBFreshness: B★ 19Claude Code +9 - 0.605score
igniteui-angular-generate-from-image-design
imported-and-adapted-by-lucy-camilo
Implement Angular views from design images using Ignite UI Angular components and theming.
SkillBFreshness: B★ 19Claude Code +9 - 0.605score
igniteui-angular-components
imported-and-adapted-by-lucy-camilo
Ignite UI for Angular non-grid UI components: setup, forms, layouts, feedback, data display, directives, charts, Dock/Layout/Tile managers.
SkillBFreshness: B★ 19Claude Code +9 - 0.605score
azure-devops-cli
imported-and-adapted-by-lucy-camilo
Manage Azure DevOps resources via CLI including projects, repos, pipelines, builds, pull requests, work items, artifacts, and service endpoints.
SkillBFreshness: B★ 19Claude Code +9 - 0.604score
lucy-agent
lucy-ai
Lucy-ai's own agent ecosystem installer, updater, and verifier.
SkillBFreshness: B★ 19Claude Code +9 - 0.603score
ado-effort-estimation
imported-and-adapted-by-lucy-camilo
Estimate Azure Boards work with a mandatory clarifying-question gate and story-point guardrails.
SkillBFreshness: B★ 19Claude Code +9 - 0.603score
git-commit
imported-and-adapted-by-lucy-camilo
Create git commits with conventional commit message analysis, safe staging, and logical grouping.
SkillBFreshness: B★ 19Claude Code +9 - 0.603score
dotnet10-csharp14
lucy-camilo
Project-agnostic .NET 10 and C# 14 best practices: field keyword, null-conditional assignment, extension members, unbound generic nameof, runtime…
SkillBFreshness: B★ 19Claude Code +9 - 0.603score
csharp-dotnet
lucy-camilo
C# and .NET patterns for OpenClaw.
SkillBFreshness: B★ 19Claude Code +9 - 0.603score
find-skills
imported-and-adapted-by-lucy-camilo
Discover, evaluate, and install agent skills when the user asks for new capabilities, asks whether a skill exists, shares a skill archive, or wants help…
SkillBFreshness: B★ 19Claude Code +9 - 0.603score
issue-creation
imported-and-adapted-by-lucy-camilo
Create clear issue drafts with reproducible context, acceptance criteria, and definition of done.
SkillBFreshness: B★ 19Claude Code +9
Signals
- Stars
- 19
- Forks
- 2
- Open issues
- 0
- Last commit (this folder)
- Jul 29, 2026 (3 months ago)
- Last release
- Jul 31, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.1
- License
- Apache-2.0
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from imported-and-adapted-by-lucy-camilo
- 0.605score
igniteui-angular-grids
imported-and-adapted-by-lucy-camilo
Ignite UI for Angular data grids: flat, tree, hierarchical, pivot, grid lite, columns, editing, selection, grouping, export, remote data, paging, state, sizing.
SkillBFreshness: B★ 19Claude Code +9 - 0.605score
igniteui-angular-theming
imported-and-adapted-by-lucy-camilo
Ignite UI for Angular theming: palettes, Sass themes, typography, elevations, component tokens, dark/light themes, spacing, sizing, and roundness.
SkillBFreshness: B★ 19Claude Code +9 - 0.605score
azure-devops-cli
imported-and-adapted-by-lucy-camilo
Manage Azure DevOps resources via CLI including projects, repos, pipelines, builds, pull requests, work items, artifacts, and service endpoints.
SkillBFreshness: B★ 19Claude Code +9 - 0.605score
igniteui-angular-generate-from-image-design
imported-and-adapted-by-lucy-camilo
Implement Angular views from design images using Ignite UI Angular components and theming.
SkillBFreshness: B★ 19Claude Code +9 - 0.605score
igniteui-angular-components
imported-and-adapted-by-lucy-camilo
Ignite UI for Angular non-grid UI components: setup, forms, layouts, feedback, data display, directives, charts, Dock/Layout/Tile managers.
SkillBFreshness: B★ 19Claude Code +9 - 0.603score
git-commit
imported-and-adapted-by-lucy-camilo
Create git commits with conventional commit message analysis, safe staging, and logical grouping.
SkillBFreshness: B★ 19Claude Code +9
Cite this page
sql-code-review skill. Agent Mart. https://agentmart.dev/skills/camiloandresgtruniandes-sql-code-review (last updated 2026-10-24)