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 dayfinggg/openai-codex-agent-skills --skill database-query-diagnosisgit clone --depth 1 https://github.com/dayfinggg/openai-codex-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/dayfinggg/openai-codex-agent-skills/database-query-diagnosis)<a href="https://agentmods.dev/skills/dayfinggg/openai-codex-agent-skills/database-query-diagnosis"><img src="https://agentmods.dev/badge/skills/dayfinggg/openai-codex-agent-skills/database-query-diagnosis/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/dayfinggg/openai-codex-agent-skills/database-query-diagnosis"><img src="https://agentmods.dev/badge/skills/dayfinggg/openai-codex-agent-skills/database-query-diagnosis.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.00040 | $0.00375 |
| Opus 5.5 | $0.00016 | $0.00150 |
| Sonnet 5.5 | $0.00008 | $0.00075 |
| Haiku 4.5 | $0.00004 | $0.00038 |
Grade A, and why
database-query-diagnosis 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 today.
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
Locate the database bottleneck with evidence from the affected workload.
- Establish the engine, version, database, role, time interval, query fingerprint, parameters, and user-visible symptom. Separate execution time from connection checkout, network time, and application materialization.
- Inspect the schema, constraints, indexes, statistics, expected result grain, and relevant transaction boundaries. Reuse existing authorized access and keep queries bounded.
- Read a plain execution plan where appropriate. Before EXPLAIN ANALYZE, inspect side effects and workload cost because it executes the statement. Use a safe representative environment when execution would exceed authorization.
- Examine estimated and actual rows, loops, filtering, sort or hash spills, access paths, and wait events where available. A sequential scan or filesort is not automatically a defect.
- For locking, identify blockers, transaction age, lock ordering, and application retry behavior. For connections, separate pool configuration, leaks, long transactions, and server saturation.
- Test the smallest plausible correction against counterevidence. Consider index write cost, parameter sensitivity, result correctness, and other consumers before changing a shared object.
- Compare equivalent inputs, data, concurrency, and cache conditions before and after. Verify row identity and ordering as well as latency. Stop when the reported issue is resolved and the relevant regression check passes.
Use installed PostgreSQL, MongoDB, Redis, or ClickHouse specialists when their engine-specific procedure applies. Do not broaden production scans or terminate sessions merely to simplify investigation.
Consult the engine's official plan and monitoring documentation. Distinguish a suspected bottleneck from a reproduced and measured cause.
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.
- today First seen · 20 lines · 40 tokens per session scan A fbe7873a8d5c
database-query-diagnosis is a skill published in the GitHub repository dayfinggg/openai-codex-agent-skills (8 stars, last pushed today), licensed MIT. It adds 40 tokens to every session and 375 once invoked, about $0.0002 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-10-30.
Other skills, from other repositories
oracle-sql-diagnosis
Use when the answer needs Oracle SQL evidence (read-only), or when Java code touches the database - to prove behavior on the data and assess the impact of the Java change.
prisma-connection-pool-exhaustion
Fix Prisma "Too many connections" and connection pool exhaustion errors in serverless environments (Vercel, AWS Lambda, Netlify). Use when: (1) Error "P2024: Timed out fetching a new connection from the pool", (2) PostgreSQL "too many connections for role", (3) Database works locally but fails in production…
triage-issues
Triage GitHub issues in the googleapis/mcp-toolbox repo: propose the correct labels (type / priority / product / status), check for duplicates, verify a bug has enough info to act on, and draft a triage comment. Use whenever a maintainer asks you to triage, label, categorize, prioritize, or "look at" an issue (or a…
graphjin-eval
Create, extend, run, baseline, and diagnose GraphJin agent evaluations through the graphjin eval CLI.
read-only-investigation
Use this reference when a user asks to investigate unexpected rows, a failed read, a slow query or a metadata mismatch without changing database state.
mma-investigator
Expert system for investigating MMA (Multi-Metric Allocator) behavior on CockroachDB clusters. Helps oncall engineers diagnose load imbalances, understand rebalancing decisions, and identify why MMA did or didn't act.