Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

saas-multi-tenant

Skill by sickn33

Guides AI assistants through designing multi-tenant SaaS architectures with row-level security, tenant-scoped queries, and safe cross-tenant admin patterns. It targets PostgreSQL and TypeScript projects.

  • Score 88
  • 50k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install saas-multi-tenant

Built from the published package, never by AI.

git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/saas-multi-tenant ~/.claude/skills/saas-multi-tenant

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install saas-multi-tenant in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This agent skill gives an AI assistant guidance for building SaaS apps where many customers share one database. It covers choosing a tenancy model, adding a NOT NULL tenant_id column to tenant-scoped tables, and writing PostgreSQL row-level security policies. It also covers setting the tenant on each request with SET LOCAL, scoping ORM queries, and provisioning new tenants inside a transaction.

The skill also explains how to handle background jobs, tenant deletion, data export, and shared resources. It describes separate admin routes that bypass RLS and must use their own authentication. The source is aimed at developers building multi-tenant SaaS applications who need tenant isolation. It is not meant for single-user apps or for authentication-only work.

Written from the project's SKILL.md and checked against it.

What it can do

  • Choose a tenancy modelCompares shared-schema, schema-per-tenant, and database-per-tenant designs against scale and isolation needs.
  • Add tenant_id columnsAdds a NOT NULL tenant_id column to every tenant-scoped table and includes it in composite indexes.
  • Set up row-level securityCreates PostgreSQL RLS policies that filter rows by the current tenant setting.
  • Build tenant-aware middlewareExtracts the tenant from the session or JWT and sets it on the database connection per transaction.
  • Scope ORM queriesShows how to inject tenant filters into Prisma middleware or a Drizzle base query builder.
  • Enforce tenant-aware migrationsSuggests a lint rule or CI check that rejects new tables without tenant_id unless marked global.
  • Design cross-tenant admin routesDescribes admin endpoints that bypass RLS and use a separate admin authentication flow.
  • Provision new tenantsCreates the tenant record, seeds default data, and assigns the founding user inside one transaction.

What you need

  • PostgreSQL
  • TypeScript

Try asking

  • Add tenant_id and RLS policies to my projects table in PostgreSQL
  • Set up tenant-aware middleware in my Express app using SET LOCAL
  • Design a safe admin metrics route that aggregates data across tenants

Good to know

  • The Prisma $use example is a historical sketch and is not an isolation layer on its own.
  • Shared-schema is recommended as the default for most apps under 1000 tenants.
  • Code examples need request timeouts and integration tests before use, according to the source.
  • Background jobs must carry tenant_id in their payload or they will fail or bypass RLS.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/saas-multi-tenant/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md13 KB

Alternatives to saas-multi-tenant

All alternatives →

Compare with function_health, windows-privilege-escalation or github-actions-advanced

saas-multi-tenant: common questions

Does this skill replace an authentication library?

No. The source says authentication-only requests should use an auth skill instead, since this skill focuses on tenant scoping.

Is the Prisma middleware example safe to deploy as is?

The source says no. It omits several operations and does not bind a transaction-local RLS context, so it should not be deployed as automatic protection.

Which database does this skill target?

It targets PostgreSQL, using row-level security and SET LOCAL, with TypeScript examples.

How do I install saas-multi-tenant?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is saas-multi-tenant free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is saas-multi-tenant safe to use?

It scores 88 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to saas-multi-tenant?

Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.

saas-multi-tenant Install

Add to stack

Loading.