saas-architecture-advisor
Advises on multi-tenant SaaS architecture decisions including tenancy models, data isolation strategies, tenant routing, and scaling patterns. Use when…
от TerminalSkills★ 221 звезда на GitHub
Установить saas-architecture-advisor в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
SaaS Architecture Advisor
Overview
This skill helps teams design and implement multi-tenant SaaS architectures by evaluating isolation strategies, generating tenant routing patterns, and recommending the right tradeoffs based on scale, compliance requirements, and budget constraints.
Instructions
Step 1: Gather Context
Before recommending anything, establish:
- Scale: Expected tenant count (year 1 and year 3)
- Tenant size: Users per tenant (range and distribution)
- Compliance: SOC2, HIPAA, GDPR, or contractual isolation requirements
- Stack: Database, language, framework, hosting
- Budget: Monthly infrastructure budget
- Data sensitivity: What kind of data tenants store
- Customization needs: Do tenants need custom fields, workflows, or branding?
Step 2: Evaluate Tenancy Models
Present trade-offs for these models:
Shared Everything (single DB, shared tables, tenant_id column):
- Best for: <1,000 tenants, uniform data model, no strict isolation requirements
- Cost: Lowest. One database instance serves every tenant, so cost grows with instance size, not tenant count
- Risk: Query bugs can leak data; noisy neighbor issues
- Mitigation: Row-level security (PostgreSQL RLS), application-layer checks
Schema per Tenant (single DB, separate schemas):
- Best for: 50-500 tenants, moderate isolation needs
- Cost: Low (single DB instance, logical separation)
- Risk: Migration complexity scales with tenant count; catalog bloat
- Mitigation: Automated migration tooling, connection pooling with schema switching
Database per Tenant (dedicated DB per tenant):
- Best for: <100 tenants, strict compliance, large enterprise clients
- Cost: Highest. Each tenant pays for its own instance (storage, backups, minimum instance size). Get the per-instance quote from the AWS Pricing Calculator; RDS prices vary by instance class and region
- Risk: Operational overhead managing N databases
- Mitigation: Infrastructure-as-code templates, centralized monitoring
Hybrid (shared for standard, dedicated for enterprise):
- Best for: Mixed tenant base with some requiring isolation
- Cost: Moderate (shared DB + N dedicated for premium)
- Trade-off: Two code paths, but repository pattern abstracts them
Step 3: Design Tenant Routing
Recommend routing strategy based on the application type:
- Subdomain routing:
tenant.app.com— best for B2B SaaS - Path routing:
app.com/tenant/— simpler SSL, good for internal tools - Header routing:
X-Tenant-ID— API-first products - JWT claim:
tenant_idin token — serverless/stateless architectures
Step 4: Address Cross-Cutting Concerns
For each recommendation, cover:
- Rate limiting: Per-tenant to prevent noisy neighbors
- Billing metering: How to track usage per tenant
- Background jobs: Tenant context propagation to workers/queues
- Caching: Tenant-namespaced cache keys
- Search: Filtered indices or per-tenant indices
- Audit logging: Tenant-scoped audit trails
Step 5: Generate Implementation Artifacts
Produce:
- Database schema with tenant isolation mechanisms
- Middleware/interceptor code for tenant context
- Repository pattern that abstracts tenancy
- Tenant provisioning/deprovisioning scripts
- Migration strategy for existing single-tenant apps
Examples
Example 1: Early-Stage SaaS
User prompt:
We have 30 tenants and expect 200 in a year. PostgreSQL, no compliance needs yet. What tenancy model?
Agent output:
Recommendation: Shared database with RLS
At 200 tenants with no compliance requirements, a single PostgreSQL database
with row-level security gives you the best simplicity-to-isolation ratio.
Implementation:
1. Add tenant_id UUID column to all tenant-scoped tables
2. Enable RLS: ALTER TABLE <table> ENABLE ROW LEVEL SECURITY;
3. Create policies: USING (tenant_id = NULLIF(current_setting('app.current_tenant_id', true), '')::UUID)
4. Set tenant context per request in middleware, inside the request's transaction:
SELECT set_config('app.current_tenant_id', $1, true) -- true = transaction-local, pool-safe
Cost: one small managed PostgreSQL instance. Size it from a load test rather than a guess;
the exact monthly price comes from the AWS Pricing Calculator for the chosen instance class.
Migration path: If you later need dedicated DBs for enterprise clients,
the repository pattern lets you route specific tenants without changing app code.
Example 2: Healthcare SaaS Requiring HIPAA
User prompt:
Building a patient records SaaS. 50 clinic tenants, HIPAA required. Budget: $5k/month infra.
Agent output:
Recommendation: Database per tenant
HIPAA requires demonstrable data isolation. At 50 tenants, per-tenant databases
are operationally feasible and satisfy compliance auditors.
Architecture:
- Tenant registry DB (shared): Stores tenant metadata + routing config
- Per-tenant RDS instances: 50 × (Pricing Calculator q
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- _scores.json
FAQ
Что делает скилл saas-architecture-advisor?
Advises on multi-tenant SaaS architecture decisions including tenancy models, data isolation strategies, tenant routing, and scaling patterns. Use when someone is building a SaaS product, converting single-tenant to multi-tenant, or evaluating isolation strategies. Trigger words: multi-tenant, SaaS architecture, tenant isolation, shared database, per-tenant database, row-level security, tenant routing, SaaS patterns.
Как установить скилл saas-architecture-advisor?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл saas-architecture-advisor запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…