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.
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-tenantRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agentic-awesome-skills/skills/saas-multi-tenant ~/.gemini/antigravity-cli/skills/saas-multi-tenantAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
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
ANo 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 →Retrieves lab biomarker results and clinician notes from Function Health through its FHIR API. It is for people who want an AI assistant to review their own lab history and notes.
Gives an AI assistant a methodology for finding and exploiting privilege escalation weaknesses on Windows systems during authorized penetration tests. It is for security testers and defenders validating escalation paths.
Guides the assistant through designing, debugging and hardening GitHub Actions CI/CD workflows. It is aimed at teams that run production pipelines on GitHub.
Develops evidence-backed structural security hardening proposals from disclosures, findings, source code, or Codex Security scans. It is for teams that need systemic fixes and architectural tradeoffs.
Claude Security scans code for security issues with Claude Code. It covers whole repositories, branch or pull request diffs, single commits, and existing findings from SARIF files or earlier reports.
Turns vulnerability notes, disclosure reports, PoCs, source code, or Codex Security findings into self-contained vulnerability reports. Built for security researchers who need claims the evidence supports.
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.
