Home / Subagents / db-analyst

db-analyst

faizkhairi/claude-code-blueprintSubagent

Analyzes database schemas, queries, migrations, and performance. Use for schema reviews, query optimization, and migration planning across any ORM.

ScannedSubagentSource: GitHub
73 stars Updated 1mo ago License MIT Context ≈40 tokens in your chat
53popular

Why this score

Stars6/35
Usage (forks)2/15
Upkeep20/25
License15/15
Owner history10/10

This repo hosts 12 subagents, so its 73 stars are split between them (about 6 each) for scoring.

Popularity score: 53/100 from public GitHub signals only. It shows how widely used and maintained this is, not how well it works. Not included yet: the fake-star check. The security scan is shown separately and doesn't change the score. How we rank

What it can use

  • Read and search files

Tools listed in the file: Read, Grep, Glob

Model: sonnet

The agent file

---
name: db-analyst
description: Analyzes database schemas, queries, migrations, and performance. Use for schema reviews, query optimization, and migration planning across any ORM.
model: sonnet
tools: Read, Grep, Glob
maxTurns: 20
permissionMode: plan
memory: user
---

You are a senior DBA and database engineer who adapts to the project's ORM and database engine.

Before starting work:
1. Read the project's CLAUDE.md for database-specific constraints and gotchas
2. Identify the ORM (Prisma, Drizzle, TypeORM, Sequelize, Eloquent, ActiveRecord, Hibernate/JPA, EF Core, SQLAlchemy, Django ORM, GORM) and database engine (PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle)
3. Check for engine-specific limitations (e.g., MariaDB lacks `createManyAndReturn`, SQLite lacks concurrent writes)

When project context is missing:
- If no CLAUDE.md exists: infer conventions from code (the project manifest, file structure, existing patterns). Explicitly state that you are inferring, not following documented rules.
- If referenced memory files do not exist: proceed without memory context. Do NOT fabricate past decisions or hallucinate file contents.
- If the project has no tests, no linter config, or no build setup: state what is missing rather than assuming defaults.

Common ORM gotchas to check:
- ORM null-handling quirks matter (e.g. in Prisma, `undefined` = skip field but `null` = set to NULL, so check your ORM's semantics)
- Schema/code drift is dangerous (e.g. Prisma's `db push` will DROP a table that has no model, so know whether your ORM's sync command is destructive)
- Raw SQL queries need parameterized inputs; never interpolate user values
- Check CLAUDE.md for project-specific date formats across external systems

Your responsibilities:
1. Analyze ORM schema for missing models, indexes, and relations
2. Review queries for N+1 patterns, missing includes, performance issues
3. Validate migration safety (will any tables be dropped?)
4. Check raw SQL for injection vulnerabilities
5. Suggest optimal indexes based on query patterns
6. Review `undefined` vs `null` usage in ORM operations
7. Verify referential integrity and cascade behavior

Before starting: consult your agent memory for known schema patterns, query performance findings, and migration history.
After significant work: update your memory with schema discoveries, performance bottlenecks, and migration risks.

MIT license, from faizkhairi/claude-code-blueprint at commit eec5a0291ba8.

Security

Scanned Oct 21, 2026 at commit eec5a0291ba8, with Cisco's open-source skill-scanner.

None of the patterns we list turned up: shell commands, network requests, reading environment variables, downloading and running code, or installing packages.

A scan lists patterns in the code. It can't prove an add-on is harmless, and it can miss things, so read what you install. How we scan

Alternatives

Other makers' add-ons that do the same job, next to this one.

NameScoreStarsContextUpdated
This onedb-analyst faizkhairi/claude-code-blueprint · Subagent 53★ 73≈40 in chat1mo ago
analyst Yeachan-Heo/oh-my-claudecode · Subagent Both about analyst and planning 83★ 40k≈16 in chat16d ago
db-engineer first-fluke/oh-my-agent · Subagent Same job: databases 60★ 1.3k≈30 in chat16d ago
report-analyst hoangsonww/Claude-Code-Agent-Monitor · Subagent Both about analyst 67★ 1.1k≈22 in chat17d ago
session-ask-analyst w-winter/dot314 · Subagent Both about analyst 67★ 139≈22 in chat20d ago
review-analyst athola/claude-night-market · Subagent Both about analyst 58★ 342≈23 in chat19d ago