xiaohongshu
xiaohongshu
authhub
Use when implementing authentication, user management, organization/tenant management, team invitations, role-based access control (RBAC), or multi-tenant architecture in a Supabase project. Provides complete schema, API templates, and frontend components for AuthHub-style authentication.
Full skill instructions
A complete authentication and organization management system for Supabase projects. Use this skill when implementing:
authhubauthentication setupmulti-tenantorg switchingteam invitationsRBACtenant managementAuthHub supports two deployment modes. Choose based on your use case:
Use this if: Building a single SaaS product with its own Supabase project.
┌─────────────────────────────────────────────────────────┐
│ Your Supabase Project │
├─────────────────────────────────────────────────────────┤
│ AuthHub Tables (public schema) │
│ ├── products (your single product entry) │
│ ├── user_profiles │
│ ├── tenants (organizations) │
│ ├── user_tenants │
│ ├── roles (for your product) │
│ └── user_role_assignments │
├─────────────────────────────────────────────────────────┤
│ Product Tables (public schema with RLS) │
│ ├── customers (has organization_id + RLS) │
│ ├── orders (has organization_id + RLS) │
│ └── ... all your product tables │
└─────────────────────────────────────────────────────────┘
Characteristics:
products table (for future central AuthHub integration)public schema with organization_id columnproduct_id filter (your single product)Use this if: Multiple products share the same Supabase database (like DataSwim + Onboard).
┌─────────────────────────────────────────────────────────┐
│ Shared Supabase Project │
├─────────────────────────────────────────────────────────┤
│ AuthHub Tables (public schema) │
│ ├── products (DataSwim, Onboard, etc.) │
│ ├── user_profiles │
│ ├── tenants │
│ ├── user_tenants │
│ ├── roles (per product) │
│ └── user_role_assignments (includes product_id) │
├─────────────────────────────────────────────────────────┤
│ Product A Tables │ Product B Tables │
│ (public or schema) │ (public or schema) │
└─────────────────────────────────────────────────────────┘
Characteristics:
product_idproduct_idBy keeping the products table in all deployments, we enable future capabilities:
Best for: Most SaaS applications with fixed schemas.
Every product table includes organization_id and RLS policies:
-- Example: customers table
CREATE TABLE public.customers (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
organization_id UUID NOT NULL REFERENCES public.tenants(id),
name TEXT NOT NULL,
email TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- RLS Policy
ALTER TABLE public.customers ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Users can view their org's customers"
ON public.customers FOR SELECT
USING (
organization_id IN (
SELECT tenant_id FROM public.user_tenants
WHERE user_id = auth.uid() AND is_active = true
)
);
Pros:
Cons:
Best for: Applications where tenants define their own data structures (like DataSwim).
Each organization gets its own PostgreSQL schema:
-- Creates: tenant_abc123def456...
SELECT create_tenant_schema('abc123-def4-5678-...');
Pros:
Cons:
When to use Schema-per-tenant:
┌─────────────────────────────────────────────────────────┐
│ Supabase Auth │
│ (auth.users - managed by Supabase) │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ public.user_profiles │
│ (extended user info, links to auth.users) │
└─────────────────────────────────────────────────────────┘
│
┌─────────────┴─────────────┐
▼ ▼
┌─────────────────────┐ ┌─────────────────────────────┐
│ public.user_tenants │ │ public.user_role_assignments │
│ (user ↔ org link) │ │ (user ↔ org ↔ product ↔ role)│
└─────────────────────┘ └─────────────────────────────┘
│ │
└─────────────┬─────────────┘
▼
┌─────────────────────────────────────────────────────────┐
│ public.tenants │
│ (organizations) │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Product Tables (with organization_id) │
│ customers, orders, projects, etc. + RLS policies │
└─────────────────────────────────────────────────────────┘
Each product has its own roles tied to a product_id. Even in standalone mode, keep this structure for future compatibility.
NEVER query tenants directly for user access. Always go through:
user_tenants - for user-org membershipuser_role_assignments - for roles (always filter by product_id)All tables use is_active boolean. Never hard delete - set is_active = false.
Every product table should have organization_id column with appropriate RLS policies.
Even in standalone apps, include product_id in queries. This ensures:
This skill assumes:
| File | Purpose |
|---|---|
| DATABASE_SCHEMA.md | Complete SQL migrations |
| SUPABASE_CONFIG.md | Supabase dashboard settings |
| API_TEMPLATES.md | Next.js API route templates |
| FRONTEND_SETUP.md | React context and components |
| IMPLEMENTATION_CHECKLIST.md | Step-by-step checklist |
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience