supabase-migration-writer

supabase-migration-writer is an agent for Claude Code from luanpdd/kit-mcp. It costs 54 tokens per session (4,796 once invoked), scanned A, original, MIT.

An agent that writes Supabase database migration files, which are SQL files used to create or change database tables and permissions.

In plain words
What is it for?
Use it when creating or changing Supabase tables, access policies, grants, and related database structure.
Why use it?
It helps prevent migrations from missing row-level security (RLS), overly broad permissions, indexes, or the project's required file layout.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: names the AskUserQuestion tool; mentions Claude Code; mentions Codex.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is Cross-ref canônico: [eliminating-toil](../skills/eliminating-toil/SKILL.md) (cap 5 do livro Google SRE — Eliminating Toil). Para auditoria sistemática de toil e.

Good fit Use it when creating or changing Supabase tables, access policies, grants, and related database structure.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/luanpdd/kit-mcp
agentmods
npx agentmods add agents/luanpdd/kit-mcp/supabase-migration-writer

Made for: Claude Code.

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 supabase-migration-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/luanpdd/kit-mcp/supabase-migration-writer.svg)](https://agentmods.dev/agents/luanpdd/kit-mcp/supabase-migration-writer)
Your own site
<a href="https://agentmods.dev/agents/luanpdd/kit-mcp/supabase-migration-writer"><img src="https://agentmods.dev/badge/agents/luanpdd/kit-mcp/supabase-migration-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,796 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.00054 $0.04796
Opus 5 $0.00027 $0.02398
Sonnet 5 $0.00011 $0.00959
Haiku 4.5 $0.00005 $0.00480

Measured 3d ago against content hash 08bfb1613f6d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

supabase-migration-writer 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.

kit/agents/supabase-migration-writer.md · 388 lines

How it starts

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

Você é o migration-writer Supabase. Recebe descrição de mudança de schema (ou draft SQL via Task() upstream context — handoff cooperativo v1.23) e produz arquivo SQL no layout correto (supabase/migrations/<YYYYMMDDHHmmss>_<name>.sql ou supabase/schemas/<NN>_<name>.sql se projeto usa declarative). Sempre com GRANT + RLS habilitado, granular policies, indices, e style guide aplicado. Template v1.23 segue 5 blocos obrigatórios.

Princípio canônico v1.23: Agents externos pensam/planejam; você materializa preservando intent. Em CREATE TABLE, auto-chain cooperativo para supabase-rls-hardener antes do output final. Conflitos com intent upstream → nota de divergência explícita, nunca silenciosa.

Compat: Full em Claude Code + Cursor (com Supabase MCP); Partial em Codex + Gemini CLI; Offline-only em Windsurf/Antigravity/Copilot/Trae. Veja COMPATIBILITY.md.

Por que existe

Migrations escritas a mão facilmente esquecem RLS, usam for all em vez de granular, ou pulam o (select) wrapper em auth.uid(). Este agent garante consistência: estrutura padrão, anti-patterns prevenidos, layout canônico do CLI Supabase respeitado.

Inputs esperados (do caller)

  • change_description: descrição da mudança (ex: "criar tabela tasks", "adicionar coluna priority", "drop column legacy_field").
  • (Opcional) project_id: para validação de schema atual.
  • (Opcional) layout_hint: "declarative" / "imperative" — se omitido, detecta automaticamente.
  • (Opcional, v1.23 — handoff cooperativo) upstream_intent — quando invocado via Task() de outro agent (multi-tenant-rls-writer, audit-log-implementer, crm-pipeline-implementer, debugger, planner, etc.), recebe contexto upstream estruturado:
<upstream_intent>
Source agent: {caller_name}
Original goal: {1-2 sentence description}
Constraints / business rules: {qualquer regra de domínio relevante}
</upstream_intent>

<draft_sql>
{SQL draft do caller — pode ser parcial, pré-hardening}
</draft_sql>

<user_facing_caller>{true | false}</user_facing_caller>

Read the full file on GitHub · 388 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. 3d ago First seen · 388 lines · 54 tokens per session scan A 08bfb1613f6d

Subscribe to this mod's changes

supabase-migration-writer is an agent published in the GitHub repository luanpdd/kit-mcp (1 stars, last pushed 7d ago), licensed MIT. It adds 54 tokens to every session and 4,796 once invoked, about $0.0003 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-09-03.

Related

Other agents, from other repositories

MS-SQL Database Administrator

Work with Microsoft SQL Server databases using the MS SQL extension.

github/awesome-copilot · 18 tokens

core-data-auditor

Use this agent when the user mentions Core Data review, schema migration, production crashes, or data safety checking. Automatically scans Core Data code for the 5 most critical safety violations - schema migration risks, thread-confinement errors, N+1 query patterns, production data loss risks, and performance issues…

CharlesWiltgen/Axiom · 261 tokens

lens

Turns raw data into actionable decisions — dashboards, metric definitions, SQL analytics, funnel and cohort analysis across BI platforms. Use when designing a dashboard, defining KPIs, or running funnel analysis. Trigger with "design a dashboard", "analyze our funnel".

jeremylongshore/tons-of-skills-marketplace · 53 tokens

ecto-schema-designer

Ecto schema architect - designs migrations, data models, and query patterns. Use proactively when planning database structure for new features.

oliver-kriska/claude-elixir-phoenix · 30 tokens

django-migrations-specialist

Database specialist for Django, runs in the "database" extra phase after development. Finalizes model field types and Meta indexes/constraints, runs makemigrations, reviews generated SQL with sqlmigrate, runs migrate, verifies with migrate --check. Do NOT use for: application logic (django-architect), tests…

AratKruglik/claude-sdlc · 85 tokens

sql-expert

Usa este agente para cualquier tarea relacionada con base de datos en FacturaScripts: diseñar esquemas de tabla XML, optimizar consultas con DbQuery y Where, crear índices y constraints, escribir migraciones SQL, analizar rendimiento de queries, usar transacciones, trabajar con DataBaseWhere/DataBase/DbQuery, diseñar…

FacturaScripts/fs-claude-plugin · 102 tokens