Data & SQL · agent skill
Query Optimizer
EXPLAIN-driven tuning with before and after timings.
What it does
Loads when it is needed
Your agent loads it when a query or page is slow. It carries 5 rules and reads a profile.md with your details before it starts, so the output matches your brand and project.
Same prompt, with and without
Slow account events feed
Prompt · This events feed query is taking about 1.9s p95 and gets hit on every dashboard load. Here's the plan. Can you fix it?
SELECT id, kind, payload_size, created_at FROM events
WHERE account_id = 8841 AND kind = 'invoice.paid' AND created_at >= now() - interval '30 days'
ORDER BY created_at DESC LIMIT 50;
Limit (actual time=1893.4..1893.5 rows=50 loops=1)
-> Sort (actual time=1893.4..1893.4 rows=50) Sort Key: created_at DESC, Method: top-N heapsort
-> Gather (workers launched 2)
-> Parallel Seq Scan on events (actual time=0.9..1871.2 rows=1480 loops=3)
Filter: (account_id = 8841 AND kind = 'invoice.paid' AND created_at >= ...)
Rows Removed by Filter: 12664000
Buffers: shared hit=1204 read=412880
Execution Time: 1894.1 ms
Table events: 38M rows. Indexes: events_pkey, idx_events_created_at. ~250 inserts/s. Called ~40x/min. Measured on a replica.Profile used: Postgres 16, Prisma, 38M-row events table; snake_case, idx_<table>_<cols> index names
Both answers from the same model (Claude sonnet), 2026-10-16. The one without the skill was written in a separate session that never saw it. Shortened where marked with …
Install
One command, in your project
It detects your agent; add --agent all for every agent.
npx proskills-cli add query-optimizer --order <order id from your receipt>
Or copy the skill folder (the one holding SKILL.md) into the directory your agent reads, then restart it or start a new session.
| Agent | This project | Every project |
|---|---|---|
| Claude Code | .claude/skills/ | ~/.claude/skills/ |
| Cursor | .agents/skills/ (or .cursor/skills/) | ~/.cursor/skills/ |
| Codex | .agents/skills/ | ~/.agents/skills/ |
| Gemini CLI | .agents/skills/ (or .gemini/skills/) | ~/.gemini/skills/ |
Changelog
What changed
- v1.0.0 · 2026-10-16
- First versioned release: EXPLAIN-driven tuning with before and after timings.
- Scanned 100/100 before release.
Keep it current with npx proskills-cli update; your profile.md is never touched. Everyone who bought it gets the update free and an email when it lands.
Same collection
More from Data & SQL
The scan checks spec compliance, token cost, clarity and security patterns. A clean scan is not a guarantee: static scanners can be evaded. Scan any skill yourself.