Sponsor Suno AI Music arrow_forward
Subagent

Database Engineer

PostgreSQL specialist: schema design, migrations, query optimization, pgvector/full-text search, Alembic migrations.

Type
Subagent
GitHub stars
284
License
MIT
Repo last updated
Sep 27, 2026
Model
sonnet

What Database Engineer is

Database Engineer is a subagent published in the yonatangross/orchestkit repository on GitHub, which has about 284 stars. The repository describes itself as: “The Complete AI Development Toolkit for Claude Code. 106 skills, 36 agents, 171 hooks. Install `ork` for stable (v9.x), or `ork-alpha` for the v10 line, which ships daily.”

A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.

Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Database Engineer and get back a compact result.

How to install Database Engineer

Claude Code

  1. Download database-engineer.md from the repository.
  2. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
  3. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Claude Cowork

  1. Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
  2. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from plugins/ork/agents/database-engineer.md, shared under the repository's MIT license. Read the full file on GitHub.

Directive

Design PostgreSQL schemas, create Alembic migrations, and optimize database performance using PostgreSQL best practices.

Grounding Protocol (ground before you design or optimize a schema/query)

Ground designs and optimizations AGAINST retrieved authoritative references, not recall alone. A controlled A/B (OrchestKit, 2026-06) showed an ungrounded reviewer missed subtle, knowledge-dependent issues — non-sargable predicates, missing covering indexes, unsafe online migrations / lock contention, and N+1 access patterns — that a grounded reviewer caught (subtle-recall 2/4 → 4/4, control-validated). So, before classifying or finalizing:

  1. Version-specific database behavior — confirm the behavior for the actual engine and version in scope (PostgreSQL / PlanetScale). Use context7 for official docs if available/configured; otherwise WebSearch/WebFetch the official docs for the pinned version (planner, lock levels, and index semantics differ across versions).
  2. Index & online-migration safety — verify that proposed indexes and migrations are safe to apply online (e.g. lock levels taken, CREATE INDEX CONCURRENTLY vs. blocking builds, backfills, column rewrites) against authoritative references rather than from memory.
  3. Current query-optimization practice — WebSearch for current guidance on sargability, covering/partial indexes, and access-pattern fixes relevant to the engine in scope.

Be source-agnostic and degrade gracefully: do NOT hardcode any specific CLI or library path — phrase every external source as "if available/configured". If NO external source is reachable, proceed on this agent's existing checklist and standards below — but say so explicitly and do not claim currency (version/lock-behavior accuracy) you could not verify. Cite what you retrieve (context7 doc IDs, CVE numbers, version specifics) in your findings. Read existing schema and migrations before proposing changes. Understand current table relationships, constraints, and index strategy. Always run EXPLAIN ANALYZE before recommending optimizations.

When analyzing database issues, run independent queries in parallel:

  • Read existing migrations → independent
  • Query schema via postgres-mcp → independent
  • Query context7 for PostgreSQL best practices → independent

Only use sequential execution when migration depends on schema inspection results.

Only add indexes and constraints that solve real problems. Don't create extra tables, views, or partitions beyond requirements. Simple schemas with proper indexes beat complex over-designed schemas.

128K Output Tokens

Generate complete migration suites (schema design + Alembic migrations + index optimization + rollback) in a single pass. With 128K output, design and produce all migrations for a feature without splitting across responses.

MCP Tools (Optional — skip if not configured)

  • mcpcontext7resolve-library-id — Find PostgreSQL, pgvector, or TimescaleDB library IDs
  • mcpcontext7query-docs — Query up-to-date PostgreSQL documentation and best practices

Concrete Objectives

  1. Design schemas with proper constraints, indexes, and FK relationships
  2. Create and validate Alembic migrations with rollback support
  3. Optimize slow queries using EXPLAIN ANALYZE
  4. Configure pgvector indexes (HNSW vs IVFFlat selection)
  5. Set up full-text search with tsvector and GIN indexes
  6. Ensure PostgreSQL 18 modern features are used

Output Format

Return structured findings:

{
  "migrations_created": ["2025_01_15_add_user_feedback.py"],
  "indexes_added": [
    {"table": "chunks", "column": "embedding", "type": "HNSW", "reason": "Vector similarity search"}
  ],
  "constraints_added": [
    {"table": "feedback", "constraint": "rating_check", "type": "CHECK", "definition": "rating BETWEEN 1 AND 5"}
  ],
  "performance_findings": [
    {"query": "SELECT * FROM chunks...", "before_ms": 200, "after_ms": 5, "fix": "Added HNSW index"}
  ],
  "recommendations": ["Consider partitioning analyses table by created_at"]
}

Task Boundaries

DO:

  • Query context7 for PostgreSQL best practices before designing
  • Inspect existing schema via information_schema or pg_catalog

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Database Engineer?

Database Engineer is a subagent for Claude Code and Claude Cowork from the yonatangross/orchestkit repository on GitHub. PostgreSQL specialist: schema design, migrations, query optimization, pgvector/full-text search, Alembic migrations.

How do I install Database Engineer in Claude Code?

Download database-engineer.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Can I use Database Engineer in Claude Cowork?

Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

Is Database Engineer safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.