db

A database-change command that plans a schema update, creates its migration, reviews the risks, and tests it with a focus on avoiding downtime or data loss.

In plain words
What is it for?
Use it to plan tables, columns, indexes, data transformations, lock impact, rollback steps, and application changes for a database migration.
Why use it?
Database schema changes affect stored data and running queries, so an unsafe change can interrupt a service or damage information.

Command

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 commands/zevtos/agentpipe/db
Clone the repo
git clone --depth 1 https://github.com/zevtos/agentpipe
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 745 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.00022 $0.00745
Opus 5 $0.00011 $0.00373
Sonnet 5 $0.00004 $0.00149
Haiku 4.5 $0.00002 $0.00075

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

Security

Grade A, and why

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

commands/db.md · 78 lines

How it starts

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

You are orchestrating a database schema change. Database changes are the most dangerous changes in a codebase — a bad migration can cause downtime or data loss. Follow this pipeline rigorously.

Context

@CLAUDE.md

Change Request

$ARGUMENTS

Pipeline

Step 1: Design (DBA Agent)

Run the dba agent: "Database change needed: $ARGUMENTS

Read the existing schema and codebase, then:

  1. Design the schema change with exact SQL
  2. Classify: additive-only (safe) or breaking change (requires expand-contract)
  3. For breaking changes: provide the full expand-contract plan (expand → migrate → contract)
  4. Lock analysis: which locks are acquired, for how long, impact on concurrent queries
  5. Index changes needed for new query patterns
  6. Rollback plan: exact steps to undo if something goes wrong
  7. Data migration plan if existing data needs transformation (batch size, checkpointing)
  8. Impact on application code (which queries/models need updating)"

Present to user. Ask: "This migration plan look correct? Any concerns about the data transformation?" Wait for confirmation.

Step 2: Implementation

Based on the DBA output:

  1. Create migration file(s) with exact SQL from the DBA plan
  2. For expand-contract: create SEPARATE migration files for each phase
  3. Update application code (models, queries, DTOs) to work with both old and new schema during transition
  4. Add feature flag for read/write switching if applicable
  5. Add data backfill script if needed (with batching, checkpointing, replication lag monitoring)

Step 3: Review (Reviewer Agent)

Run the reviewer agent: "Review this database migration for: $ARGUMENTS Key checks:

  • Migration SQL matches the DBA-approved plan
  • lock_timeout is set before every DDL statement
  • CONCURRENTLY used for index creation (PostgreSQL)
  • NOT VALID + VALIDATE pattern for constraints
  • Batch size appropriate for data migrations
  • Rollback plan is executable
  • Application code handles both old and new schema during transition
  • No N+1 queries introduced by schema changes"

Read the full file on GitHub · 78 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 · 78 lines · 22 tokens per session scan A 465e65ba4642

Subscribe to this mod's changes

db is a command published in the GitHub repository zevtos/agentpipe (11 stars, last pushed 2mo ago), licensed MIT. It adds 22 tokens to every session and 745 once invoked, about $0.0001 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-30.