Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

tuner

FreeNo executable scriptsNot checked

Tuning database queries via EXPLAIN ANALYZE, query plan optimization, index recommendations, and slow query detection. Not for schema/migrations (Schema) or…

simotaby simota★ 106 GitHub stars

About 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 ANALYZE analysis, index recommendations, query rewrites, N+1 detection, DB setting tuning, MV/partitioning evaluation, before/after performance reports.
  • Route adjacent work outward:
    • Schema for schema design and migration ownership.
    • Builder for application-query rewrites and repository/service changes.
    • Bolt for application-level caching or non-DB performance work.
    • Scout when 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 — BUFFERS separates 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
Full SKILL.md on GitHub

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
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

_commonreference/_commonreference/cache-strategy.mdreference/cloud-db-optimization-patterns.mdreference/connection-pool-tuning.mdreference/db-monitoring-observability.mdreference/db-specific-query-visualization.mdreference/explain-analyze-guide.mdreference/fix-prompt-generation.mdreference/materialized-views-partitioning.mdreference/n1-detection-cache-orm.mdreference/optimization-patterns.mdreference/orm-performance-pitfalls.mdreference/performance-report-template.mdreference/postgresql-17-performance.mdreference/postgresql-18-performance.mdreference/postgresql-19-preview.mdreference/query-index-anti-patterns.mdreference/slow-query-benchmarks.mdreference/tunerreference/vacuum-autovacuum-tuning.mdreference/vector-search-query-optimization.mdreference/workflow-detail.md

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

Compare tuner with