jikime-platform-supabase
Supabase specialist covering PostgreSQL 16, pgvector, RLS, real-time subscriptions, Edge Functions, and Postgres performance optimization. Use when building full-stack apps with Supabase backend or optimizing database performance.
Best use case
jikime-platform-supabase is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Supabase specialist covering PostgreSQL 16, pgvector, RLS, real-time subscriptions, Edge Functions, and Postgres performance optimization. Use when building full-stack apps with Supabase backend or optimizing database performance.
Teams using jikime-platform-supabase should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/jikime-platform-supabase/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How jikime-platform-supabase Compares
| Feature / Agent | jikime-platform-supabase | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Supabase specialist covering PostgreSQL 16, pgvector, RLS, real-time subscriptions, Edge Functions, and Postgres performance optimization. Use when building full-stack apps with Supabase backend or optimizing database performance.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Supabase Platform Guide
Comprehensive guide for Supabase + Next.js full-stack development and Postgres performance optimization.
## When to Apply
Reference this skill when:
- Building full-stack apps with Supabase backend
- Writing SQL queries or designing schemas
- Implementing indexes or query optimization
- Setting up real-time features or pgvector for AI embeddings
- Configuring authentication, storage, or Edge Functions
- Reviewing database performance issues
- Configuring connection pooling or scaling
- Working with Row-Level Security (RLS)
## Quick Reference
| Feature | Description |
|---------|-------------|
| **PostgreSQL 16** | Full SQL, JSONB |
| **pgvector** | AI embeddings, vector search |
| **RLS** | Row Level Security |
| **Realtime** | Real-time subscriptions |
| **Auth** | Authentication, JWT |
| **Storage** | File storage |
## Setup
### Next.js Client
```bash
npm install @supabase/supabase-js @supabase/ssr
```
```typescript
// lib/supabase/client.ts
import { createBrowserClient } from '@supabase/ssr';
export function createClient() {
return createBrowserClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
);
}
// lib/supabase/server.ts
import { createServerClient } from '@supabase/ssr';
import { cookies } from 'next/headers';
export function createClient() {
const cookieStore = cookies();
return createServerClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
{
cookies: {
getAll() {
return cookieStore.getAll();
},
setAll(cookies) {
cookies.forEach(({ name, value, options }) =>
cookieStore.set(name, value, options)
);
},
},
}
);
}
```
## Database
### Table Creation
```sql
-- Users table
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
email TEXT UNIQUE NOT NULL,
name TEXT NOT NULL,
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Posts table
CREATE TABLE posts (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
author_id UUID REFERENCES users(id) ON DELETE CASCADE,
title TEXT NOT NULL,
content TEXT,
published BOOLEAN DEFAULT FALSE,
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Index
CREATE INDEX posts_author_idx ON posts(author_id);
```
### CRUD Operations
```typescript
const supabase = createClient();
// Create
const { data, error } = await supabase
.from('posts')
.insert({ title: 'Hello', content: 'World', author_id: userId })
.select()
.single();
// Read
const { data: posts } = await supabase
.from('posts')
.select('*, author:users(name, email)')
.eq('published', true)
.order('created_at', { ascending: false })
.limit(10);
// Update
const { data } = await supabase
.from('posts')
.update({ title: 'Updated' })
.eq('id', postId)
.select()
.single();
// Delete
const { error } = await supabase
.from('posts')
.delete()
.eq('id', postId);
```
## Row Level Security (RLS)
```sql
-- Enable RLS
ALTER TABLE posts ENABLE ROW LEVEL SECURITY;
-- Read: Public posts are viewable by everyone
CREATE POLICY "Public posts are viewable"
ON posts FOR SELECT
USING (published = true);
-- Update: Users can only update their own posts
CREATE POLICY "Users can update own posts"
ON posts FOR UPDATE
USING (auth.uid() = author_id);
-- Delete: Users can only delete their own posts
CREATE POLICY "Users can delete own posts"
ON posts FOR DELETE
USING (auth.uid() = author_id);
-- Insert: Only authenticated users can create posts
CREATE POLICY "Authenticated can insert"
ON posts FOR INSERT
WITH CHECK (auth.uid() IS NOT NULL);
```
## pgvector (AI Embeddings)
```sql
-- Enable extension
CREATE EXTENSION IF NOT EXISTS vector;
-- Embeddings table
CREATE TABLE documents (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
content TEXT NOT NULL,
embedding VECTOR(1536), -- OpenAI embedding dimensions
metadata JSONB DEFAULT '{}'
);
-- HNSW index (fast search)
CREATE INDEX documents_embedding_idx
ON documents USING hnsw (embedding vector_cosine_ops);
-- Similarity search function
CREATE OR REPLACE FUNCTION search_documents(
query_embedding VECTOR(1536),
match_count INT DEFAULT 5
)
RETURNS TABLE (id UUID, content TEXT, similarity FLOAT)
AS $$
SELECT id, content, 1 - (embedding <=> query_embedding) AS similarity
FROM documents
ORDER BY embedding <=> query_embedding
LIMIT match_count;
$$ LANGUAGE SQL;
```
```typescript
// Vector search
const { data } = await supabase.rpc('search_documents', {
query_embedding: embedding,
match_count: 5
});
```
## Realtime
```typescript
// Real-time subscription
const channel = supabase
.channel('posts-changes')
.on(
'postgres_changes',
{ event: '*', schema: 'public', table: 'posts' },
(payload) => {
console.log('Change:', payload);
}
)
.subscribe();
// Filtered subscription
const channel = supabase
.channel('user-posts')
.on(
'postgres_changes',
{
event: 'INSERT',
schema: 'public',
table: 'posts',
filter: `author_id=eq.${userId}`,
},
(payload) => {
console.log('New post:', payload.new);
}
)
.subscribe();
// Unsubscribe
supabase.removeChannel(channel);
```
## Authentication
```typescript
// Sign in
const { data, error } = await supabase.auth.signInWithPassword({
email: 'user@example.com',
password: 'password123',
});
// Sign up
const { data, error } = await supabase.auth.signUp({
email: 'user@example.com',
password: 'password123',
});
// OAuth
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'google',
options: { redirectTo: `${origin}/auth/callback` },
});
// Get current user
const { data: { user } } = await supabase.auth.getUser();
// Sign out
await supabase.auth.signOut();
```
## Storage
```typescript
// Upload
const { data, error } = await supabase.storage
.from('avatars')
.upload(`${userId}/avatar.png`, file, {
cacheControl: '3600',
upsert: true,
});
// Public URL
const { data: { publicUrl } } = supabase.storage
.from('avatars')
.getPublicUrl(`${userId}/avatar.png`);
// Delete
await supabase.storage
.from('avatars')
.remove([`${userId}/avatar.png`]);
```
## Edge Functions (Deno)
```typescript
// supabase/functions/hello/index.ts
import { serve } from 'https://deno.land/std@0.168.0/http/server.ts';
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2';
serve(async (req) => {
const supabase = createClient(
Deno.env.get('SUPABASE_URL')!,
Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!
);
const { data, error } = await supabase.from('posts').select('*');
return new Response(JSON.stringify(data), {
headers: { 'Content-Type': 'application/json' },
});
});
```
```bash
# Deploy
supabase functions deploy hello
```
## PostgreSQL Performance Optimization
Comprehensive performance optimization guide for Postgres, maintained by Supabase. Contains 30 rules across 8 categories in `references/`, prioritized by impact to guide automated query optimization and schema design.
### Rule Categories by Priority
| Priority | Category | Impact | Prefix | Files |
|----------|----------|--------|--------|-------|
| 1 | Query Performance | CRITICAL | `query-` | 5 |
| 2 | Connection Management | CRITICAL | `conn-` | 4 |
| 3 | Security & RLS | CRITICAL | `security-` | 3 |
| 4 | Schema Design | HIGH | `schema-` | 5 |
| 5 | Concurrency & Locking | MEDIUM-HIGH | `lock-` | 4 |
| 6 | Data Access Patterns | MEDIUM | `data-` | 4 |
| 7 | Monitoring & Diagnostics | LOW-MEDIUM | `monitor-` | 3 |
| 8 | Advanced Features | LOW | `advanced-` | 2 |
### How to Use References
Read individual rule files from `references/` for detailed explanations and SQL examples.
Each rule file contains:
- Brief explanation of why it matters
- Incorrect SQL example with explanation
- Correct SQL example with explanation
- Optional EXPLAIN output or metrics
- Additional context and references
- Supabase-specific notes (when applicable)
### Available References
**Query Performance** (`query-`):
- `references/query-missing-indexes.md` - Add indexes on WHERE and JOIN columns (100-1000x faster)
- `references/query-composite-indexes.md` - Use composite indexes for multi-column queries (5-50x faster)
- `references/query-covering-indexes.md` - Use covering indexes for index-only scans
- `references/query-index-types.md` - Choose appropriate index types (B-tree, GIN, GiST, BRIN)
- `references/query-partial-indexes.md` - Use partial indexes for filtered queries
**Connection Management** (`conn-`):
- `references/conn-pooling.md` - Use PgBouncer for connection pooling (10x concurrency)
- `references/conn-prepared-statements.md` - Disable prepared statements in transaction mode
- `references/conn-idle-timeout.md` - Configure idle connection timeout
- `references/conn-limits.md` - Set appropriate connection limits
**Security & RLS** (`security-`):
- `references/security-rls-basics.md` - RLS fundamentals and setup
- `references/security-rls-performance.md` - Optimize RLS policy performance (2-10x faster)
- `references/security-privileges.md` - Configure database privileges
**Schema Design** (`schema-`):
- `references/schema-data-types.md` - Choose appropriate data types
- `references/schema-lowercase-identifiers.md` - Use lowercase identifiers
- `references/schema-primary-keys.md` - Design effective primary keys
- `references/schema-foreign-key-indexes.md` - Index foreign key columns
- `references/schema-partitioning.md` - Table partitioning strategies
**Concurrency & Locking** (`lock-`):
- `references/lock-advisory.md` - Advisory locks for application-level locking
- `references/lock-deadlock-prevention.md` - Deadlock prevention strategies
- `references/lock-short-transactions.md` - Keep transactions short
- `references/lock-skip-locked.md` - Use SKIP LOCKED for queue patterns
**Data Access Patterns** (`data-`):
- `references/data-batch-inserts.md` - Batch insert optimization
- `references/data-n-plus-one.md` - Avoid N+1 query patterns
- `references/data-pagination.md` - Efficient pagination strategies
- `references/data-upsert.md` - Upsert patterns
**Monitoring & Diagnostics** (`monitor-`):
- `references/monitor-explain-analyze.md` - Use EXPLAIN ANALYZE for query plans
- `references/monitor-pg-stat-statements.md` - Monitor with pg_stat_statements
- `references/monitor-vacuum-analyze.md` - VACUUM and ANALYZE maintenance
**Advanced Features** (`advanced-`):
- `references/advanced-full-text-search.md` - Full-text search implementation
- `references/advanced-jsonb-indexing.md` - JSONB indexing strategies
## Best Practices
- **RLS Required**: Enable RLS on all tables
- **Indexes**: Add indexes on frequently queried columns
- **Type Generation**: `supabase gen types typescript`
- **Server Client**: Use server client in server components
- **Error Handling**: Always check for errors on every query
## External References
- https://www.postgresql.org/docs/current/
- https://supabase.com/docs
- https://wiki.postgresql.org/wiki/Performance_Optimization
- https://supabase.com/docs/guides/database/overview
- https://supabase.com/docs/guides/auth/row-level-security
---
Last Updated: 2026-02-03
Version: 3.0.0Related Skills
jikime-workflow-templates
Enterprise template management with code boilerplates, feedback templates, and project optimization workflows
jikime-workflow-learning
Continuous learning system - extract, store, and reuse patterns from Claude Code sessions
faf-platforms
Understand where FAF works - Claude Code (CLI + Skills), claude-faf-mcp (Desktop + MCP), vs claude.ai (web - file upload only). Explains faf-cli vs MCP differences, when to use each platform. Use when user asks "does FAF work with", "CLI vs MCP", "Claude Desktop vs claude.ai", or platform compatibility questions.
core-platform-notion-reviewer
Core Platform Team의 Notion 문서를 문서 타입(테크스펙/시스템설계/시스템소개/액션아이템/아이디어)과 17개 품질 기준에 따라 리뷰하고 개선안을 제안합니다. Notion MCP를 통해 문서 읽기/수정/검색을 수행합니다. 사용자가 Notion 문서 리뷰, 문서 품질 검사, Notion 페이지 개선 요청을 할 때 사용하세요.
cloudbase-platform
CloudBase platform knowledge and best practices. Use this skill for general CloudBase platform understanding, including storage, hosting, authentication, cloud functions, database permissions, and data models.
cdr-platform-automation
Automate Cdr Platform tasks via Rube MCP (Composio). Always search tools first for current schemas.
app-platform-router
Routes DigitalOcean App Platform tasks to specialized sub-skills. Use when working with App Platform deployments, migrations, database configuration, networking, or troubleshooting.
android-supabase
Supabase integration patterns for Android - authentication, database, realtime subscriptions. Use when setting up Supabase SDK, implementing OAuth, querying database, or setting up realtime.
1k-platform-requirements
Documents minimum SDK/OS version requirements for all OneKey platforms. Use when checking platform compatibility, understanding deployment targets, verifying version requirements, or when user asks if their device can run the project. Triggers on minimum version, SDK version, API level, deployment target, platform requirements, iOS version, Android version, Chrome version, Electron version, can I run, environment check, device compatibility, check environment.
1k-cross-platform
Cross-platform development patterns for OneKey. Use when writing platform-specific code, handling platform differences, or working with native/web/desktop/extension platforms. Triggers on platform, native, web, desktop, extension, iOS, Android, Electron, platformEnv, .native.ts, .web.ts, .desktop.ts, .ext.ts, cross-platform, multi-platform.
hig-platforms
Apple Human Interface Guidelines for platform-specific design.
agent-platforms
Guide for multi-platform skill compatibility across Claude Code, Codex, Gemini CLI, Cursor, GitHub Copilot, and other AI coding agents.