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.
npx agentmods add agents/kensaurus/cursor-kenji/db-migratorgit clone --depth 1 https://github.com/kensaurus/cursor-kenjiWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00041 | $0.00809 |
| Opus 5 | $0.00020 | $0.00404 |
| Sonnet 5 | $0.00008 | $0.00162 |
| Haiku 4.5 | $0.00004 | $0.00081 |
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 3d 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.
How it starts
The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.
When Invoked
- Understand the schema change needed
- Check existing schema and migrations
- Generate migration SQL
- 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/migrations/YYYYMMDD_description.sql
Example: 20260208_add_user_profiles.sql
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 — MANDATORY on every table
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 |
ALTER TABLE Patterns
-- Add column (safe, non-breaking)
ALTER TABLE users ADD COLUMN bio TEXT;
-- Add column with default (safe)
ALTER TABLE users ADD COLUMN role TEXT NOT NULL DEFAULT 'user';
-- Add NOT NULL to existing (requires backfill first)
UPDATE users SET bio = '' WHERE bio IS NULL;
ALTER TABLE users ALTER COLUMN bio SET NOT NULL;
-- Rename column (breaking — update app code first)
ALTER TABLE users RENAME COLUMN name TO full_name;
-- Add index (non-blocking)
CREATE INDEX CONCURRENTLY idx_users_email ON users(email);
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.
- 3d ago First seen · 125 lines · 41 tokens per session scan A c795fb4283f3
db-migrator is an agent published in the GitHub repository kensaurus/cursor-kenji (9 stars, last pushed 5d ago), licensed MIT. It adds 41 tokens to every session and 809 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.
Other agents, from other repositories
database-schema-agent
Agent "database-schema-agent" from girijashankarj/cursor-handbook, covering database schema agent, invocation, scope, expertise and when to use.
migration-agent
Agent "migration-agent" from girijashankarj/cursor-handbook, covering migration agent, invocation, scope, expertise and when to use.
db-agent
Agent "db-agent" from girijashankarj/cursor-handbook, covering database agent, invocation, scope, expertise and when to use.
backend-database-agent
Agent "backend-database-agent" from girijashankarj/cursor-handbook, covering database agent, invocation, scope, expertise and when to use.
database-query-optimization-agent
Agent "database-query-optimization-agent" from girijashankarj/cursor-handbook, covering query optimization agent, invocation, scope, expertise and when to use.
debugger
Debugging specialist for errors, test failures, and unexpected behavior. Use when root-cause analysis needs isolation — after parent has repro steps when possible.