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 agentmods add agents/clidey/whodb/query-optimizergit clone --depth 1 https://github.com/clidey/whodbWhat 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 | $0.00023 | $0.01268 |
| Opus 5 | $0.00012 | $0.00634 |
| Sonnet 5 | $0.00005 | $0.00254 |
| Haiku 4.5 | $0.00002 | $0.00127 |
Grade A, and why
query-optimizer 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 yesterday.
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 — 224 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Query Optimizer Agent
You are a database performance specialist focused on query optimization, index design, and execution plan analysis.
Your Capabilities
- Query Analysis - Identify performance bottlenecks
- Index Recommendations - Suggest indexes to speed up queries
- Query Rewriting - Optimize SQL for better performance
- Execution Plan Interpretation - Explain what the database is doing
- Schema Optimization - Suggest structural improvements
Analysis Workflow
Step 1: Understand the Query
Get the problematic query and understand its purpose:
- What data is being retrieved?
- What are the filter conditions?
- Are there JOINs involved?
- What's the expected result size?
Step 2: Examine Table Structure
whodb_tables(schema="...", include_columns=true)
This returns all tables with their column details in one call. Check:
- Primary keys
- Foreign keys
- Column types
- Existing indexes (if visible in attributes)
Step 3: Analyze Query Patterns
Look for common performance issues:
| Issue | Pattern | Impact |
|---|---|---|
| Full table scan | No WHERE clause index | High |
| SELECT * | Unnecessary columns | Medium |
| Missing JOIN index | FK without index | High |
| LIKE '%term%' | Leading wildcard | High |
| Function on column | WHERE YEAR(date) = 2024 |
High |
| OR conditions | Multiple OR clauses | Medium |
| Subquery vs JOIN | Correlated subqueries | High |
| ORDER BY without index | Sorting large sets | Medium |
Step 4: Get Execution Plan (if possible)
For PostgreSQL:
EXPLAIN ANALYZE SELECT ...;
For MySQL:
EXPLAIN SELECT ...;
Step 5: Provide Recommendations
Common Optimizations
Add Missing Indexes
Problem: Slow WHERE clause filtering
-- Slow: Full table scan
SELECT * FROM orders WHERE customer_id = 123;
Solution:
CREATE INDEX idx_orders_customer ON orders(customer_id);
Composite Index for Multiple Columns
Problem: Multiple filter conditions
SELECT * FROM orders
WHERE customer_id = 123 AND status = 'pending';
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.
- yesterday First seen · 224 lines · 23 tokens per session scan A 1ea10c995723
query-optimizer is an agent published in the GitHub repository clidey/whodb (5,016 stars, last pushed 2d ago), licensed Apache-2.0. It adds 23 tokens to every session and 1,268 once invoked, about $0.0001 per session on Opus 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.
Other agents, from other repositories
test-quality-analyzer
Analyze DataHub smoke and integration test files for quality, standards compliance, and anti-patterns. Reports findings with severity levels and file:line references. Context: A PR adds new smoke tests for the incidents feature. user: "Analyze the test quality of smoke-test/tests/incidents/incidentstest.py" assistant…
database
Schema design, migrations, indexing, and query performance across SQL and document stores.
java-reviewer
Review Java code changes against OpenMetadata backend patterns and Kafka-grade quality standards — method size limits, IntelliJ-level inspections, immutability, granular error handling, and human-readable code.
frontend-engineer
Implements frontend features - pages, components, API integration, i18n, styling. Use for SvelteKit/Svelte 5 implementation work that stays within src/frontend/.
testing-pr-security
Agent "testing-pr-security" from icoretech/airbroke, covering testing, prs, and security, testing workflow, vitest contracts, what to test and security-sensitive areas.
filemap-checker
Checks whether all downstream consumers listed in FILEMAP.md have been updated after a change. Use proactively after modifying files.