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 seed-forge/harness-ai-kit --skill diag-mysql-slow-querygit clone --depth 1 https://github.com/seed-forge/harness-ai-kitWrote 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/seed-forge/harness-ai-kit/diag-mysql-slow-query)<a href="https://agentmods.dev/skills/seed-forge/harness-ai-kit/diag-mysql-slow-query"><img src="https://agentmods.dev/badge/skills/seed-forge/harness-ai-kit/diag-mysql-slow-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/seed-forge/harness-ai-kit/diag-mysql-slow-query"><img src="https://agentmods.dev/badge/skills/seed-forge/harness-ai-kit/diag-mysql-slow-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.00082 | $0.01722 |
| Opus 5.5 | $0.00033 | $0.00689 |
| Sonnet 5.5 | $0.00016 | $0.00344 |
| Haiku 4.5 | $0.00008 | $0.00172 |
Grade A, and why
diag-mysql-slow-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.
How it starts
The opening of the file, as written. The whole thing — 216 lines — stays where its author put it; the contents beside it link to each section on GitHub.
MySQL Slow Query Full-Chain Diagnostics
用途
当用户报告查询慢、接口超时、或怀疑 SQL 性能问题时触发。覆盖:
- 接口响应变慢,怀疑数据库层
SHOW PROCESSLIST看到大量Sending data/Waiting for table metadata lock- 慢查询日志告警
- 定期慢 SQL 巡检
本技能是自包含诊断 Runbook。
输入
- MySQL 连接信息(host / port / user / password)
- 可选:已知慢 SQL 片段或时间段
输出
- 慢查询分析报告(填充输出模板)
- Top-N 慢 SQL + EXPLAIN 结果 + 优化建议
前置条件
| 项 | 要求 |
|---|---|
| MySQL 权限 | PROCESS, SELECT(performance_schema) |
| 版本 | MySQL 5.7+(8.0 优先用 performance_schema) |
诊断步骤
Step 1: 检查慢查询日志配置
SHOW VARIABLES LIKE 'slow_query_log'; -- 是否开启
SHOW VARIABLES LIKE 'slow_query_log_file'; -- 日志路径
SHOW VARIABLES LIKE 'long_query_time'; -- 阈值(秒)
SHOW VARIABLES LIKE 'log_queries_not_using_indexes'; -- 是否记录无索引查询
SHOW VARIABLES LIKE 'min_examined_row_limit';
如果未开启,建议临时开启(需 SUPER 权限):
SET GLOBAL slow_query_log = ON;
SET GLOBAL long_query_time = 1;
SET GLOBAL log_queries_not_using_indexes = ON;
Step 2: 从 performance_schema 获取 Top-N 慢 SQL(MySQL 8.0+)
SELECT
DIGEST_TEXT AS query_pattern,
COUNT_STAR AS exec_count,
ROUND(SUM_TIMER_WAIT / 1000000000000, 2) AS total_time_s,
ROUND(AVG_TIMER_WAIT / 1000000000000, 4) AS avg_time_s,
SUM_ROWS_EXAMINED AS rows_examined,
SUM_ROWS_SENT AS rows_sent,
SUM_NO_INDEX_USED AS no_index_count,
FIRST_SEEN, LAST_SEEN
FROM performance_schema.events_statements_summary_by_digest
WHERE SCHEMA_NAME IS NOT NULL
AND DIGEST_TEXT NOT LIKE 'SHOW%'
AND DIGEST_TEXT NOT LIKE 'SET%'
ORDER BY SUM_TIMER_WAIT DESC
LIMIT 20;
Step 3: EXPLAIN 可疑 SQL
EXPLAIN FORMAT=JSON {slow_query};
-- 或
EXPLAIN ANALYZE {slow_query}; -- MySQL 8.0.18+
关注:
| 字段 | 问题信号 |
|---|---|
type = ALL |
全表扫描 |
rows >> 实际返回行数 |
扫描过多 |
Extra = Using filesort |
排序未用索引 |
Extra = Using temporary |
临时表 |
possible_keys = NULL |
无可用索引 |
Step 4: 检查缺失索引
-- 未使用索引的查询统计(8.0+)
SELECT
OBJECT_SCHEMA, OBJECT_NAME, INDEX_NAME,
COUNT_STAR, COUNT_READ, COUNT_WRITE
FROM performance_schema.table_io_waits_summary_by_index_usage
WHERE INDEX_NAME IS NULL
AND OBJECT_SCHEMA NOT IN ('mysql', 'performance_schema', 'information_schema')
ORDER BY COUNT_STAR DESC
LIMIT 20;
What ships with it
3 files 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 · 216 lines · 82 tokens per session scan A 04e4ec1e34fb
diag-mysql-slow-query is a skill published in the GitHub repository seed-forge/harness-ai-kit (26 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 82 tokens to every session and 1,722 once invoked, about $0.0003 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.
diag-mysql-slow-query compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| diag-mysql-slow-queryseed-forge/harness-ai-kit | Skill | 26 | 3mo ago | Apache-2.0 | A | 82 | Claude Code, Codex |
| sql-optimization-patternswshobson/agents | Skill | 43k | 2d ago | MIT | A | 44 | Claude Code |
| rescuesuboss87/FDEOps | Skill | 776 | yesterday | MIT | A | 48 | Claude Code, Codex |
| lcx-report-bugcode-yeongyu/oh-my-openagent | Skill | 71k | today | none | A | 85 | Codex |
| ast-grepcode-yeongyu/oh-my-openagent | Skill | 71k | today | none | A | 61 | Claude Code, Codex |
| debuggingcode-yeongyu/oh-my-openagent | Skill | 71k | today | none | A | 53 | Claude Code, Codex |
| lcx-doctorcode-yeongyu/oh-my-openagent | Skill | 71k | today | none | A | 93 | Codex |