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 OKHP3/skillz --skill sql-optimizationgit clone --depth 1 https://github.com/OKHP3/skillzWrote 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/okhp3/skillz/sql-optimization)<a href="https://agentmods.dev/skills/okhp3/skillz/sql-optimization"><img src="https://agentmods.dev/badge/skills/okhp3/skillz/sql-optimization/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/okhp3/skillz/sql-optimization"><img src="https://agentmods.dev/badge/skills/okhp3/skillz/sql-optimization.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.00053 | $0.02201 |
| Opus 5.5 | $0.00021 | $0.00880 |
| Sonnet 5.5 | $0.00011 | $0.00440 |
| Haiku 4.5 | $0.00005 | $0.00220 |
Grade A, and why
sql-optimization 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 2mo 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 — 297 lines — stays where its author put it; the contents beside it link to each section on GitHub.
SQL Performance Optimization Assistant
Expert SQL performance optimization for ${selection} (or entire project if no selection). Focus on universal SQL optimization techniques that work across MySQL, PostgreSQL, SQL Server, Oracle, and other SQL databases.
🎯 Core Optimization Areas
Query Performance Analysis
-- ❌ BAD: Inefficient query patterns
SELECT * FROM orders o
WHERE YEAR(o.created_at) = 2024
AND o.customer_id IN (
SELECT c.id FROM customers c WHERE c.status = 'active'
);
-- ✅ GOOD: Optimized query with proper indexing hints
SELECT o.id, o.customer_id, o.total_amount, o.created_at
FROM orders o
INNER JOIN customers c ON o.customer_id = c.id
WHERE o.created_at >= '2024-01-01'
AND o.created_at < '2025-01-01'
AND c.status = 'active';
-- Required indexes:
-- CREATE INDEX idx_orders_created_at ON orders(created_at);
-- CREATE INDEX idx_customers_status ON customers(status);
-- CREATE INDEX idx_orders_customer_id ON orders(customer_id);
Index Strategy Optimization
-- ❌ BAD: Poor indexing strategy
CREATE INDEX idx_user_data ON users(email, first_name, last_name, created_at);
-- ✅ GOOD: Optimized composite indexing
-- For queries filtering by email first, then sorting by created_at
CREATE INDEX idx_users_email_created ON users(email, created_at);
-- For full-text name searches
CREATE INDEX idx_users_name ON users(last_name, first_name);
-- For user status queries
CREATE INDEX idx_users_status_created ON users(status, created_at)
WHERE status IS NOT NULL;
Subquery Optimization
-- ❌ BAD: Correlated subquery
SELECT p.product_name, p.price
FROM products p
WHERE p.price > (
SELECT AVG(price)
FROM products p2
WHERE p2.category_id = p.category_id
);
-- ✅ GOOD: Window function approach
SELECT product_name, price
FROM (
SELECT product_name, price,
AVG(price) OVER (PARTITION BY category_id) as avg_category_price
FROM products
) ranked
WHERE price > avg_category_price;
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.
- 2mo ago First seen · 297 lines · 53 tokens per session scan A d87639dea8e0
sql-optimization is a skill published in the GitHub repository OKHP3/skillz (4 stars, last pushed 3d ago), licensed MIT. It adds 53 tokens to every session and 2,201 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-09-03.
sql-optimization compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| sql-optimizationOKHP3/skillz | Skill | 4 | 3d ago | MIT | A | 53 | Claude Code, Codex |
| architecturefabiandistler/agents | Skill | 2 | yesterday | none | A | 62 | Claude Code |
| web-backend-builder0x-Professor/Agent-Skills-Hub | Skill | 12 | 9mo ago | Apache-2.0 | A | 24 | Claude Code, Codex |
| web-database-validator0x-Professor/Agent-Skills-Hub | Skill | 12 | 9mo ago | Apache-2.0 | A | 23 | Claude Code, Codex |
| ecto-patternsoliver-kriska/claude-elixir-phoenix | Skill | 579 | today | MIT | A | 51 | Claude Code |
| 312-frameworks-spring-data-jdbcjabrena/plinth | Skill | 470 | today | Apache-2.0 | A | 110 | Claude Code, Codex |
| couple-photo-orchestratoranbeime/skill | Skill | 10k | yesterday | none | A | 45 | Claude Code, Codex |