agent-11: Skill for Claude Code

.claude/skills/saas-multitenancy/SKILL.md

saas-multitenancy is a skill for Claude Code from TheWayWithin/agent-11. It costs 6 tokens per session (2,000 once invoked), scanned A, original, MIT.

A guide to building SaaS software for multiple separate customers, called tenants, while keeping each customer's data isolated. It covers tenant context, organizations, teams, roles, routing, and database row-level security, which lets a database restrict rows by tenant.

In plain words
What is it for?
Designing tenant-scoped APIs and queries, setting up organization hierarchies, provisioning tenants, and enforcing isolation with database rules.
Why use it?
It reduces the risk of one customer seeing or changing another customer's data. It also provides patterns for handling shared databases and tenant-specific requests consistently.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is TheWayWithin/agent-11's own configuration. It tells Claude Code how to work on agent-11 itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agent-11 configures →

Reuse

Borrowing it

Nothing to install: this file belongs to TheWayWithin/agent-11. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/TheWayWithin/agent-11/main/.claude/skills/saas-multitenancy/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/TheWayWithin/agent-11

Made for: Claude Code.

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 saas-multitenancy

README.md
[![agentmods](https://agentmods.dev/badge/skills/thewaywithin/agent-11/saas-multitenancy/github.svg)](https://agentmods.dev/skills/thewaywithin/agent-11/saas-multitenancy)
Your own site
<a href="https://agentmods.dev/skills/thewaywithin/agent-11/saas-multitenancy"><img src="https://agentmods.dev/badge/skills/thewaywithin/agent-11/saas-multitenancy/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for saas-multitenancy

Your own site · 80×15
<a href="https://agentmods.dev/skills/thewaywithin/agent-11/saas-multitenancy"><img src="https://agentmods.dev/badge/skills/thewaywithin/agent-11/saas-multitenancy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,000 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.00006 $0.02000
Opus 5.5 $0.00002 $0.00800
Sonnet 5.5 $0.00001 $0.00400
Haiku 4.5 $0.00001 $0.00200

Measured 1mo ago against content hash 265104d05518, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

saas-multitenancy 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 1mo 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.

.claude/skills/saas-multitenancy/SKILL.md · 312 lines

How it starts

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

SaaS Multi-Tenancy

Capability

Implement robust multi-tenant architecture for SaaS applications with proper data isolation, tenant context management, and scalable patterns. Covers shared database with row-level security, tenant-scoped queries, and organization/team hierarchies.

Use Cases

  • Data isolation between tenants (organizations/workspaces)
  • Team/organization hierarchy with roles
  • Tenant-scoped API endpoints
  • Subdomain or path-based tenant routing
  • Tenant provisioning and onboarding
  • Cross-tenant admin operations

Patterns

Row-Level Security (RLS) Pattern

When to use: Shared database with multiple tenants needing data isolation

Implementation: Use database-level RLS policies to enforce tenant isolation. Every query automatically filters by tenant.

-- Enable RLS on tenant tables
ALTER TABLE projects ENABLE ROW LEVEL SECURITY;

-- Create tenant isolation policy
CREATE POLICY tenant_isolation ON projects
  USING (tenant_id = current_setting('app.current_tenant_id')::uuid);

-- Create policy for insert
CREATE POLICY tenant_insert ON projects
  FOR INSERT
  WITH CHECK (tenant_id = current_setting('app.current_tenant_id')::uuid);

-- Create policy for update/delete
CREATE POLICY tenant_modify ON projects
  FOR ALL
  USING (tenant_id = current_setting('app.current_tenant_id')::uuid);
// Middleware to set tenant context
async function setTenantContext(tenantId: string) {
  // Set session variable for RLS
  await db.execute(
    sql`SELECT set_config('app.current_tenant_id', ${tenantId}, true)`
  );
}

// Usage in API route
async function handleRequest(req: Request) {
  const tenantId = await getTenantFromSession(req);
  await setTenantContext(tenantId);

  // All subsequent queries automatically filtered
  const projects = await db.query.projects.findMany();
  return projects; // Only returns tenant's projects
}

Tenant Context Middleware

When to use: Every request needs tenant context for data access

Read the full file on GitHub · 312 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. 1mo ago First seen · 312 lines · 6 tokens per session scan A 265104d05518

Subscribe to this mod's changes

saas-multitenancy is a skill published in the GitHub repository TheWayWithin/agent-11 (17 stars, last pushed 1mo ago), licensed MIT. It adds 6 tokens to every session and 2,000 once invoked, about $0.0000 per session on Opus 5.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-04.

Related

Other skills, from other repositories

stripe-projects

Use when the user wants to provision infrastructure or third-party services using Stripe Projects. Triggers: "I need a database", "set up auth", "add caching", "give me a Postgres", "provision Redis", "I need hosting", "add a vector DB", "get me an API key for X", "get credentials for X", "sign up for a service", "set…

stripe/ai · 213 tokens

database-patterns

Database design and migration patterns for Alembic migrations, schema design (SQL/NoSQL), and database versioning. Use when creating migrations, designing schemas, normalizing data, managing database versions, or handling schema drift.

yonatangross/orchestkit · 49 tokens

architecture

Greenfield architecture design: map functionality flows, draw components, design APIs, classify dependencies, plan observability. For multi-component, API, schema, auth, or integration-heavy work. For retrofitting existing code, use codebase-hygiene instead.

romiluz13/cc10x · 56 tokens

migration-helper

Guide safe database and code migrations with zero-downtime strategies.

nguyenthienthanh/aura-frog · 16 tokens

Backend Master Agent

Backend implementation playbook — API endpoints, database models/migrations, auth, query optimization, and the framework-specific traps that break servers in production. Use when implementing or reviewing server-side code: FastAPI / Django / Flask / Express / NestJS / Go / Axum handlers, SQLAlchemy / Prisma / Mongoose…

nxtg-ai/forge-plugin · 118 tokens

pagination-and-filtering

SocialApp pagination and filtering patterns — cursor-based SQL pagination, LIMIT+1 hasMore, TanStack infinite queries, admin table pagination, debounced search.

RaNDoM6913/claude-code-superkit · 35 tokens