sql-safety-review
CommunityAssess SQL queries for risk and safe rewrites.
Authorwinhok
Version1.0.0
Installs0
System Documentation
What problem does it solve?
评估 SQL SELECT 查询是否存在炸库风险(全表扫描、大范围扫描、排序/临时表开销),并给出更安全的改写方案,同时引导用户通过 EXPLAIN 与表结构信息进行精确诊断。当用户贴出SQL问“能不能跑”时,也应触发。
Core Features & Use Cases
- 静态诊断:识别扫描范围、索引命中、排序/分组、JOIN 与结果集等风险信号。
- 安全改写:提供按范围缩小、返回字段限制、分页等的改写策略与具体示例。
- 指引诊断:引导提供 EXPLAIN 计划、SHOW CREATE TABLE、数据量等信息以进行精确分析。
- 流程化诊断:分阶段进行静态分析与后续的精确分析,提升诊断可重复性。
Quick Start
请对给定的 SELECT SQL 进行初步风险评估,提出安全改写与 EXPLAIN 指引。
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: sql-safety-review Download link: https://github.com/winhok/testkit/archive/main.zip#sql-safety-review Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.