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.
git clone --depth 1 https://github.com/killvxk/pm-skills-zhWrote 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/commands/killvxk/pm-skills-zh/write-query)<a href="https://agentmods.dev/commands/killvxk/pm-skills-zh/write-query"><img src="https://agentmods.dev/badge/commands/killvxk/pm-skills-zh/write-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/commands/killvxk/pm-skills-zh/write-query"><img src="https://agentmods.dev/badge/commands/killvxk/pm-skills-zh/write-query.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.00022 | $0.00750 |
| Opus 5.5 | $0.00009 | $0.00300 |
| Sonnet 5.5 | $0.00004 | $0.00150 |
| Haiku 4.5 | $0.00002 | $0.00075 |
Grade A, and why
write-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
/write-query -- SQL 查询生成器
用自然语言描述你需要的数据,即可获得经过优化的 SQL 查询。支持多种数据库方言,也可读取上传文件中的数据库结构。
调用方式
/write-query 查看过去 30 天的每日活跃用户数,按套餐等级分组
/write-query 找出上个月注册但从未完成新手引导的用户
/write-query [上传数据库结构图] 按同期群统计试用转付费的转化率是多少?
工作流程
第一步:理解需求
解析用户的自然语言请求,识别:
- 需要查询的数据(指标、维度、过滤条件)
- 时间范围与时间粒度
- 分组和排序偏好
- 输出形式(原始数据、聚合数据、排名)
第二步:确认数据库结构
如果有可用的结构信息(上传的结构图、DDL 或文字描述):
- 将请求映射到具体的表和字段
- 识别所需的关联关系
如果没有提供结构信息:
- 询问数据库类型(BigQuery、PostgreSQL、MySQL 等)
- 根据问题推断合理的数据库结构,并请用户确认
- 以常见 SaaS 数据模型惯例作为默认假设
第三步:生成查询
应用 sql-queries 技能:
- 使用正确的方言编写 SQL 查询
- 兼顾可读性和执行性能进行优化
- 添加注释,解释关键逻辑
- 对于复杂查询,使用 CTE(公共表表达式)提升可读性
- 处理边界情况(NULL 值、时区处理、去重逻辑)
第四步:呈现结果并迭代
## SQL 查询:[查询说明]
**方言**:[BigQuery / PostgreSQL / MySQL / 其他]
**涉及的表**:[列表]
### 查询语句
[带注释的 SQL 代码块]
### 返回结果说明
[输出内容描述:字段、行数、预期结果形态]
### 假设条件
- [关于数据库结构的假设]
- [关于业务逻辑的假设]
### 备注
- [大数据集的性能注意事项]
- [已处理或已标记的边界情况]
后续可提供:
- "要我修改这个查询——增加过滤条件、调整分组或延长时间范围吗?"
- "要我生成一个配套查询来查看相关指标吗?"
- "要我围绕这个查询搭建一个数据看板吗?"
- "需要这个数据的同期群分析版本吗?"
注意事项
- SQL 中始终加注释——产品经理会把查询分享给分析师,对方需要理解查询意图
- 优先选择可读性强的写法,而非炫技——用 CTE 而非嵌套子查询
- 标记可能在大数据集上运行缓慢的查询,并提供优化建议
- 如果需求模糊(例如"活跃用户"),请用户明确定义该指标
- 如果用户不确定使用的是哪个数据库,可以提供多种方言版本
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 · 85 lines · 22 tokens per session scan A 8420fefb5197
write-query is a command published in the GitHub repository killvxk/pm-skills-zh (189 stars, last pushed 8mo ago), licensed MIT. It adds 22 tokens to every session and 750 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.
write-query compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| write-querykillvxk/pm-skills-zh | Command | 189 | 8mo ago | MIT | A | 22 | Claude Code |
| initfcakyon/claude-codex-settings | Command | 1.2k | today | Apache-2.0 | A | 0 | Claude Code |
| securityajitpratap0/GoSQLX | Command | 127 | 2d ago | Apache-2.0 | A | 21 | Claude Code |
| database-setupimsaif/design-with-claude | Command | 11 | 15d ago | MIT | A | 36 | Claude Code |
| new-migrationRaNDoM6913/claude-code-superkit | Command | 3 | today | MIT | A | 22 | Claude Code |
| json.batch_getstratalab/strata-core | Command | 5 | today | Apache-2.0 | A | 0 | Claude Code |
| kv.batch_getstratalab/strata-core | Command | 5 | today | Apache-2.0 | A | 0 | Claude Code |