SQL Code Review

Use when reviewing SQL across MySQL, PostgreSQL, SQL Server, or Oracle for injection risk, access control, correctness, performance, maintainability, and migration safety.

9 stars 3 forksDatabases

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add sandbaseai/workbuddy-skill --skill sql-code-review
Manual install
git clone --depth 1 https://github.com/sandbaseai/workbuddy-skill.git /tmp/workbuddy-skill
mkdir -p ~/.claude/skills
cp -r /tmp/workbuddy-skill/skills/sql-code-review ~/.claude/skills/sql-code-review

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# SQL 代码评审

对 SQL 和数据访问代码做跨数据库评审,优先发现会导致数据泄露、错误写入、锁争用或不可逆迁移的风险。结论必须绑定语句、调用位置、数据库类型和可复现证据。

## 检查清单

- **注入与参数**:确认用户输入、排序字段、表名和动态条件使用白名单或参数化;禁止字符串拼接 SQL。
- **权限**:检查最小权限、角色继承、RLS/视图边界、函数执行者权限和敏感列暴露。
- **正确性**:检查 NULL、重复行、JOIN 基数、事务边界、隔离级别、时区、分页和幂等性。
- **性能**:检查谓词可索引性、隐式类型转换、全表扫描、N+1、排序/聚合内存、统计信息和执行计划。
- **可维护性**:检查命名、重复逻辑、硬编码状态、方言依赖、错误处理和测试覆盖。
- **迁移**:检查兼容窗口、锁持有、回填批次、约束验证、复制延迟、回滚和旧客户端行为。

## 工作流程

1. 锁定数据库方言/版本、调用方、数据敏感级别、读写比例和评审范围。
2. 先做静态审查,再结合脱敏 schema、参数样例、基数和 `EXPLAIN`/等效计划验证高风险项。
3. 对每项发现输出严重度、精确位置、触发条件、证据、影响、修复建议和回归验证。
4. 用临时环境和单变量实验验证性能或迁移建议,不直接修改生产数据库。

## WorkBuddy 安全边界

- 默认只读;不得执行未授权 DDL/DML、权限变更、锁表、删除或生产诊断。
- 示例使用占位符和脱敏数据,不输出连接串、令牌、客户记录或完整生产快照。
- 缺少方言、版本、计划或数据量时标为未知,不把通用建议包装成确定结论。
Read the full skill on GitHub

Details

Skill name
sql-code-review
Path
skills/sql-code-review/SKILL.md
License
MIT
Repo updated
8 September 2026

FAQ

What does the SQL Code Review skill do?

Use when reviewing SQL across MySQL, PostgreSQL, SQL Server, or Oracle for injection risk, access control, correctness, performance, maintainability, and migration safety.

How do I install the SQL Code Review skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add sandbaseai/workbuddy-skill --skill sql-code-review. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is SQL Code Review popular?

It lives in sandbaseai/workbuddy-skill, which has 9 GitHub stars and 3 forks.

Related skills

Access Control Security Best Practices

9

sandbaseai/workbuddy-skill

Design, review, implement, and verify least-privilege access controls across users, services, tenants, resources, and administrative workflows.

Security

Accessibility Review

9

sandbaseai/workbuddy-skill

Use when reviewing a web interface or interaction for semantic, keyboard, focus, screen-reader, ARIA, and contrast accessibility risks.

Frontend & Design

Acquire Codebase Knowledge

9

sandbaseai/workbuddy-skill

Use when the user asks to map, document, or onboard into an existing codebase and needs evidence-backed architecture, structure, conventions, integrations, testing, and concerns documentation.

Software Development

SQL Optimization

9

sandbaseai/workbuddy-skill

Universal SQL performance optimization assistant for comprehensive query tuning, indexing strategies, and database performance analysis across all SQL databases (MySQL, PostgreSQL, SQL Server, Oracle). Provides execution plan analysis, pagination optimization, batch operations, and performance monitoring guidance.

Databases

Schema Design

9

sandbaseai/workbuddy-skill

Use when designing or reviewing relational schema changes, initialization SQL, migrations, privileges, seed data, constraints, indexes, or schema tests; preserve authority boundaries and verify the real database contract.

Databases

Importing Data

5

tilmon-engineering/claude-skills

Systematic CSV import process - discover structure, design schema, standardize formats, import to database, detect quality issues (component skill for DataPeeker analysis sessions)

Databases

Browse the most popular Claude skills, all databases skills, or write your own with the skills generator.