supabase-developer
Expert Supabase development with PostgreSQL, authentication, Row Level Security, Storage, Edge Functions, and Realtime subscriptions
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Expert Supabase development with PostgreSQL, authentication, Row Level Security, Storage, Edge Functions, and Realtime subscriptions
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guides an autonomous blog manager agent to propose topics, draft articles, and skip topics with structured JSON output for a Leaflet.pub publication.
Design and build AI agents with persistent memory, tool use, and multi-turn conversation. Covers architecture selection, memory design, model selection, tool configuration, and implementation patterns across agent frameworks. Use when creating, debugging, or improving AI agents.
Automate configuration management and application deployment with Ansible. Use when tasks mention ansible-playbook, inventory files, Ansible roles, ad-hoc commands, ansible-galaxy, or agentless SSH automation.
Deploy Kubernetes apps declaratively with Argo CD applications and projects. Use when tasks mention argocd, Argo CD, argocd app sync, Application CRD, AppProject, or GitOps with Argo CD.
Query Datadog observability data including logs, metrics, monitors, dashboards, hosts, APM spans, and incidents via direct API. Use when investigating production issues, checking monitors, searching logs, alerting, or accessing Datadog data.
Build, run, debug, and manage Docker containers, images, compose files, networking, volumes, registries, Buildx/Bake, Scout/SBOM, Swarm, and Docker AI tooling. Use when the user mentions docker, containers, containerizing, Dockerfile, compose, image registry, volumes, or any docker subcommand.
| name | supabase-developer |
| description | Expert Supabase development with PostgreSQL, authentication, Row Level Security, Storage, Edge Functions, and Realtime subscriptions |
This skill provides comprehensive expertise in building production-ready applications with Supabase, the open-source Firebase alternative. It covers database design, authentication, Row Level Security (RLS), file storage, Edge Functions, and real-time subscriptions. Edge Functions now run on Deno 2.1 by default (full rollout August 2025), with local preview available since March 2025.
supabase functions deploy --no-docker when Docker isn't available├── supabase/
│ ├── config.toml # Project configuration
│ ├── migrations/ # Database migrations
│ │ ├── 20240101000000_initial_schema.sql
│ │ └── 20240102000000_add_profiles.sql
│ ├── functions/ # Edge Functions
│ │ ├── hello-world/
│ │ │ └── index.ts
│ │ └── _shared/ # Shared utilities
│ │ └── cors.ts
│ └── seed.sql # Development seed data
├── src/
│ ├── lib/
│ │ └── supabase.ts # Client initialization
│ ├── types/
│ │ └── database.types.ts # Generated types
│ └── ...
└── package.json
-- Users profile extension
create table public.profiles (
id uuid references auth.users on delete cascade primary key,
username text unique not null,
full_name text,
avatar_url text,
created_at timestamptz default now() not null,
updated_at timestamptz default now() not null
);
-- Enable RLS
alter table public.profiles enable row level security;
-- RLS Policies
create policy "Public profiles are viewable by everyone"
on public.profiles for select
using (true);
create policy "Users can update their own profile"
on public.profiles for update
using (auth.uid() = id);
-- Trigger for updated_at
create trigger handle_updated_at
before update on public.profiles
for each row execute function moddatetime(updated_at);
// src/lib/supabase.ts
import { createClient } from '@supabase/supabase-js'
import type { Database } from '@/types/database.types'
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL!
const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
export const supabase = createClient<Database>(
supabaseUrl,
supabaseAnonKey
)
// Sign up with email
const { data, error } = await supabase.auth.signUp({
email: 'user@example.com',
password: 'secure-password',
options: {
data: {
full_name: 'John Doe'
}
}
})
// Sign in with OAuth
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'google',
options: {
redirectTo: `${window.location.origin}/auth/callback`
}
})
// Get current user
const { data: { user } } = await supabase.auth.getUser()
// Listen to auth changes
supabase.auth.onAuthStateChange((event, session) => {
if (event === 'SIGNED_IN') {
// Handle sign in
}
})
// Select with relations
const { data: posts, error } = await supabase
.from('posts')
.select(`
id,
title,
content,
author:profiles(username, avatar_url),
comments(id, content, created_at)
`)
.eq('published', true)
.order('created_at', { ascending: false })
.range(0, 9)
// Insert with returning
const { data: post, error } = await supabase
.from('posts')
.insert({
title: 'New Post',
content: 'Content here',
author_id: user.id
})
.select()
.single()
// Update with filters
const { error } = await supabase
.from('posts')
.update({ published: true })
.eq('id', postId)
.eq('author_id', user.id)
// Delete with cascade
const { error } = await supabase
.from('posts')
.delete()
.eq('id', postId)
// Upload file
const { data, error } = await supabase.storage
.from('avatars')
.upload(`${userId}/avatar.png`, file, {
cacheControl: '3600',
upsert: true
})
// Get public URL
const { data: { publicUrl } } = supabase.storage
.from('avatars')
.getPublicUrl(`${userId}/avatar.png`)
// Download file
const { data, error } = await supabase.storage
.from('documents')
.download('report.pdf')
// Create signed URL
const { data, error } = await supabase.storage
.from('private')
.createSignedUrl('file.pdf', 3600)
// Subscribe to database changes
const channel = supabase
.channel('posts-changes')
.on(
'postgres_changes',
{
event: '*',
schema: 'public',
table: 'posts',
filter: 'published=eq.true'
},
(payload) => {
console.log('Change:', payload)
}
)
.subscribe()
// Broadcast messages
const channel = supabase.channel('room-1')
channel.subscribe((status) => {
if (status === 'SUBSCRIBED') {
channel.send({
type: 'broadcast',
event: 'cursor',
payload: { x: 100, y: 200 }
})
}
})
// Presence tracking
const channel = supabase.channel('online-users')
channel.on('presence', { event: 'sync' }, () => {
const state = channel.presenceState()
console.log('Online users:', state)
})
channel.subscribe(async (status) => {
if (status === 'SUBSCRIBED') {
await channel.track({ user_id: user.id, online_at: new Date() })
}
})
// Cleanup
supabase.removeChannel(channel)
// supabase/functions/send-email/index.ts (Deno 2.1)
import "jsr:@supabase/functions-js/edge-runtime.d.ts"
import { createClient } from 'npm:@supabase/supabase-js@2'
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
}
Deno.serve(async (req) => {
if (req.method === 'OPTIONS') {
return new Response('ok', { headers: corsHeaders })
}
try {
const supabase = createClient(
Deno.env.get('SUPABASE_URL')!,
Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!
)
const { email, subject, body } = await req.json()
// Your email sending logic here
return new Response(
JSON.stringify({ success: true }),
{ headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
)
} catch (error) {
return new Response(
JSON.stringify({ error: error.message }),
{ status: 400, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
)
}
})
Use the Management API for programmatic deploys and updates in CI/CD pipelines or automated workflows.
curl -X POST "https://api.supabase.com/v1/projects/{ref}/functions" \
-H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "hello-world", "slug": "hello-world", "verify_jwt": true}'
select() to limit returned columnsrange()head: true for count-only queries_shared/This skill includes executable scripts in the scripts/ folder:
setup-project.sh: Initialize new Supabase project with configuration
./scripts/setup-project.sh <project-name>
local-dev.sh: Start local Supabase development environment
./scripts/local-dev.sh [--reset]
create-migration.sh: Create a new timestamped migration file
./scripts/create-migration.sh <migration-name>
run-migrations.sh: Apply pending migrations
./scripts/run-migrations.sh [--local|--remote]
seed-database.sh: Seed database with test data
./scripts/seed-database.sh
generate-types.sh: Generate TypeScript types from database schema
./scripts/generate-types.sh [--output PATH]
link-project.sh: Link local project to remote Supabase project
./scripts/link-project.sh <project-ref>
create-function.sh: Create a new Edge Function with boilerplate
./scripts/create-function.sh <function-name>
deploy-function.sh: Deploy Edge Function to production (supports --no-docker when Docker isn't available)
./scripts/deploy-function.sh <function-name> [--all]
serve-functions.sh: Run Edge Functions locally for testing
./scripts/serve-functions.sh
setup-testing.sh: Set up testing environment with Vitest
./scripts/setup-testing.sh
run-tests.sh: Run tests with various options
./scripts/run-tests.sh [--watch] [--ui] [--coverage]
test-rls.sh: Test RLS policies with different user contexts
./scripts/test-rls.sh <table-name>
backup-database.sh: Create database backup
./scripts/backup-database.sh [--output PATH]
This skill includes production-ready templates in the templates/ folder:
This skill includes detailed reference guides in the resources/ folder:
Specialization: Supabase Full-Stack Development Version: 2.0 Last Updated: May 2026