Backend Multi Tenancy

Use when the user asks about multi-tenancy, SaaS where each customer must only see their own data, tenant isolation, row-level security, schema or database per tenant, tenant context or tenant provisioning. Produces an isolation model with enforcement code. Not for Supabase RLS specifics (use supabase).

45 stars 6 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add j4flmao/agent-skills --skill backend-multi-tenancy
Manual install
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/skills/backend/universal/multi-tenancy ~/.claude/skills/backend-multi-tenancy

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# 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).
Read the full skill on GitHub

Details

Skill name
backend-multi-tenancy
Path
skills/backend/universal/multi-tenancy/SKILL.md
License
MIT
Repo updated
17 November 2026

FAQ

What does the Backend Multi Tenancy skill do?

Use when the user asks about multi-tenancy, SaaS where each customer must only see their own data, tenant isolation, row-level security, schema or database per tenant, tenant context or tenant provisioning. Produces an isolation model with enforcement code. Not for Supabase RLS specifics (use supabase).

How do I install the Backend Multi Tenancy skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add j4flmao/agent-skills --skill backend-multi-tenancy. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Backend Multi Tenancy popular?

It lives in j4flmao/agent-skills, which has 45 GitHub stars and 6 forks.

Related skills

Agent Observability

45

j4flmao/agent-skills

Use when the user asks about agent observability, tracing agent reasoning, debugging an agent loop, OpenTelemetry GenAI spans for LLM calls, LLM cost tracking per agent, agent audit logs or hallucination/eval monitoring in production. Produces instrumentation config, trace schema, dashboards, alerts and cost attribution. Not for generic service tracing without LLMs (use devops-opentelemetry).

DevOps & Cloud

AI Agent Architectures

45

j4flmao/agent-skills

Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework (Claude Agent SDK, OpenAI Agents SDK, LangGraph). Produces an architecture brief covering loop, tools, memory, guardrails and evals, routing depth to child skills. Not for workflow patterns (use ai-agentic-workflows).

AI, LLMs & Agents

AI Agent Core Loop

45

j4flmao/agent-skills

Use when the user asks about the agent loop, ReAct vs plan-and-solve, re-planning, Reflexion, an agent stuck in a loop, max iterations or termination conditions. Produces a loop spec or patch with state, success predicate, caps and no-progress detection. Not for overall agent design (use ai-agent-architectures) or tool schemas (use tool-calling-principles).

AI, LLMs & Agents

Backend Plugin Architecture

45

j4flmao/agent-skills

Use when the user asks about a plugin system, extension points, SPI, plugin loader, hot-plug or dynamic loading, plugin sandboxing or plugin manifests. Produces a plugin host design with lifecycle and isolation. Not for micro-frontends (use microfrontend).

Software Development

Backend Message Queue

45

j4flmao/agent-skills

Use when the user asks about Kafka topics and partitions, RabbitMQ exchanges, SQS, consumer groups, consumer lag, dead letter queues, retention or message size limits. Produces broker topology and producer/consumer configuration. Not for event design between services (use backend-event-driven) or stream processing (use data-streaming).

Software Development

Backend Report Generation

45

j4flmao/agent-skills

Use when the user asks about PDF report generation, Puppeteer or Playwright PDFs, Excel/CSV export, async report jobs, scheduled reports or exporting large datasets. Produces a report pipeline with templates, queued generation and delivery. Not for live dashboards (use data-bi-tools) or bulk import (use backend-bulk-import).

Software Development

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.