Agent skill
supabase-migrations
Create and manage Supabase database migrations using MCP tools. Use when creating tables, modifying schemas, adding RLS policies, or working with database structure.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/supabase-migrations
SKILL.md
Supabase Migrations
MCP Tools Available
mcp__supabase__apply_migration- Apply DDL changesmcp__supabase__execute_sql- Run queries (not for DDL)mcp__supabase__list_tables- View existing tablesmcp__supabase__list_migrations- View migration historymcp__supabase__get_advisors- Check for security/performance issues
Project ID
Use mcp__supabase__list_projects to find the project ID first.
Migration Naming
Use snake_case: create_users_table, add_credits_column, enable_rls_on_images
Standard Patterns
Create Table with RLS
CREATE TABLE public.images (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES auth.users(id) ON DELETE CASCADE,
url TEXT NOT NULL,
created_at TIMESTAMPTZ DEFAULT now()
);
ALTER TABLE public.images ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Users can view own images"
ON public.images FOR SELECT
USING (auth.uid() = user_id);
CREATE POLICY "Users can insert own images"
ON public.images FOR INSERT
WITH CHECK (auth.uid() = user_id);
Add Column
ALTER TABLE public.users
ADD COLUMN credits INTEGER DEFAULT 0 NOT NULL;
Create Index
CREATE INDEX idx_images_user_id ON public.images(user_id);
Post-Migration
Always run mcp__supabase__get_advisors with type "security" after DDL changes to catch missing RLS policies.
TypeScript Types
After schema changes, use mcp__supabase__generate_typescript_types to update types.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?