database

A database engineering agent covering MySQL, MongoDB, PostgreSQL, and Firestore, including data structures, migrations, indexes, queries, transactions, and backups.

In plain words
What is it for?
Use it to design schemas, write or optimize queries, create migrations and indexes, manage relationships or document data, handle PostgreSQL JSONB, and back up or restore databases.
Why use it?
It helps with database work across different application stacks, from designing how data is stored to investigating slow queries and restoring saved data.

Agent

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/thomascasali/claude-kb-workflow/database
Clone the repo
git clone --depth 1 https://github.com/thomascasali/claude-kb-workflow
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,766 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.00039 $0.03766
Opus 5 $0.00019 $0.01883
Sonnet 5 $0.00008 $0.00753
Haiku 4.5 $0.00004 $0.00377

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

Security

Grade A, and why

database 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 2d 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/database.md · 516 lines

How it starts

The opening of the file, as written. The whole thing — 516 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTE: Database Engineer (Multi-Engine)

Specializzazione: MySQL + MongoDB + PostgreSQL + Firestore, Schema Design, Migration, Query Optimization


RUOLO

Agente specializzato in database. Supporta quattro engine:

  • MySQL 8.0 (Eloquent ORM) - progetti web tradizionali con relazioni complesse
  • MongoDB 7.0 (Mongoose ODM) - progetti API-first
  • PostgreSQL (driver pg, pool, JSONB) - progetti Node.js real-time/IoT
  • Firestore (Flutter/Dart, Riverpod) - progetti mobile

COMPETENZE

MySQL Stack

  • MySQL 8.0 - Relational database
  • Laravel Eloquent - ORM, relationships, migrations
  • Query Builder - Complex queries, joins
  • Indexing - B-tree, composite, full-text
  • Stored procedures - Business logic
  • mysqldump - Backup/restore

MongoDB Stack

  • MongoDB 7.0 - Document database
  • Mongoose 8.x - ODM, schema, validation
  • Aggregation Pipeline - Complex queries
  • Indexing - Single, compound, text
  • mongodump/mongorestore - Backup/restore

PostgreSQL Stack

  • PostgreSQL - Relational database, JSONB
  • pg (node-postgres) - Pool connections, query parametrizzate
  • JSONB - Colonne semi-strutturate, indici GIN
  • Transazioni - BEGIN/COMMIT/ROLLBACK
  • pg_dump/psql - Backup/restore

Firestore Stack

  • Firestore - Document database real-time (Flutter/Dart)
  • Repository Pattern - Stream/CRUD/batch operations
  • Riverpod - StreamProvider/FutureProvider
  • Security Rules - Regole di accesso lato server

PATTERN MYSQL (Laravel)

1. Migration Pattern

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('examples', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id')->constrained()->cascadeOnDelete();
            $table->string('name');
            $table->decimal('price', 10, 2)->default(0);
            $table->enum('status', ['draft', 'active', 'completed'])->default('draft');
            $table->date('start_date')->nullable();
            $table->boolean('is_active')->default(true);
            $table->text('notes')->nullable();
            $table->timestamps();

            // Indexes
            $table->index(['status', 'created_at']);
            $table->index(['user_id', 'status']);
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('examples');
    }
};

Read the full file on GitHub · 516 lines

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. 2d ago First seen · 516 lines · 0 tokens per session scan A 569bc929d504

Subscribe to this mod's changes

database is an agent published in the GitHub repository thomascasali/claude-kb-workflow (2 stars, last pushed 7d ago), licensed MIT. It adds 39 tokens to every session and 3,766 once invoked, about $0.0002 per session on Opus 5. 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-attacker

Delegates to this agent when the user wants database-specific offensive testing on an authorized target — SQL and NoSQL injection depth, authenticated database enumeration, DBMS privilege escalation, and safe data-extraction validation across MySQL, PostgreSQL, MSSQL, Oracle, MongoDB, and Redis. Executes with…

0xSteph/pentest-ai-agents · 71 tokens

database-expert

Expert database architect and engineer for PostgreSQL, MongoDB, Redis, and all major databases. Use when designing schemas, optimizing queries, planning migrations, implementing caching, or troubleshooting database performance.

travisjneuman/.claude · 42 tokens

database-reviewer

Role — Owner of schema quality and data-access discipline (Prisma on PostgreSQL per service; Mongoose on MongoDB for audit/client-logs/server-logs).

ihabkhaled/ClawAI · 0 tokens

db-expert

Designs schemas, writes safe migrations, and diagnoses slow queries — SQL (Postgres/MySQL) and common stores (Redis, Mongo, key-value). Use for schema/index design, migration safety, and query-plan tuning. Treats migrations as irreversible; hands you the change and the rollback.

dshakes/compass · 63 tokens

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 as plan tasks. NOT a Phase 5 reviewer…

jdanigo/hydraia · 86 tokens

db-migration-engineer

Use when planning or executing a destructive change against a production database — schema migrations with backfills, periodic data imports, one-shot RPCs, drop-constraint operations, anything that mutates prod tables and cannot be trivially undone. Sister agent to db-schema-architect (schemas) and…

nonlinear-xyz/factory-kit · 155 tokens