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 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/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<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="Reviewed on agentmods" width="80" 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.5 | $0.00004 | $0.00267 |
| Sonnet 5.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 1mo 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.
- 1mo 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 (3 stars, last pushed 4mo ago), licensed MIT. It adds 9 tokens to every session and 667 once invoked, about $0.0000 per session on Opus 5.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
A set of database-safety rules for schema changes, queries, and data updates, including rollback paths and safeguards for large tables.
ascend-profiler-db-explorer
A SQL analysis skill for Ascend PyTorch Profiler and msprof database files. It turns questions about operator timing, communication, scheduling, or database tables into safe SQL queries and can look up official schema details.
triage-contributor-pr
Triage open pull requests from external contributors to prisma/orm and produce a per-PR verdict with evidence. Use when a maintainer asks to triage, evaluate, assess, or review the queue of incoming contributor PRs, to decide whether a fork PR is safe to run CI on, to check whether a PR is in scope for its version…
review-implement-phase
Implements triaged review actions, commits focused fixes, and posts Done plus resolves threads. Use when the user wants only the implementation phase of the review-framework workflow.