DE

dev-supabase

Handles Supabase backend development including auth, DB, and storage.

Install

mkdir -p .claude/skills/dev-supabase && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14354" && unzip -o skill.zip -d .claude/skills/dev-supabase && rm skill.zip

Installs to .claude/skills/dev-supabase

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Backend development with Supabase. Trigger when the user wants to configure auth, the database, or Supabase storage.
116 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Configure Supabase client for authentication
  • Implement user sign-up, sign-in, and sign-out
  • Define Row Level Security (RLS) policies for database tables
  • Perform database queries (select, insert, update, delete)
  • Upload and retrieve files from Supabase Storage
  • Set up real-time database subscriptions

How it works

This skill provides code examples and best practices for interacting with Supabase services, including authentication, database, and storage APIs.

Inputs & outputs

You give it
Supabase project credentials and data interaction requirements
You get back
code examples for Supabase authentication, database, and storage operations

When to use dev-supabase

  • Configuring RLS policies
  • Setting up Supabase auth
  • Implementing realtime database subscriptions

About this skill

Supabase Development

Configuration

import { createClient } from '@supabase/supabase-js';

export const supabase = createClient(
  process.env.NEXT_PUBLIC_SUPABASE_URL!,
  process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
);

Authentication

// Sign up
await supabase.auth.signUp({ email, password });

// Sign in
await supabase.auth.signInWithPassword({ email, password });

// OAuth
await supabase.auth.signInWithOAuth({ provider: 'google' });

// Sign out
await supabase.auth.signOut();

Database with RLS

-- Enable RLS
ALTER TABLE profiles ENABLE ROW LEVEL SECURITY;

-- Policy: users can read own data
CREATE POLICY "Users read own profile"
ON profiles FOR SELECT
USING (auth.uid() = id);

-- Policy: users can update own data
CREATE POLICY "Users update own profile"
ON profiles FOR UPDATE
USING (auth.uid() = id);

Queries

// Select
const { data } = await supabase
  .from('profiles')
  .select('*')
  .eq('id', userId);

// Insert
await supabase.from('profiles').insert({ name, email });

// Update
await supabase.from('profiles').update({ name }).eq('id', userId);

// Delete
await supabase.from('profiles').delete().eq('id', userId);

Storage

// Upload
await supabase.storage.from('avatars').upload(path, file);

// Get URL
supabase.storage.from('avatars').getPublicUrl(path);

Realtime

supabase
  .channel('messages')
  .on('postgres_changes', { event: 'INSERT', table: 'messages' }, callback)
  .subscribe();

Postgres Performance Best Practices

Critical priority: Query Performance

-- ALWAYS use indexes on filtered columns
CREATE INDEX idx_profiles_email ON profiles(email);
CREATE INDEX idx_orders_user_id ON orders(user_id);
CREATE INDEX idx_orders_created_at ON orders(created_at);

-- Partial index for frequent queries
CREATE INDEX idx_active_users ON profiles(id) WHERE is_active = true;

-- Composite index for multi-column queries
CREATE INDEX idx_orders_user_status ON orders(user_id, status);

-- ANALYZE slow queries
EXPLAIN ANALYZE SELECT * FROM orders WHERE user_id = 'xxx';

Critical priority: Connection Management

// USE Supabase's connection pooling (Supavisor)
// In Transaction mode for serverless
const supabase = createClient(url, key, {
  db: { schema: 'public' },
  auth: { persistSession: true },
});

// AVOID direct connections in serverless
// Always use the pooler (port 6543 instead of 5432)

High priority: Schema Design

-- Correct data types (no VARCHAR when UUID is enough)
CREATE TABLE orders (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id UUID NOT NULL REFERENCES profiles(id),
  total_cents INTEGER NOT NULL,  -- Not FLOAT for amounts
  status TEXT NOT NULL DEFAULT 'pending',
  metadata JSONB DEFAULT '{}',  -- JSONB not JSON
  created_at TIMESTAMPTZ DEFAULT now()
);

-- Avoid SELECT * in production
-- Specify the necessary columns
const { data } = await supabase
  .from('orders')
  .select('id, status, total_cents')  -- NOT '*'
  .eq('user_id', userId);

Medium priority: Security & RLS

-- Performant RLS: avoid subqueries in policies
-- GOOD: direct comparison
CREATE POLICY "own_data" ON orders
  FOR ALL USING (user_id = auth.uid());

-- BAD: subquery in the policy (slow)
CREATE POLICY "team_data" ON orders
  FOR ALL USING (
    user_id IN (SELECT member_id FROM team_members WHERE team_id = current_setting('app.team_id'))
  );

-- BETTER: use a JWT claim
CREATE POLICY "team_data" ON orders
  FOR ALL USING (
    team_id = (auth.jwt() -> 'app_metadata' ->> 'team_id')::uuid
  );

Medium priority: Data Access Patterns

-- Cursor-based pagination (not OFFSET for large tables)
-- GOOD: cursor-based
const { data } = await supabase
  .from('orders')
  .select('*')
  .gt('created_at', lastSeenDate)
  .order('created_at', { ascending: true })
  .limit(20);

-- BAD: offset-based (slow on large tables)
const { data } = await supabase
  .from('orders')
  .select('*')
  .range(1000, 1020);  // Scans 1020 rows

Monitoring

-- Slowest queries
SELECT query, calls, mean_exec_time, total_exec_time
FROM pg_stat_statements
ORDER BY mean_exec_time DESC
LIMIT 10;

-- Tables without index used
SELECT relname, seq_scan, seq_tup_read
FROM pg_stat_user_tables
WHERE seq_scan > 100
ORDER BY seq_tup_read DESC;

-- Unused indexes
SELECT indexrelname, idx_scan
FROM pg_stat_user_indexes
WHERE idx_scan = 0;

When not to use it

  • When using a database other than Postgres
  • When not using Supabase for backend services
  • When the task does not involve authentication, database, or storage

Limitations

  • The skill does not cover all PostgreSQL features.
  • The skill does not provide UI components for Supabase interactions.
  • The skill does not manage Supabase project creation or infrastructure.

How it compares

This skill offers specific Supabase-focused code patterns and performance best practices, unlike general backend development which may not optimize for Supabase's features.

Compared to similar skills

dev-supabase side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
dev-supabase (this skill)02moReviewIntermediate
prisma-expert126moReviewIntermediate
convex-functions46moNo flagsIntermediate
cloudbase-document-database-web-sdk12moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

zip

aibot88

Compress, extract, list, and encrypt ZIP archives in batch. Use when archiving files, extracting packages, listing contents, encrypting backups, or batching.

00

configure-hooks

aibot88

This skill should be used when the user says "configure hooks", "set up quality gates", "add PostToolUse hook", "set up permission hooks", "create hook configuration", "add typecheck hook", "set up secret-scan hook", or wants to configure event-driven hooks for their Claude Code project. Validates a

00

integration-development

aibot88

Guide for creating new OAuth-based integrations in the Orient codebase. Use when adding external service integrations (APIs like Linear, GitHub, Slack, Notion, etc.), implementing OAuth flows, or creating catalog-based integration manifests. Covers the full integration lifecycle from manifest defini

00

regulatory-compliance

aibot88

Audit codebases for cross-industry regulatory compliance across SOX, GDPR, HIPAA, PCI-DSS, CCPA/CPRA, FedRAMP, FISMA, COPPA, and FERPA. Reviews audit trail completeness (who/what/when/where/why with tamper-evident storage), data retention policies and right-to-erasure workflows, RBAC/ABAC access con

00

detecting-mimikatz-execution-patterns

aibot88

Detect Mimikatz execution through command-line patterns, LSASS access signatures, binary indicators, and in-memory

00

karpathy-metric-pre

aibot88

Use this when: red-team my optimization metric, find ways to game my metric, metric pre-mortem, adversarial metric evaluation, gaming vectors for my KPI, what could an agent exploit in my metric, metric failure modes, proxy divergence risk, eval contamination, silent degradation from optimization, m

00

Search skills

Search the agent skills registry