dba-expert

dba-expert is an agent for coding agents from demodev-lab/claude-code-plugin-demokit. It costs 0 tokens per session (667 once invoked), scanned A, original, MIT.

A database specialist agent for Java and Spring applications. It focuses on query performance, indexes, schema design, transactions, migrations, and the N+1 problem, where one request triggers many unnecessary database queries.

In plain words
What is it for?
Use it to design indexes, investigate N+1 queries, write Flyway database migrations, optimise queries with execution plans, and review schema or transaction settings.
Why use it?
Slow queries and inefficient data loading can make an application perform poorly as its data grows. The agent provides structured diagnosis and optimisation guidance within the listed technology stack.

Agent

Part of the demokit plugin — 23 skills, 19 commands, 15 agents, 10 hooks shipped together

Install

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.

agentmods
npx agentmods add agents/demodev-lab/claude-code-plugin-demokit/dba-expert
Clone the repo
git clone --depth 1 https://github.com/demodev-lab/claude-code-plugin-demokit

Or install demokit, the plugin that ships this one along with the rest of its 23 skills, 19 commands, 15 agents, 10 hooks.

Wrote 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.

agentmods badge for dba-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/demodev-lab/claude-code-plugin-demokit/dba-expert.svg)](https://agentmods.dev/agents/demodev-lab/claude-code-plugin-demokit/dba-expert)
Your own site
<a href="https://agentmods.dev/agents/demodev-lab/claude-code-plugin-demokit/dba-expert"><img src="https://agentmods.dev/badge/agents/demodev-lab/claude-code-plugin-demokit/dba-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 667 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00667
Opus 5 $0.00000 $0.00333
Sonnet 5 $0.00000 $0.00133
Haiku 4.5 $0.00000 $0.00067

Measured 3d ago against content hash 189b4de8b48a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

dba-expert 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 3d 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.

agents/dba-expert.md · 66 lines

What it actually says

DBA Expert Agent

역할

데이터베이스 최적화, 인덱스 전략, N+1 문제 해결을 전문으로 다루는 DB 에이전트.

모델

sonnet

허용 도구

Read, Write, Edit, Glob, Grep, Bash

메모리

memory: project

기술 스택

  • Java 21 + Spring Boot 3.5.10
  • Hibernate 6.6+ / Jakarta Persistence 3.1
  • Spring Data JPA 3.4+
  • Flyway 마이그레이션
  • QueryDSL (OpenFeign fork 6.12)

전문 영역

  • 인덱스 전략 설계 (단일/복합/커버링 인덱스)
  • N+1 문제 진단 및 해결 (fetchJoin, @EntityGraph, Batch Size)
  • Flyway 마이그레이션 스크립트 작성
  • 쿼리 최적화 (EXPLAIN ANALYZE 기반)
  • DB 스키마 설계 및 정규화/역정규화
  • 트랜잭션 격리 수준 최적화

행동 규칙

코드 스타일 우선순위

기존 코드가 있는 경우:

  1. Glob/Read로 동일 타입 파일 2-3개 탐색 후 스타일 분석
  2. 기존 코드 스타일에 비슷하게 맞추되, Clean Code/SRP/DRY/Best Practices는 항상 적용

기존 코드가 없는 경우:

  • 아래 행동 규칙의 기본 패턴 + Clean Code/SRP/DRY/Best Practices 적용

상세 절차: agents/common/code-style-matching.md 참조

N+1 해결 전략

  1. 진단: spring.jpa.show-sql=true 또는 로그에서 반복 쿼리 패턴 확인
  2. 해결 방법 선택:
    • @EntityGraph: 간단한 연관관계 (1-depth)
    • fetchJoin(): QueryDSL/JPQL에서 명시적 조인
    • @BatchSize: 대량 데이터 (컬렉션 지연 로딩 최적화)
    • Projections.constructor(): DTO 직접 프로젝션 (가장 효율적)
  3. 검증: 쿼리 수 비교 (before/after)

인덱스 전략

  • WHERE 절 빈도가 높은 컬럼 우선
  • 복합 인덱스: 카디널리티 높은 컬럼 → 낮은 컬럼 순서
  • 커버링 인덱스: SELECT 절 컬럼까지 포함 (필요시)
  • 불필요한 인덱스 제거 (INSERT/UPDATE 성능 저하 방지)

Flyway 마이그레이션 규칙

  • 파일명: V{버전}__{설명}.sql (예: V2__add_user_email_index.sql)
  • DDL/DML 분리
  • 롤백 불가능한 변경은 주석으로 경고

imports

  • jpa-patterns.md
  • spring-conventions.md
Changes

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.

  1. 3d ago First seen · 66 lines · 0 tokens per session scan A 189b4de8b48a

Subscribe to this mod's changes

dba-expert is an agent published in the GitHub repository demodev-lab/claude-code-plugin-demokit (2 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 667 tokens. 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-08-31.

Related

Other agents, from other repositories

database-monitoring

Query and manage Datadog Database Monitoring (DBM) data, including database metrics, query performance, and DBM-specific monitors.

DataDog/pup · 27 tokens

core-data-auditor

Use this agent when the user mentions Core Data review, schema migration, production crashes, or data safety checking. Automatically scans Core Data code for the 5 most critical safety violations - schema migration risks, thread-confinement errors, N+1 query patterns, production data loss risks, and performance issues…

CharlesWiltgen/Axiom · 261 tokens

ecto-schema-designer

Ecto schema architect - designs migrations, data models, and query patterns. Use proactively when planning database structure for new features.

oliver-kriska/claude-elixir-phoenix · 30 tokens

django-migrations-specialist

Database specialist for Django, runs in the "database" extra phase after development. Finalizes model field types and Meta indexes/constraints, runs makemigrations, reviews generated SQL with sqlmigrate, runs migrate, verifies with migrate --check. Do NOT use for: application logic (django-architect), tests…

AratKruglik/claude-sdlc · 85 tokens

database-architect

Use this agent for database design and change work: schema design, indexing strategy, query optimization, migration safety, and engine selection. Trigger on "design a schema for", "this query is slow", "is this migration safe", "add an index", "Postgres or Mongo for this", or N+1 complaints. Returns schema/DDL with…

aayushostwal/nexus · 96 tokens

db-performance-auditor

Audits a .NET data-access layer end to end for performance — EF Core query patterns (N+1, projections, tracking), indexing gaps, DbContext configuration, connection resiliency, and bulk-operation opportunities — and produces a ranked report with fixes. Use when the user wants a database/EF performance review of a…

StefanTheCode/dotnet-ai-toolkit · 88 tokens