multi-tenant-architecture

multi-tenant-architecture is a skill for Claude Code, Codex from mblode/agent-skills. It costs 72 tokens per session (3,863 once invoked), scanned A, original, MIT.

Architecture guidance for multi-tenant SaaS applications, where one service is shared by multiple customers while keeping their data and settings separate. It covers Cloudflare and Vercel choices, domains, tenant identification, isolation, routing, and plan limits.

In plain words
What is it for?
Use it to design shared customer platforms, subdomains, custom domains, white-label sites, tenant context handling, and per-plan limits on Cloudflare or Vercel.
Why use it?
It helps avoid mixing customers' data or choosing a hosting and domain setup that cannot support the intended tenant model.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present. Also seen: positional $N argument.

Part of the agent-skills plugin — 25 skills shipped together

Good fit Use it to design shared customer platforms, subdomains, custom domains, white-label sites, tenant context handling, and per-plan limits on Cloudflare or Vercel.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mblode/agent-skills/multi-tenant-architecture
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 mblode/agent-skills --skill multi-tenant-architecture
Clone the repo
git clone --depth 1 https://github.com/mblode/agent-skills

Made for: Claude Code, Codex.

Or install agent-skills, the plugin that ships this one along with the rest of its 25 skills.

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 multi-tenant-architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/mblode/agent-skills/multi-tenant-architecture/github.svg)](https://agentmods.dev/skills/mblode/agent-skills/multi-tenant-architecture)
Your own site
<a href="https://agentmods.dev/skills/mblode/agent-skills/multi-tenant-architecture"><img src="https://agentmods.dev/badge/skills/mblode/agent-skills/multi-tenant-architecture/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 multi-tenant-architecture

Your own site · 80×15
<a href="https://agentmods.dev/skills/mblode/agent-skills/multi-tenant-architecture"><img src="https://agentmods.dev/badge/skills/mblode/agent-skills/multi-tenant-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,863 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 18 Mar 2026
  • Snyk pass 18 Mar 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 104
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
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.00072 $0.03863
Opus 5 $0.00036 $0.01931
Sonnet 5 $0.00014 $0.00773
Haiku 4.5 $0.00007 $0.00386

Measured today against content hash f24700710bb5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

multi-tenant-architecture scanned grade A with 1 finding 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 today.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Forwarding inbound tenant headers: `curl -H "x-tenant-id: <other>"` then serves another tenant's data. Delete or overwrite `x-tenant-*` on every path through the proxy, including paths that skip resolution.
skills/multi-tenant-architecture/SKILL.md · 197 lines

How it starts

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

Multi-Tenant Platform Architecture (Cloudflare or Vercel)

  • IS: platform choice, domain strategy and PSL, tenant identification, compute and data isolation, hostname routing, tenant context propagation, custom domains and SSL, per-tenant static files, and mapping platform limits to plans.
  • IS NOT: general folder structure or module contracts (use codebase-architecture), scaffolding a new repo (use scaffold-nextjs), or the content of per-tenant SEO files once routing serves them dynamically: sitemap entries, canonical URLs, structured data, indexing policy (use seo).

Contents

  • Platform dispatch (decide first)
  • Reference files
  • Workflow (order matters)
  • Gotchas
  • Output schema
  • Pre-commit checklist
  • Related skills

Platform dispatch (decide first)

Signals Platform Model
Tenants upload or generate their own code; code-level isolation; edge compute on KV, D1, Durable Objects, R2 Cloudflare Dispatch Worker in front of a dispatch namespace of per-tenant Workers; Cloudflare for SaaS for custom hostnames
Every tenant runs the same Next.js codebase and differs by content, branding, and plan; ISR, Server Components, Vercel deploys Vercel One deployment; proxy.ts resolves the tenant from the hostname; wildcard plus custom domains on the project
  • Pick one platform per product. Fronting a Vercel app with a Cloudflare proxy doubles the TLS and redirect layers and is the usual cause of redirect loops and failed certificate issuance.
  • Tenants shipping their own code on Vercel is the multi-project model (one Vercel project per tenant, created with the SDK). It follows the Cloudflare row's isolation reasoning; this skill's Vercel references cover the single-deployment model only.

Reference files

File Read when
cloudflare-platform.md Cloudflare chosen: dispatch namespaces, routing, Cloudflare for SaaS custom hostnames, isolation modes, KV and D1 (steps 3 to 7)
vercel-platform.md Vercel chosen: proxy.ts resolution, App Router layout, Global Config lookups, per-tenant static files, custom subpaths, local dev (steps 4 to 7)
vercel-domains.md Vercel chosen: SDK domain lifecycle, DNS targets, verification, wildcard nameservers, SSL, troubleshooting (step 7)
data-isolation.md Step 3 on either platform: shared schema with RLS, schema-per-tenant, database-per-tenant, and the Postgres/Supabase/Drizzle policy pattern
psl.md Step 1 when tenants publish content or run code on sibling subdomains: eligibility, submission, interim cookie controls
limits-and-quotas.md Step 8: dated snapshot of Cloudflare, Vercel, and Neon limits to map onto plans
agents/openai.yaml Never during a task: launcher metadata for external runners

Read the full file on GitHub · 197 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. today Changed · -2 tokens per session f24700710bb5
  2. 4d ago Changed · +14 lines · -58 tokens per session 697d75a21dad
  3. 9d ago First seen · 183 lines · 132 tokens per session scan A ce97934f03db

Subscribe to this mod's changes

multi-tenant-architecture is a skill published in the GitHub repository mblode/agent-skills (106 stars, last pushed yesterday), licensed MIT. It adds 72 tokens to every session and 3,863 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

stripe-projects

Provision SaaS services + sync creds via Stripe Projects.

NousResearch/hermes-agent · 15 tokens

spring-cloud-eureka

Netflix Eureka for service discovery in Spring Cloud microservices. Covers Eureka Server, Eureka Client, registration, and health checks. USE WHEN: user mentions "eureka", "service discovery", "service registry", "@EnableEurekaServer", "@EnableDiscoveryClient", "eureka dashboard" DO NOT USE FOR: Kubernetes service…

claude-dev-suite/claude-dev-suite · 88 tokens

spring-cloud-gateway

Spring Cloud Gateway for API routing, filtering, and load balancing. Covers route predicates, filters, rate limiting, and circuit breaker integration. USE WHEN: user mentions "spring cloud gateway", "API gateway", "route predicates", "gateway filters", "rate limiting gateway", "load balancing gateway" DO NOT USE FOR…

claude-dev-suite/claude-dev-suite · 89 tokens

spring-cloud-basics

Spring Cloud patterns for microservices in Spring Boot 3.x. Covers Service Discovery, Config Server, API Gateway, Circuit Breaker, Load Balancing, and Distributed Tracing. USE WHEN: user mentions "spring cloud", "microservices architecture", "service discovery", "config server", "cloud native Spring" DO NOT USE FOR…

claude-dev-suite/claude-dev-suite · 99 tokens

spring-cloud-config

Spring Cloud Config for centralized configuration management in microservices. Covers Config Server, Config Client, Git backend, and dynamic refresh. USE WHEN: user mentions "spring cloud config", "config server", "centralized configuration", "@RefreshScope", "externalized config" DO NOT USE FOR: simple properties…

claude-dev-suite/claude-dev-suite · 80 tokens

hono

Hono ultrafast web framework for edge runtimes. Covers routing, middleware, and multi-runtime support. Use when building edge-first APIs. USE WHEN: user mentions "Hono", "hono", "Cloudflare Workers", "Vercel Edge", "edge runtime", "Bun", asks about "edge-first API", "multi-runtime framework", "ultrafast web…

claude-dev-suite/claude-dev-suite · 140 tokens