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 ntygod/ZhiWei --skill database-querygit clone --depth 1 https://github.com/ntygod/ZhiWeiWrote 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/ntygod/zhiwei/database-query)<a href="https://agentmods.dev/skills/ntygod/zhiwei/database-query"><img src="https://agentmods.dev/badge/skills/ntygod/zhiwei/database-query/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/ntygod/zhiwei/database-query"><img src="https://agentmods.dev/badge/skills/ntygod/zhiwei/database-query.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00037 | $0.00621 |
| Opus 5.5 | $0.00015 | $0.00248 |
| Sonnet 5.5 | $0.00007 | $0.00124 |
| Haiku 4.5 | $0.00004 | $0.00062 |
Grade A, and why
database-query 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 3mo 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
数据库查询指南
通过 shell_exec 调 sqlite3 / mysql / psql CLI 连接外部数据库执行 SQL。核心约束:默认只允许 SELECT;写操作必须用户确认。
适用场景
- 查询数据(SELECT)
- 写 / 优化 SQL 语句
- 导出查询结果(CSV / JSON)
- 分析库表结构(表 / 列 / 索引)
- 跨表关联(JOIN)/ 聚合(GROUP BY)
不适用场景
- 内存 CSV / Excel 分析 → data-analyst
- 日志文件分析 → log-analyzer
- 知微自身数据库(dataDir 下的 zhiwei.db)→ 用户没指明就不要碰
工作流(按场景分流)
| 场景 | 路径 |
|---|---|
| 第一次接触某库 | 先列表 → 再看 schema → 再写 SELECT |
| 已知表名查数据 | 直接写 SELECT,先 LIMIT 10 验证 → 全量 |
| 数据导出 | SELECT → CSV / JSON 落盘 |
| 写操作(INSERT/UPDATE/DELETE/DDL) | 先用 SELECT 看影响范围 → 用户确认 → 执行 |
| SQL 优化 | EXPLAIN 看执行计划 → 改写 |
各路径要点:
- 连接信息确认:类型(SQLite / MySQL / PostgreSQL)+ 地址 + 库名 + 用户;密码走环境变量
$DB_PASS,不明文 - 列表 / schema 探索:方言不同(SQLite
.tables/ MySQLSHOW TABLES/ PostgreSQL\dt),见参考 - 预览先 LIMIT 10:未知数据量 / 未验证条件先小样验证,确认正确再去 LIMIT 跑全量
- 写操作保护:INSERT / UPDATE / DELETE / DROP / TRUNCATE 必须用户明确确认;DDL(ALTER / CREATE / DROP TABLE)尤其要二次确认
- 大表导出限范围:> 10 万行先按时间 / ID 范围切,不要一次拉全表
详细参考
- SQLite / MySQL / PostgreSQL 方言命令、导出语法、常见错误:
{skill_dir}/references/dialect-reference.md
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 3mo ago First seen · 59 lines · 37 tokens per session scan A ad6bb5357fd1
database-query is a skill published in the GitHub repository ntygod/ZhiWei (137 stars, last pushed 3mo ago), licensed MIT. It adds 37 tokens to every session and 621 once invoked, about $0.0001 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-30.
database-query compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| database-queryntygod/ZhiWei | Skill | 137 | 3mo ago | MIT | A | 37 | Claude Code, Codex |
| inbox-triagendunl075/alfred-pennyworth | Skill | 0 | 3mo ago | Apache-2.0 | A | 37 | Claude Code, Codex |
| morning-briefndunl075/alfred-pennyworth | Skill | 0 | 3mo ago | Apache-2.0 | A | 33 | Claude Code, Codex |
| weekly-reviewndunl075/alfred-pennyworth | Skill | 0 | 3mo ago | Apache-2.0 | A | 27 | Claude Code, Codex |
| lark-basePinvou/pinvou-agent | Skill | 3.0k | yesterday | MIT | A | 174 | Claude Code, Codex |
| utekecodecoradev/uteke | Skill | 295 | 2d ago | Apache-2.0 | A | 35 | Claude Code, Codex |
| holon-runtime-opsholon-run/holon | Skill | 209 | today | Apache-2.0 | A | 28 | Claude Code, Codex |