db-migrator

db-migrator is an agent for Claude Code from kensaurus/cursor-kenji. It costs 41 tokens per session (891 once invoked), scanned A, original, MIT.

A database-change assistant for Supabase or Prisma, tools used to manage application databases. It handles migrations, which are recorded changes to tables, indexes, and access rules.

In plain words
What is it for?
Use it when adding tables, changing a database schema, creating indexes, or configuring row-level security policies.
Why use it?
It provides a repeatable process for checking the existing schema, creating the change, applying it, and verifying the result.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cursor-kenji plugin — 132 skills, 63 commands, 6 agents, 1 hook, 3 MCP servers shipped together

Good fit Use it when adding tables, changing a database schema, creating indexes, or configuring row-level security policies.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/kensaurus/cursor-kenji/db-migrator
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.

Clone the repo
git clone --depth 1 https://github.com/kensaurus/cursor-kenji

Made for: Claude Code.

Or install cursor-kenji, the plugin that ships this one along with the rest of its 132 skills, 63 commands, 6 agents, 1 hook, 3 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for db-migrator

README.md
[![agentmods](https://agentmods.dev/badge/agents/kensaurus/cursor-kenji/db-migrator/github.svg)](https://agentmods.dev/agents/kensaurus/cursor-kenji/db-migrator)
Your own site
<a href="https://agentmods.dev/agents/kensaurus/cursor-kenji/db-migrator"><img src="https://agentmods.dev/badge/agents/kensaurus/cursor-kenji/db-migrator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for db-migrator

Your own site · 80×15
<a href="https://agentmods.dev/agents/kensaurus/cursor-kenji/db-migrator"><img src="https://agentmods.dev/badge/agents/kensaurus/cursor-kenji/db-migrator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 891 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00041 $0.00891
Opus 5.5 $0.00016 $0.00356
Sonnet 5.5 $0.00008 $0.00178
Haiku 4.5 $0.00004 $0.00089

Measured 25d ago against content hash 63ae37d25852, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

db-migrator 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 25d 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/db-migrator.md · 126 lines

How it starts

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

When Invoked

  1. Understand the schema change needed
  2. Check existing schema and migrations
  3. Generate migration SQL
  4. Apply and verify

Pre-Migration Checklist

# Check existing schema
ls -la supabase/migrations/ | tail -10
# Check current tables (Supabase MCP)
# Review related migrations for naming patterns

Migration Standards

File Naming

supabase migration new add_user_profiles
# → supabase/migrations/<YYYYMMDDHHMMSS>_add_user_profiles.sql

Let the CLI prefix the 14-digit UTC timestamp so same-day migrations still order correctly; do not hand-write an 8-digit date prefix.

Required Elements for Every Table

-- 1. UUID primary key
CREATE TABLE table_name (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  
  -- 2. Your columns here
  name TEXT NOT NULL,
  status TEXT NOT NULL DEFAULT 'active',
  
  -- 3. Always include timestamps
  created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
  updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);

-- 4. Auto-update trigger for updated_at
CREATE TRIGGER set_updated_at
  BEFORE UPDATE ON table_name
  FOR EACH ROW EXECUTE FUNCTION moddatetime(updated_at);

-- 5. Indexes on foreign keys and frequently queried columns
CREATE INDEX idx_table_name_status ON table_name(status);

-- 6. RLS on every table (Supabase exposes tables through PostgREST; without it every row is readable with the anon key)
ALTER TABLE table_name ENABLE ROW LEVEL SECURITY;

-- 7. RLS policies
CREATE POLICY "Users can read own data" ON table_name
  FOR SELECT USING (auth.uid() = user_id);

CREATE POLICY "Users can insert own data" ON table_name
  FOR INSERT WITH CHECK (auth.uid() = user_id);

CREATE POLICY "Users can update own data" ON table_name
  FOR UPDATE USING (auth.uid() = user_id)
  WITH CHECK (auth.uid() = user_id);

Column Type Guide

Data Use Don't Use
IDs UUID SERIAL, TEXT
Money DECIMAL(10,2) FLOAT, REAL
Timestamps TIMESTAMPTZ TIMESTAMP
Status/enum TEXT + CHECK or PG ENUM Unconstrained TEXT
JSON data JSONB JSON, TEXT
Boolean BOOLEAN INT, TEXT

Read the full file on GitHub · 126 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. 25d ago Changed 63ae37d25852
  2. 1mo ago Changed · +1 lines 17d6e88f4a45
  3. 1mo ago First seen · 125 lines · 41 tokens per session scan A c795fb4283f3

Subscribe to this mod's changes

db-migrator is an agent published in the GitHub repository kensaurus/cursor-kenji (9 stars, last pushed 20d ago), licensed MIT. It adds 41 tokens to every session and 891 once invoked, about $0.0002 per session on Opus 5.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.