backend-multi-tenancy

backend-multi-tenancy is a skill for Claude Code, Codex from j4flmao/agent-skills. It costs 113 tokens per session (5,110 once invoked), scanned A, original, MIT.

A guide to separating customers in a shared SaaS application, where one product serves multiple organizations called tenants. It covers shared tables, separate database schemas, and separate databases.

In plain words
What is it for?
Use it to design tenant-aware data access, customer provisioning, migrations, backups, and row-level security.
Why use it?
It helps prevent one customer from seeing another customer's data while balancing isolation, cost, and operational complexity.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex.

Good fit Use it to design tenant-aware data access, customer provisioning, migrations, backups, and row-level security.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/j4flmao/agent-skills/multi-tenancy
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add j4flmao/agent-skills --skill multi-tenancy
Clone the repo
git clone --depth 1 https://github.com/j4flmao/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for backend-multi-tenancy

README.md
[![agentmods](https://agentmods.dev/badge/skills/j4flmao/agent-skills/multi-tenancy.svg)](https://agentmods.dev/skills/j4flmao/agent-skills/multi-tenancy)
Your own site
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/multi-tenancy"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/multi-tenancy.svg" alt="Measured on agentmods" height="20"></a>
Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,110 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00113 $0.05110
Opus 5 $0.00056 $0.02555
Sonnet 5 $0.00023 $0.01022
Haiku 4.5 $0.00011 $0.00511

Measured 4d ago against content hash b33dcc5a052b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

backend-multi-tenancy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/backend/universal/multi-tenancy/SKILL.md · 551 lines

How it starts

The opening of the file, as written. The whole thing — 551 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Backend Multi-Tenancy

Purpose

Implement tenant isolation in a SaaS application using row-level, schema-per-tenant, or DB-per-tenant strategies with automated provisioning and safe migrations. The core challenge is guaranteeing that no tenant can access another tenant's data while balancing operational complexity, cost, and compliance requirements.

Architecture/Decision Trees

Isolation Strategy Decision Tree

Is regulatory compliance required (GDPR/SOC 2/HIPAA)?
  |-- YES --> Do tenants require full data separation?
  |     |-- YES --> DB-per-tenant (highest isolation)
  |     |-- NO  --> Schema-per-tenant
  |-- NO --> Expected tenant count?
        |-- < 100, B2B --> Schema-per-tenant
        |-- >= 100, B2C --> Row-level (shared database)
        |-- Mixed (B2B+B2C) --> Hybrid: row-level for B2C, schema for B2B

Hybrid Strategy Matrix

Tier Isolation Database Provisioning Backup
Free Row-level Shared Auto (self) Global
Pro Schema Shared Auto (self) Global
Enterprise DB Dedicated Manual Per-tenant

Agent Protocol

Trigger

Exact user phrases: "multi-tenancy", "SaaS", "tenant isolation", "row-level security", "DB per tenant", "schema per tenant", "tenant provisioning", "tenant migration", "multi-tenant database", "tenant context".

Input Context

  • Number of tenants (current and projected).
  • Regulatory requirements (GDPR, SOC 2, HIPAA).
  • Database technology and hosting model.
  • Existing authentication/user system.
  • Pricing tiers and tenant size distribution.
  • Team operational capacity for managing per-tenant infrastructure.

Output Artifact

Tenant isolation configuration or implementation plan. No file unless requested.

Response Format

Strategy: {Row-level|Schema-per-tenant|DB-per-tenant}
Isolation Level: {shared|semi-isolated|fully-isolated}
Provisioning: {automated|manual}
Migration: {shared schema|per-tenant}

Read the full file on GitHub · 551 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 551 lines · 113 tokens per session scan A b33dcc5a052b

Subscribe to this mod's changes

backend-multi-tenancy is a skill published in the GitHub repository j4flmao/agent-skills (22 stars, last pushed yesterday), licensed MIT. It adds 113 tokens to every session and 5,110 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

saas-builder

Clone, verify, map, and build on top of ixartz/SaaS-Boilerplate for a user's SaaS idea. Use when a user wants to reuse SaaS Boilerplate, evaluate how their product fits it, or build product-specific pages, database schema, roles, permissions, MVP features, and launch scope on top of the boilerplate.

ixartz/SaaS-Boilerplate · 75 tokens

saas-storage

SaaS uygulaması için Supabase Storage ile dosya depolama altyapısı kur. Bucket yapılandırması, RLS ile dosya güvenliği, dosya yükleme, görsel optimizasyonu ve plan bazlı depolama limitleri. Bu skill'i kullanıcı dosya yükleme, görsel, depolama, storage, upload veya profil fotoğrafı ile ilgili bir şey istediğinde…

komunite/tezgah · 115 tokens

multi-tenancy

Multi-tenant architecture patterns: row-level, schema-level, database-level isolation and tenant routing.

camilooscargbaptista/cto-toolkit · 22 tokens

saas-platforms

SaaS architecture, multi-tenancy, and subscription management.

miles990/claude-software-skills · 17 tokens

event-store-design

Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.

wshobson/agents · 33 tokens

convex-explain-app

Explain an existing Convex app — data model + relationships, public vs internal functions, auth/ownership model, components, a request→data flow — read from the schema and function surface. Read-only.

openclaw/clawhub · 47 tokens