tuner
FreeNo executable scriptsNot checkedTuning database queries via EXPLAIN ANALYZE, query plan optimization, index recommendations, and slow query detection. Not for schema/migrations (Schema) or…
by simota★ 106 GitHub starsAbout this skill
Tuner
Database-performance specialist for query plans, slow-query analysis, index strategy, ORM hot paths, connection pools, and database observability. Tuner complements Schema and does not guess at bottlenecks.
Trigger Guidance
- Use Tuner when the primary problem is database latency, slow queries, poor execution plans, index strategy, connection pressure, or ORM-generated SQL performance — including AI-assisted plan interpretation and index recommendation from query patterns.
- Typical tasks:
EXPLAIN/EXPLAIN ANALYZEanalysis, index recommendations, query rewrites, N+1 detection, DB setting tuning, MV/partitioning evaluation, before/after performance reports. - Route adjacent work outward:
Schemafor schema design and migration ownership.Builderfor application-query rewrites and repository/service changes.Boltfor application-level caching or non-DB performance work.Scoutwhen the root cause is still unknown.
Route elsewhere when the task is primarily:
- a task better handled by another agent per
_common/BOUNDARIES.md
Workflow
ANALYZE → DIAGNOSE → OPTIMIZE → VALIDATE → PRESENT
| Phase | Focus | Read |
|---|---|---|
ANALYZE |
Collect evidence and lock a baseline — no baseline, no optimization | reference/explain-analyze-guide.md |
DIAGNOSE |
Isolate the bottleneck across scan/join/sort/index; flag version-specific wins | reference/optimization-patterns.md |
OPTIMIZE |
Choose the safest improvement; quantify write-amplification | reference/materialized-views-partitioning.md |
VALIDATE |
Prove the change with a before/after diff; revert on any secondary-query regression | reference/slow-query-benchmarks.md |
PRESENT |
Deliver before/after P50/P95/P99 + buffer hits/reads and hand off | reference/fix-prompt-generation.md |
Full per-phase required checks: reference/workflow-detail.md.
Core Contract
- Use
EXPLAIN (ANALYZE, BUFFERS)before recommending a change —BUFFERSseparates cache hits from disk I/O. On PostgreSQL 18+,EXPLAIN (ANALYZE)includes BUFFERS by default; PostgreSQL 17 and earlier still need it explicit. - Quantify read/write trade-offs for every index recommendation — every index slows INSERT/UPDATE/DELETE; measure the write overhead vs. read gain.
- Prefer non-production validation first.
- Include before/after metrics whenever claiming improvement — P50, P95, P99 latency, rows examined, buffer hits/misses.
- Account for data distribution, cardinality, and growth; do not assume them.
- Target P99 latency ≤ 200ms for user-facing queries, ≤ 500ms for background/analytics queries; flag anything exceeding these thresholds.
- Verify row estimate accuracy: planner estimate vs. actual ratio > 10× indicates stale statistics or predicate issues; > 100× makes the plan unreliable.
- Prefer composite indexes over mu
Install tuner in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the tuner skill do?
Tuning database queries via EXPLAIN ANALYZE, query plan optimization, index recommendations, and slow query detection. Not for schema/migrations (Schema) or non-DB performance (Bolt).
How do I install the tuner skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the tuner skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
patterns
Find patterns worth sharing from recent PRs and repo history, both repeats to fix and good practices worth spreading. Use when a champion wants to know what…
by Anthropiccopilot-cli-quickstart
Use this skill when someone wants to learn GitHub Copilot CLI from scratch. Offers interactive step-by-step tutorials with separate Developer and…
by GitHubvardoger-analyze
Use when the user asks to personalize the GitHub Copilot CLI assistant, adapt Copilot to their style, use vardoger, or analyze their Copilot CLI conversation…
by GitHubpolicy-lookup
Find and explain company policies in plain language. Trigger with "what's our PTO policy", "can I work remotely from another country", "how do expenses work"…
by Anthropic