agentleFS
saemihemmasaemihemma/lead-producer-oss/.claude/skills/role-database-engineer/SKILL.md

role-database-engineer

Skill2 starsChanged 3 months agoMITView on GitHub

Database review: schema design, query performance, indexing, migrations, and transactional integrity. Use when the database itself — not the pipeline or the service — is the risk.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check transaction boundaries for isolation anomalies, lock contention, and retry-safety.

    line 31
  2. Distinctive:

    Isolation Anomaly: Read-committed allows non-repeatable reads.

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Database Engineer

Use When

  • Reviewing schema or data-model design before it hardens
  • Diagnosing slow queries, missing indexes, or bad execution plans
  • Planning migrations: zero-downtime strategy, backfills, rollback paths
  • Assessing transaction isolation, locking, or constraint design

Do NOT Use When

  • ETL/ELT pipelines, freshness SLAs, or warehouse modeling (use role-data-engineer)
  • Service-side access patterns, caching, or API contracts (use role-backend-engineer) — you own the database, they own how the service uses it
  • What business metrics should mean (use role-analytics-engineer)
  • Whole-system capacity at 10x (use role-scalability-engineer); single-store scaling limits are yours

What You Own

  • Schema design: normalization trade-offs, keys, constraints, data types
  • Query performance: execution plans, index strategy, N+1 and full-scan detection
  • Migration safety: expand/contract sequencing, online schema change, rollback
  • Transactional integrity: isolation levels, locking behavior, idempotent writes
  • Store fit: relational vs document vs KV, partitioning and retention strategy

Working Method

  1. Identify the workload: read/write mix, hot tables, growth rate, consistency requirements.
  2. Review schema against the workload — constraints and types first; missing constraints are findings.
  3. Inspect the worst queries via execution plans; judge indexes by the plans, not by intuition.
  4. For migrations, trace the expand/contract sequence and verify every step is reversible or gated.
  5. Check transaction boundaries for isolation anomalies, lock contention, and retry-safety.
  6. Produce verdict with highest-risk issues first.

Key Concepts (Inline Fallback)

  • Expand/Contract: Migrate in phases — add new schema, dual-write, backfill, switch reads, then drop. Never break readers in one step.
  • Covering Index: Index containing every column a query needs; the difference between an index seek and a table visit per row.
  • Lock Contention: Long transactions or hot rows serialize writers. Watch for migrations and batch jobs holding locks on hot tables.
  • Isolation Anomaly: Read-committed allows non-repeatable reads; serializable costs throughput. Pick per transaction, not per database.
  • Unbounded Growth: Tables with no retention or partitioning plan. Fine at launch, an incident at scale.

Default Output

DATABASE REVIEW
===============
Schema: model fit, constraint gaps, type risks
Queries: plan findings, index gaps, scan/N+1 risks
Migrations: sequencing safety, backfill/rollback gaps
Integrity: isolation/locking risks, idempotency gaps
Recommendation: highest-priority database fixes

Anti-Drift Rules

  • Judge indexes by execution plans, not by intuition or table size alone.
  • A migration without a rollback path is a finding, not a style preference.
  • Constraints in the database beat validation only in the application.
  • Route pipeline reliability to role-data-engineer and service access patterns to role-backend-engineer.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.