/saas-builder:saas-databasefrom saas-builder
Set up the database layer of a SaaS application. Covers Supabase project creation, schema design, Row Level Security (RLS), migrations, and connection pooling. Use this skill when the user wants to set up a database, design a schema, or configure Supabase.
Ships in saas-builder. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill covers the database infrastructure for a SaaS application using Supabase (PostgreSQL).
.env.local:
NEXT_PUBLIC_SUPABASE_URL=your_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
npm install @supabase/supabase-js @supabase/ssr
id (uuid), created_at, and updated_at columnsuser_id foreign key to link records to auth.users-- User profiles (extends auth.users)
create table profiles (
id uuid references auth.users on delete cascade primary key,
email text,
full_name text,
avatar_url text,
created_at timestamptz default now(),
updated_at timestamptz default now()
);
-- Subscription plans
create table subscriptions (
id uuid default gen_random_uuid() primary key,
user_id uuid references auth.users on delete cascade not null,
plan text not null default 'free', -- 'free', 'pro', 'enterprise'
status text not null default 'active', -- 'active', 'cancelled', 'past_due'
stripe_customer_id text,
stripe_subscription_id text,
current_period_end timestamptz,
created_at timestamptz default now(),
updated_at timestamptz default now()
);
Enable RLS and create policies for every user-facing table:
-- Enable RLS
alter table profiles enable row level security;
alter table subscriptions enable row level security;
-- Users can only see their own profile
create policy "Users can view own profile"
on profiles for select
using (auth.uid() = id);
create policy "Users can update own profile"
on profiles for update
using (auth.uid() = id);
-- Users can only see their own subscription
create policy "Users can view own subscription"
on subscriptions for select
using (auth.uid() = user_id);
Use Supabase CLI for migrations:
npx supabase init
npx supabase migration new create_profiles
# Edit the migration file in supabase/migrations/
npx supabase db push
For production, use the pooler connection string (Transaction mode) from Supabase dashboard → Settings → Database → Connection pooling.
Set in .env.local:
DATABASE_URL=postgresql://postgres.[ref]:[password]@aws-0-[region].pooler.supabase.com:6543/postgres
Create lib/supabase/client.ts (browser) and lib/supabase/server.ts (server) using @supabase/ssr.
// 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!
)
}
supabase db push after every schema change in developmentgenerated always as identity for integer primary keys, gen_random_uuid() for uuidWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub carriegale2710/skills-library --plugin saas-builder12 skills in this plugin
/saas-analyticsSet up PostHog analytics and product analysis for a SaaS application. Event tracking, user identification, feature flags, session replay, funnel analysis, and privacy-compliant configuration. Use this skill when the user wants anything related to user analytics, PostHog, event tracking, user behaviour, feature flags, A/B testing, conversion analysis, or metric tracking. Phrases like "set up analytics", "track users", "add PostHog", "create a feature flag" trigger this skill.
/saas-api-securitySet up an API security layer for a SaaS application. Rate limiting, plan-based access control, input validation, error handling, CORS, and health checks. Use this skill when the user wants anything related to API security, rate limiting, authorisation, input validation, error handling, or API protection. Phrases like "secure the API", "add rate limiting", "check the plan", "input validation" trigger this skill.
/saas-authSet up the authentication layer of a SaaS application. Covers Google OAuth, Magic Link, email/password login, JWT session management, and middleware for protected routes. Use this skill when the user wants to add authentication, set up login, or configure user sessions.
Other plugins' skills for the same job