Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/guyulong/cn-agent-skills/sql-reviewnpx skills add guyulong/cn-agent-skills --skill sql-reviewgit clone --depth 1 https://github.com/guyulong/cn-agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/guyulong/cn-agent-skills/sql-review)<a href="https://agentmods.dev/skills/guyulong/cn-agent-skills/sql-review"><img src="https://agentmods.dev/badge/skills/guyulong/cn-agent-skills/sql-review.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00009 | $0.00667 |
| Opus 5 | $0.00005 | $0.00333 |
| Sonnet 5 | $0.00002 | $0.00133 |
| Haiku 4.5 | $0.00001 | $0.00067 |
Grade A, and why
sql-review scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
SQL审查与优化
使用场景
审查SQL语句,发现性能问题并提供优化建议。
审查规则
🔴 严重问题
-
**SELECT ***
- 问题:查询所有字段,浪费资源
- 修复:只查询需要的字段
-
缺少WHERE条件
- 问题:全表扫描
- 修复:添加必要的过滤条件
-
隐式类型转换
- 问题:字段类型不匹配导致索引失效
- 示例:
WHERE phone = 13800138000(phone是varchar) - 修复:
WHERE phone = '13800138000'
-
前导通配符
- 问题:
LIKE '%keyword'无法使用索引 - 修复:考虑全文索引
- 问题:
🟡 性能问题
-
N+1查询
- 问题:循环中执行查询
- 修复:使用JOIN或批量查询
-
子查询效率低
- 问题:相关子查询
- 修复:改用JOIN
-
缺少索引
- 问题:WHERE/JOIN字段未建索引
- 修复:添加合适索引
-
排序未使用索引
- 问题:ORDER BY字段无索引
- 修复:添加联合索引
🟢 优化建议
-
分页优化
-- 慢:OFFSET大时性能差 SELECT * FROM orders LIMIT 10 OFFSET 10000; -- 快:使用游标分页 SELECT * FROM orders WHERE id > 10000 LIMIT 10; -
批量操作
-- 慢 INSERT INTO users (name) VALUES ('张三'); INSERT INTO users (name) VALUES ('李四'); -- 快 INSERT INTO users (name) VALUES ('张三'), ('李四'); -
EXPLAIN分析
EXPLAIN SELECT * FROM users WHERE phone = '13800138000'; -- 查看 type、key、rows 字段
输出格式
SQL审查报告
━━━━━━━━━━━━━━━━━━━━━━━━
原始SQL: SELECT * FROM users WHERE phone = 13800138000
问题:
🔴 [严重] SELECT * - 建议只查询需要的字段
🔴 [严重] 隐式类型转换 - phone字段应使用字符串
🟡 [建议] phone字段建议添加索引
优化后:
SELECT id, name, phone FROM users WHERE phone = '13800138000';
建议索引:
CREATE INDEX idx_phone ON users(phone);
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 94 lines · 9 tokens per session scan A 73654791111b
sql-review is a skill published in the GitHub repository guyulong/cn-agent-skills (2 stars, last pushed 3mo ago), licensed MIT. It adds 9 tokens to every session and 667 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
relational-database-design
Designs or reviews a relational database schema for a given domain. Covers table structure, normalization, indexes, constraints, and migration strategy. Invoked when the user asks to design a schema, review a database structure, or optimize a data model.
SQL Query Optimizer
Reviews SQL queries for performance issues and rewrites them with optimized execution plans.
database-safety
规则: 每个 migration 必须配 down 方法(回滚路径);对行数超过百万的表加列或建索引,必须评估锁表风险,使用在线 DDL 工具(pt-online-schema-change、gh-ost 或数据库自带的 ALGORITHM=INPLACE)而非直接 ALTER TABLE。.
ascend-profiler-db-explorer
面向 Ascend PyTorch Profiler / msprof DB(如 ascendpytorchprofiler.db、msprof.db)的 SQL 分析技能。将自然语言问题(算子耗时、通信、下发、调度、schema/table 查询)转为安全可执行 SQL,并按需从官方文档提取表结构详情。.
review-prs
Review a GitHub pull request in the googleapis/mcp-toolbox repo against the team's reviewer checklist: PR title/description conventions, linked issue, logic errors and unhandled edge cases, breaking changes, test coverage, docs updates, security (input handling), and new dependencies. Use whenever a maintainer asks…
migration-review
Review database migration files when a change adds or modifies paths under migrations/. Use it before merge to collect forward, rollback, locking, and data-safety evidence.