Skip to content

Architecture guide for multi-tenant SaaS covering tenant isolation, Stripe subscriptions, and usage billing.

CCM score
42 of 100
skills.sh installs
366
GitHub stars
26
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers tenant isolation strategies: shared database with tenant_id, schema per tenant, and database per tenant
  • Includes Prisma middleware for automatic tenant filtering, PostgreSQL row-level security, and tenant context helpers
  • Handles Stripe subscription lifecycle: creation, proration on plan change, cancellation, and webhook syncing
  • Designed for B2B platforms that need usage-based billing and plan-based feature entitlements

Install

$ npx -y skills add miles990/claude-software-skills --skill saas-platforms -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

SaaS Platform Development

Overview

Building Software-as-a-Service applications with multi-tenancy, subscription billing, and user management.


Multi-Tenancy

Database Strategies

// Strategy 1: Shared database with tenant_id column
interface TenantEntity {
  tenantId: string;
  // ... other fields
}

// Middleware to inject tenant context
function tenantMiddleware(req: Request, res: Response, next: NextFunction) {
  const tenantId = req.headers['x-tenant-id'] || req.user?.tenantId;

  if (!tenantId) {
    return res.status(400).json({ error: 'Tenant ID required' });
  }

  req.tenantId = tenantId;
  next();
}

// Prisma middleware for automatic tenant filtering
prisma.$use(async (params, next) => {
  const tenantId = getCurrentTenantId();

  if (params.model && hasTenantId(params.model)) {
    // Add tenant filter to queries
    if (params.action === 'findMany' || params.action === 'findFirst') {
      params.args.where = {
        ...params.args.where,
        tenantId,
      };
    }

    // Add tenant ID to creates
    if (params.action === 'create') {
      params.args.data.tenantId = tenantId;
    }
  }

  return next(params);
});

Details

Repository
github.com/miles990/claude-software-skills
Categories
Backend & APIs, Databases, Finance & Trading
First seen
Jun 3, 2026

Questions

What does the saas-platforms skill cover?

The saas-platforms skill covers SaaS architecture, multi-tenancy, and subscription management. It gives the agent patterns for tenant isolation, Stripe subscriptions, usage-based billing, and feature flags with plan entitlements.

How do I install the saas-platforms skill?

Run npx -y skills add miles990/claude-software-skills --skill saas-platforms -y in your project to install saas-platforms. After that, the agent can apply saas-platforms guidance when you work on multi-tenant or subscription features.

Which category does saas-platforms belong to on Claude Marketplaces?

saas-platforms is listed in the Backend & APIs category on Claude Marketplaces. Other skills in that category include entra-app-registration, neon, firebase-basics, firebase-auth-basics and workers-best-practices, and saas-platforms adds multi-tenancy and billing patterns to that set.

Who is the saas-platforms skill for?

saas-platforms suits developers building B2B or enterprise SaaS products that serve multiple organizations. Its triggers favor work on tenants, subscriptions, billing, onboarding and pricing tiers.

What does saas-platforms need to run?

saas-platforms uses Stripe for its subscription and usage examples, so the Stripe secret key must be set in your environment. Its examples also assume a Prisma-based data layer on PostgreSQL.

More from miles990/claude-software-skills

All 5

Similar to Saas Platforms

More Backend & APIs