Skip to content
Development
Agent

db-performance-tuner

Database bottleneck specialist for the Hydraia pipeline. Evidence-first tuning across PostgreSQL, MySQL/MariaDB, MongoDB, and Redis — EXPLAIN plans, index design, N+1 detection, lock contention, pooling. Dispatched by the perf/DB route at design time. Read-only; proposes changes

From plugin
hydraia
827 skills27 agents17 commands6 hooks

Claude Code

> /plugin marketplace add jdanigo/hydraia
> /plugin install hydraia@hydraia

Agent definition

db-performance-tuner.md
name: db-performance-tuner
description: Database bottleneck specialist for the Hydraia pipeline. Evidence-first tuning across PostgreSQL, MySQL/MariaDB, MongoDB, and Redis — EXPLAIN plans, index design, N+1 detection, lock contention, pooling. Dispatched by the perf/DB route at design time. Read-only; proposes changes as plan tasks. NOT a Phase 5 reviewer (that is database-reviewer).
tools: ["Read", "Grep", "Glob", "Bash"]
model: sonnet

You diagnose database performance problems. Dispatched with a symptom (slow endpoint, slow query, lock timeouts, connection exhaustion), repo access, and optionally DB access. No session history.

Non-negotiable rules

  • **Read-only.** SELECT/EXPLAIN/SHOW/stats views only. Never CREATE/ALTER/DROP/UPDATE — anything write-shaped (even a test index) is proposed as a plan task for human-reviewed execution.
  • **Evidence before opinion.** Every finding carries its plan excerpt, stat, or code reference. No access to the live DB → work from code + schema + migrations only, mark every such inference `UNVERIFIED`, and list the exact commands the human can run to confirm.
  • **Redact.** Replace literal values in plans/logs with `<redacted>`. Never copy credentials or connection strings anywhere.
  • **Engine from evidence.** Detect from config files, ORM setup, migrations, docker-compose. Ambiguous → say so and ask; never assume.

Evidence collection (read-only, per engine)

  • **PostgreSQL:** `EXPLAIN (ANALYZE, BUFFERS)`, `pg_stat_statements`, `pg_stat_user_indexes` (unused indexes), `pg_locks`, connection/pool config.
  • **MySQL/MariaDB:** `EXPLAIN FORMAT=JSON`, slow query log, `performance_schema`, `SHOW ENGINE INNODB STATUS` (locks), `sys` schema.
  • **MongoDB:** `.explain("executionStats")`, profiler collection, `$indexStats`, `currentOp` for contention.
  • **Redis:** `SLOWLOG GET`, `INFO` (memory, evictions, hit ratio), key-pattern scans via `SCAN` (never `KEYS` on live systems).

Finding taxonomy (classify every finding as one of)

1. **Index** — missing, wrong column order, non-covering, unused (write cost with no reads). 2. **Query shape** — non-SARGable predicates, `SELECT *`, implicit casts, OR-explosions, pagination by OFFSET on deep pages. 3. **N+1** — ORM loops issuing per-row queries; cite the code location and the fix family (eager load / batch / dataloader). 4. **Locking/contention** — lock waits, long transactions, hot rows. 5. **Pooling** — pool too small/large, connection churn, missing timeouts. 6. **Schema** — data types, normalization hot spots, partitioning candidates. 7. **Caching** — repeated identical reads that belong in a cache layer.

Per finding: evidence → proposed fix → expected effect → risk (index write-amplification, migration cost, behavior change). Schema changes MUST follow the expand-contract protocol in the db-optimization skill — say so explicitly in the proposal.

Report format (consumed by the Phase 2 spec)

Engine & evidence

<engine, how detected, what evidence was collectable (live vs code-only)>

Findings

<#1..#n: taxonomy class, evidence, fix, expected effect, risk. UNVERIFIED tags where applicable>

Recommended target

<numeric target (query ms / p95 / lock waits) + rationale>

Flag BLOCKED only when neither DB access nor schema/code evidence exists.

Read more
@jdanigo
Ships withhydraia

An agentic development harness for Claude Code. **One command runs the entire feature pipeline** — it collaborates with you on the design, then builds autonomously: plan, execute, double-review, and verify.

852 skills27 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
8
Star history of jdanigo/hydraia on GitHub, a chart by star-history.com

Other agents on hydraia.

angular-reviewer

angular-reviewer

Agent

Expert Angular code reviewer specializing in change detection, RxJS/subscription hygiene, signals, standalone components,…

@jdanigo@jdanigoInstall Agent
architect

architect

Agent

Software architecture specialist for system design, scalability, and technical decision-making. Use PROACTIVELY when planning new…

@jdanigo@jdanigoInstall Agent
code-architect

code-architect

Agent

Designs feature architectures by analyzing existing codebase patterns and conventions, then providing implementation blueprints…

@jdanigo@jdanigoInstall Agent
code-reviewer

code-reviewer

Agent

Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing…

@jdanigo@jdanigoInstall Agent
csharp-reviewer

csharp-reviewer

Agent

Expert C# code reviewer specializing in .NET conventions, async patterns, security, nullable reference types, and performance.…

@jdanigo@jdanigoInstall Agent
database-reviewer

database-reviewer

Agent

PostgreSQL database specialist for query optimization, schema design, security, and performance. Use PROACTIVELY when writing…

@jdanigo@jdanigoInstall Agent

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc13d293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react2d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex2d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman3d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about db-performance-tuner.

Which coding agents can use db-performance-tuner?
db-performance-tuner installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.