multi-tenant-saas-backend

Community

Ship safer multi-tenant AI SaaS backends.

Authortlennon-ie
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill prevents multi-tenant data leaks and billing bugs by standardizing how you handle JWT-to-DB access, RLS policies, webhook verification/idempotency, and credit ledger correctness in an AI SaaS backend.

Core Features & Use Cases

  • Three-client database pattern: Separate anonymous, user-scoped (JWT attached), and service-role admin usage to avoid accidental RLS bypass and cross-tenant exposure.
  • RLS policy templates: Owner-only access, public read with owner write, and org/tenant-scoped membership checks designed to be enforced consistently across tables.
  • Payment webhook hardening: Verify webhook signatures against the raw request body and enforce replay protection via event deduplication.
  • Credit ledger design with refunds: Implement atomic credit deductions, logged usage, and auto-refund when streamed AI responses fail to produce usable output.
  • Admin allowlist gating: Use environment-variable admin allowlists and auditable admin mutations to reduce privilege mistakes.

Quick Start

Ask an AI engineer to generate an end-to-end multi-tenant backend plan for your Postgres RLS schema and webhook handlers based on this Skill.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: multi-tenant-saas-backend
Download link: https://github.com/tlennon-ie/product-building-agents/archive/main.zip#multi-tenant-saas-backend

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.