Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Supabase Database Builder

    1

    Generate production-ready Supabase SQL schemas with RLS policies, indexes, and migrations.

    Free

    7 usesSecurity scanned
    Supabase Database Builder

    Supabase Database Builder

    Example session with this skill installed

    Design a Supabase schema for a task management app where users have multiple projects, and projects have many tasks. Tasks need a status and priority. Use RLS for user isolation.

    • Read your context and instructions
    • Compiled the supabase database builder

    I have generated a normalized schema for your task management application. This includes user-isolated RLS policies, automated timestamp triggers, and optimized indexes.

    Supabase Database Schema

    -- Enable Extensions
    CREATE EXTENSION IF NOT EXISTS "pgcrypto";
    
    -- Table: profiles
    CREATE TABLE profiles (
      id uuid REFERENCES auth.users ON DELETE CASCADE PRIMARY KEY,
      username text UNIQUE,
      updated_at timestamptz DEFAULT now()
    );
    
    -- Table: projects
    CREATE TABLE projects (
      id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
      owner_id uuid REFERENCES profiles(id) ON DELETE CASCADE NOT NULL,
      title text NOT NULL,
      description text,
      created_at timestamptz DEFAULT now(),
      updated_at timestamptz DEFAULT now()
    );
    
    -- Table: tasks
    CREATE TABLE tasks (
      id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
      project_id uuid REFERENCES projects(id) ON DELETE CASCADE NOT NULL,
      title text NOT NULL,
      status text DEFAULT 'todo' CHECK (status IN ('todo', 'in_progress', 'done')),
      priority int DEFAULT 1,
      created_at timestamptz DEFAULT now(),
      updated_at timestamptz DEFAULT now()
    );
    
    -- Indexes
    CREATE INDEX idx_projects_owner_id ON projects(owner_id);
    CREATE INDEX idx_tasks_project_id ON tasks(project_id);
    
    -- RLS Policies
    ALTER TABLE profiles ENABLE ROW LEVEL SECURITY;
    ALTER TABLE projects ENABLE ROW LEVEL SECURITY;
    ALTER TABLE tasks ENABLE ROW LEVEL SECURITY;
    
    CREATE POLICY "Users can view own profile" ON profiles FOR SELECT USING (auth.uid() = id);
    CREATE POLICY "Users can manage own projects" ON projects FOR ALL USING (auth.uid() = owner_id);
    CREATE POLICY "Users can manage tasks in their projects" ON tasks FOR ALL USING (
      EXISTS (
        SELECT 1 FROM projects 
        WHERE projects.id = tasks.project_id 
        AND projects.owner_id = auth.uid()
      )
    );
    
    -- Updated At Trigger Function
    CREATE OR REPLACE FUNCTION handle_updated_at()
    RETURNS TRIGGER AS $$
    BEGIN
      NEW.updated_at = now();
      RETURN NEW;
    END;
    $$ language 'plpgsql';
    
    CREATE TRIGGER tr_projects_updated_at BEFORE UPDATE ON projects FOR EACH ROW EXECUTE PROCEDURE handle_updated_at();
    CREATE TRIGGER tr_tasks_updated_at BEFORE UPDATE ON tasks FOR EACH ROW EXECUTE PROCEDURE handle_updated_at();
    

    🔗 Relationships:

    • profiles.id -> auth.users.id
    • projects.owner_id -> profiles.id
    • tasks.project_id -> projects.id

    📝 Usage Examples:

    -- Insert a new project
    INSERT INTO projects (owner_id, title) VALUES (auth.uid(), 'Work Sprint');
    
    -- Get all tasks for a specific project with owner check
    SELECT t.* FROM tasks t
    JOIN projects p ON t.project_id = p.id
    WHERE p.owner_id = auth.uid();
    

    Next steps

    1. Copy the SQL block into your Supabase SQL Editor.
    2. Run the migration to create tables and RLS policies.
    3. Test the RLS policies by logging in as a user and attempting to query tasks.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The problem

    Designing normalized schemas and writing manual RLS policies is error-prone and time-consuming. Developers often struggle with securing multi-tenant applications or forgetting essential indexes and updated_at triggers.

    What it does

    • Generates normalized SQL schemas using Supabase-specific types like uuid and timestamptz.
    • Configures Row-Level Security (RLS) policies for user-owned data and role-based access.
    • Applies automatic updated_at triggers and foreign key constraints with proper ON DELETE behavior.
    • Builds indexes for foreign keys and frequently queried columns to ensure performance.

    Frameworks & tools

    Supabase, PostgreSQL, SQL migrations.

    Why this beats prompting it yourself

    Standard LLM prompts often overlook security or create flat, unindexed tables. This skill enforces strict normalization, mandatory RLS enablement, and provides immediate testing queries to verify your backend structure.

    Use cases

    • Building a multi-tenant SaaS backend with isolated user data.
    • Creating a content management system with role-based permissions.
    • Scaffolding a relational schema for complex social media interactions.
    • Generating migration files for new feature releases in an existing project.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.

    Does not generate client-side TypeScript types or Edge Functions. Requires manual execution of generated SQL in the Supabase dashboard or CLI.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    7 uses

    Times used to date

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 2 months ago

    • Free with an Agensi account

    Permissions

    No special permissions declared or detected

    Listed2 months ago

    What's inside

    Frequently Asked Questions

    The skill generates complete SQL scripts including table structures, foreign keys, Row-Level Security (RLS) policies, performance indexes, and automated updated_at triggers. It essentially provides a production-ready foundation for your Supabase backend.

    Unlike generic prompts, this skill enforces strict database normalization and ensures RLS is not just suggested, but correctly implemented for multi-tenant security. It specifically uses Supabase-native types and follows best practices for Postgres performance that general models often miss.

    Yes, you can describe specific features or changes, and the skill will generate the necessary migration code to update your existing Supabase schema while maintaining data integrity and security.

    The skill is designed to work with any AI agent that supports SQL generation and markdown output, including ChatGPT, Claude, and dedicated developer IDE extensions. Simply input your data requirements to receive the formatted code.

    No complex installation is required; once purchased, you can immediately use the skill within your preferred AI agent interface to start generating database schemas. The output is provided in standard SQL format, ready to be pasted into the Supabase SQL Editor or your migration files.

    You receive full access to the skill's logic for generating schemas, RLS policies, and triggers, along with any future updates or optimizations made to the underlying logic as Supabase evolves.

    New in Data & Databases

    Free