SQL Reviewer
Use when reviewing SQL for data development. Checks logic correctness, metric consistency, joins, aggregations, deduplication, null handling, date boundaries, partition filters, performance risks, engine-specific issues, and safer rewrite suggestions. 中文触发词:SQL 审查、SQL Review、SQL 算错、慢 SQL。
Install
npx skills add shisuidata/ss-data-skills --skill sql-reviewergit clone --depth 1 https://github.com/shisuidata/ss-data-skills.git /tmp/ss-data-skills
mkdir -p ~/.claude/skills
cp -r /tmp/ss-data-skills/skills/sql-reviewer ~/.claude/skills/sql-reviewerPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# SQL Reviewer ## 目标 审查数据开发 SQL 的逻辑正确性、口径一致性和性能风险。 这个 Skill 不只是格式化 SQL,而是站在数据开发代码审查的角度,判断这段 SQL 会不会算错、跑慢、影响下游或难以维护。 ## 使用场景 使用这个 Skill,当用户需要审查: - Hive SQL - Spark SQL - Flink SQL - ClickHouse SQL - MySQL 或 PostgreSQL 分析 SQL - dbt model SQL - 临时取数 SQL - 看板或报表 SQL - 指标计算 SQL 重点适合检查: - Join 是否放大数据 - 聚合粒度是否正确 - 去重逻辑是否可靠 - 日期边界是否准确 - 分区过滤是否缺失 - NULL 是否影响结果 - 窗口函数是否符合预期 - 指标口径是否被 SQL 改写 - 大表扫描、数据倾斜、重复计算等性能风险 ## 不适用场景 不要用这个 Skill 直接完成: - 从零澄清需求,请使用 `data-requirement-clarifier` - 指标定义专项审查,请使用 `metric-definition-reviewer` - 表结构设计,请使用 `table-design-advisor` - 数据质量规则生成,请使用 `data-quality-rule-generator` 如果缺少表结构或业务口径,可以继续审查 SQL 结构,但必须标记结论的不确定性。 ## 输入信息 最少输入: - SQL 可选输入: - 执行引擎 - 表结构 - 表数据量级 - 分区字段 - 指标口径 - 期望结果粒度 - 报错日志 - 运行耗时 - 下游使用场景 ## 上下文建议 推荐使用 [SQL 审查上下文模板](../../context/templates/sql-review-context.md)。 最有价值的上下文是:执行引擎、表结构、分区字段、指标口径、期望结果粒度和数据量级。缺少表结构时仍可审查 SQL 结构,但字段唯一性、Join 放大和性能判断必须降级为风险提示。 ## 审查流程 1. 判断 SQL 目标:这段 SQL 想产出什么结果。 2. 识别结果粒度:最终一行代表什么。 3. 检查输入表:主表、维表、事实表、临时表和过滤条件。 4. 检查 Join:关联键、关联类型、是否可能一对多放大。 5. 检查聚合:GROUP BY 字段是否匹配指标粒度。 6. 检查去重:ROW_NUMBER、COUNT DISTINCT、主键去重是否符合业务。 7. 检查时间条件:自然日、分区日、事件时间、支付时间、跨天边界。 8. 检查 NULL 和默认值:是否影响加总、比较、Join 和分组。 9. 检查窗口函数:PARTITION BY、ORDER BY、排序稳定性。 10. 检查性能:分区裁剪、重复扫描、大表 Join、数据倾斜、无谓排序。 11. 检查可维护性:命名、CTE 拆分、注释、硬编码。 12. 给出修复建议:优先修正会导致结果错误的问题。 ## 可用脚本 有 SQL 且能执行代码时,先跑静态检查,再做人工审查: ```bash python3 scripts/sql_lint.py check --sql query.sql --dialect spark --partition-col dt ```
Details
- Skill name
sql-reviewer- Repository
- shisuidata/ss-data-skills
- Path
skills/sql-reviewer/SKILL.md- License
- MIT
- Repo updated
- 8 November 2026
FAQ
What does the SQL Reviewer skill do?
Use when reviewing SQL for data development. Checks logic correctness, metric consistency, joins, aggregations, deduplication, null handling, date boundaries, partition filters, performance risks, engine-specific issues, and safer rewrite suggestions. 中文触发词:SQL 审查、SQL Review、SQL 算错、慢 SQL。
How do I install the SQL Reviewer skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add shisuidata/ss-data-skills --skill sql-reviewer. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is SQL Reviewer popular?
It lives in shisuidata/ss-data-skills, which has 9 GitHub stars and 0 forks.
Related skills
Ab Test Analysis
9shisuidata/ss-data-skills
Use when designing, checking, or interpreting A/B tests and experiments. Computes significance, confidence intervals, sample ratio mismatch, power, CUPED, and sample size with a bundled zero-dependency script, then judges validity risks, guardrails, and ship/iterate/rollback decisions and renders an HTML experiment report. 中文触发词:A/B 实验、AB 测试、实验解读、显著性、样本量计算、能不能全量。
Business Root Cause Analysis
9shisuidata/ss-data-skills
Use when diagnosing business metric changes or anomalies such as GMV decline, conversion drop, retention loss, churn increase, revenue change, lead decline, or active user fluctuation with a structured root cause analysis plan. 中文触发词:指标归因、为什么下降、异常排查、GMV 下滑、指标波动原因。
Daily Report Writer
9shisuidata/ss-data-skills
Use when writing a concise daily report, daily worklog, standup update, shift handoff, or end-of-day summary for data analysis, data development, BI, governance, or operations work. 中文触发词:日报、日终同步、站会发言、值班交接。
Flyway Migrations
5senoritadeveloper01/claude-skills
Use this skill when creating or reviewing Flyway database migrations in a Spring Boot project. Covers schema evolution, data migrations, zero-downtime strategies, and PostgreSQL best practices.
Paddle Subscription Sync
9PaddleHQ/paddle-agent-skills
Mirror Paddle subscription and customer state into your database via webhooks — schema, upsert pattern, status semantics, scheduled changes, and access gating.
Wp Migrate
9morrealev/wordpress-manager
This skill should be used when the user asks to "migrate a site", "move WordPress", "transfer my site", "clone site", "copy site to new hosting", or mentions any WordPress migration between hosts or platforms. Covers full site, content-only, and database migrations.
Browse the most popular Claude skills, all databases skills, or write your own with the skills generator.