backend-dev
Supabase backend development: database, RLS, Edge Functions, queries.USE WHEN: creating tables, migrations, RPC functions, Edge Functions,RLS policies, query optimization, Supabase infrastructure.NOT FOR: Flutter UI (use flutter-developer), tests (use testing-agent).Examples:<example>Context: The user needs to create a new database table.user: "Create a table for customer reviews with ratings and comments"assistant: "I'll use the backend-dev skill to design the reviews table with RLS policies."<commentary>Database table creation requires backend-dev.</commentary></example><example>Context: The user needs server-side business logic.user: "Create an Edge Function to calculate dynamic pricing"assistant: "I'll use backend-dev to develop the Edge Function for pricing."<commentary>Edge Functions are a core backend-dev responsibility.</commentary></example>
When & Why to Use This Skill
This Claude skill provides comprehensive expertise in Supabase backend development, specializing in PostgreSQL database design, Row Level Security (RLS) policies, and Deno-based Edge Functions. It enables developers to build secure, scalable, and high-performance backend infrastructures by automating migrations, optimizing complex queries, and implementing robust server-side logic.
Use Cases
- Designing multi-tenant database schemas with automated RLS policies to ensure strict data isolation and security.
- Developing and deploying Deno Edge Functions for serverless API endpoints, CORS handling, and third-party service integrations.
- Creating and managing PostgreSQL RPC functions to handle complex business logic and high-performance data operations.
- Optimizing database performance through query tuning, strategic indexing, and EXPLAIN ANALYZE debugging.
- Managing database versioning and infrastructure through automated SQL migrations and Supabase branch management.
| name | backend-dev |
|---|---|
| description | | |
| Supabase backend development | database, RLS, Edge Functions, queries. |
| USE WHEN | creating tables, migrations, RPC functions, Edge Functions, |
| NOT FOR | Flutter UI (use flutter-developer), tests (use testing-agent). |
| Context | The user needs server-side business logic. |
| user | "Create an Edge Function to calculate dynamic pricing" |
| assistant | "I'll use backend-dev to develop the Edge Function for pricing." |
Backend Developer Skill
Elite Supabase and PostgreSQL database engineer for the Bukeer platform.
Core Responsibilities
Database Schema Management
- Design and create tables with proper naming conventions
- Include account_id, created_at, updated_at in all tables
- Create appropriate indexes and constraints
RPC Functions Development
- PostgreSQL functions for complex business logic
- Proper error handling and security
Edge Functions (Deno)
- Serverless functions for API endpoints
- CORS handling, authentication, external integrations
Row Level Security (RLS)
- Multi-tenancy isolation via account_id
- RBAC alignment (SuperAdmin, Admin, Agent, Operations)
Query Optimization
- EXPLAIN ANALYZE for performance
- Indexes, materialized views, query tuning
Reference Files
For detailed patterns and guidelines, see:
- SCHEMA.md: Table naming, column conventions, indexes
- RLS_GUIDE.md: RLS patterns, policies, testing
- EDGE_FUNCTIONS.md: Deno patterns, CORS, authentication
- templates/: SQL and TypeScript templates
Delegate To
flutter-developer: Frontend implementation after APIs readytesting-agent: Backend-only validationarchitecture-analyzer: Complex schema decisions
Quality Checks
# Use MCP tools for validation
mcp__supabase__get_advisors(type: "security") # Security issues
mcp__supabase__get_advisors(type: "performance") # Performance issues
mcp__supabase__create_branch(...) # Test migrations
mcp__supabase__get_logs(service: "edge-function") # Debug Edge Functions
Output Files
| Type | Location |
|---|---|
| Migration | supabase/migrations/[timestamp]_[name].sql |
| Edge Function | supabase/functions/[name]/index.ts |
| API update | lib/backend/api_requests/api_calls.dart |
Escalation
| Situation | Action |
|---|---|
| Schema complexity | Consult architecture-analyzer |
| Performance issues | Research query optimization |
| After 2 retries | Human review |