This covers the practical architecture of SaaS applications: multi-tenancy strategies (shared database with tenant_id, schema per tenant, or database per tenant), Stripe subscription management with prorations and webhooks, and usage-based billing. The tenant isolation patterns are especially useful, including Prisma middleware for automatic filtering and PostgreSQL row-level security examples. It's aimed at the point where you're building something more sophisticated than a simple app but not yet at hyperscale. The feature flags and entitlement checking code helps you gate features by plan tier. If you're implementing billing or trying to prevent data leaks between tenants, this gives you the patterns that actually matter in production.

skills.sh installs
363
GitHub stars
26
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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);
});

Sponsors

Details

Repository
github.com/miles990/claude-software-skills
Category
Code Review & Quality
First seen
Jun 3, 2026

More from miles990/claude-software-skills

All 8
1github avatarlinkedin-post-formattergithub/awesome-copilotFormat and draft compelling LinkedIn posts using Unicode bold/italic styling, visual separators, structured sections, and engagement-optimized patterns. USE FOR361skills.sh installs
2bria-ai avatarimage-utilsbria-ai/bria-skillClassic image manipulation with Python Pillow - resize, crop, composite, format conversion, watermarks, brightness/contrast adjustments, and web optimization. U360skills.sh installs
3levnikolaevich avatarln-1000-pipeline-orchestratorlevnikolaevich/claude-code-skillsDrives a Story through full pipeline (tasks, validation, execution, quality). Use when executing a Story end-to-end from kanban board.360skills.sh installs
4levnikolaevich avatarln-723-seed-data-generatorlevnikolaevich/claude-code-skillsGenerates seed data from ORM schemas or entity definitions to any target format. Use when populating databases for development.360skills.sh installs
5pedronauck avatarvercel-react-best-practicespedronauck/skillsReact and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js c360skills.sh installs
6davila7 avatarplan-writingdavila7/claude-code-templatesStructured task planning with clear breakdowns, dependencies, and verification criteria. Use when implementing features, refactoring, or any multi-step work.358skills.sh installs