TidyFactor

tidyfactor-next

"Production multi-tenant SaaS engine on Next.js 16, React 19, TypeScript strict, and Supabase with Contextual Decision Layer (CDL). Features locked tenant isolation (tenant_id + Postgres RLS) and pluggable query layer. Trigger on commands 'brief', 'init', 'tenant', 'rls', 'auth', 'data', 'storage', 'api', 'app', 'test', 'observe', 'deploy', or requests to build a multi-tenant SaaS."

TidyFactor 3 Updated 1w ago

Resources

23
GitHub

Install

npx skillscat add tidyfactor/next

Install via the SkillsCat registry.

About this skill

TidyFactor Next.js is a command-dispatched skill that scaffolds and configures production multi-tenant SaaS applications on Next.js 16, React 19, and Supabase. It provides structured workflows for tenant isolation, Postgres RLS policy authoring, authentication, schema design, storage, and API setup, enforcing a Contextual Decision Layer. Developers should use it when building or auditing multi-tenant SaaS systems that require strict tenant scoping and consistent architectural patterns.

SKILL.md

TidyFactor Next.js

A command dispatcher for production multi-tenant SaaS on Next.js 16 and Supabase. This router declares commands and workflows without performing execution directly.

Commands

User intent Command What it loads
Strategic SaaS Discovery & Baseline Architecture references/commands/brief.md workflows/brief.md + memory/decision-points.md + memory/quality-bar.md
Scaffold a new multi-tenant project references/commands/init.md workflows/init.md + memory/spec.md
Tenant resolution, context, lifecycle references/commands/tenant.md workflows/tenant.md + memory/spec.md
RLS policy authoring, coverage audit, leak diagnosis references/commands/rls.md workflows/rls.md + memory/rls-patterns.md
Auth, RBAC/ABAC references/commands/auth.md workflows/auth.md + memory/auth-patterns.md
Schema, migrations, transactions, constraints references/commands/data.md workflows/data.md + memory/decision-points.md
Buckets, signed URLs, tenant-scoped storage paths references/commands/storage.md workflows/storage.md + memory/cache-storage-rules.md
Route handlers, server actions, API contracts references/commands/api.md workflows/api.md + memory/client-server-boundaries.md + memory/react-perf-rules.md
App Router / React 19 patterns, RSC boundaries references/commands/app.md workflows/app.md + memory/client-server-boundaries.md + memory/react-perf-rules.md
Unit/integration/RLS/E2E/security tests references/commands/test.md workflows/test.md + memory/quality-bar.md
Logging, tracing, audit logs, health checks references/commands/observe.md workflows/observe.md + memory/quality-bar.md
CI/CD, environments, secrets, rollback, backups references/commands/deploy.md workflows/deploy.md + memory/spec.md
Dev & Runtime performance: waterfalls, bundles, RAM, HMR references/commands/perf.md workflows/audit-dev-perf.md + memory/perf-optimization-rules.md + memory/react-perf-rules.md
Failure modes, retries, DR, recovery runbooks references/commands/incident.md workflows/incident.md + memory/spec.md
Structural/architecture audit of the whole project references/commands/audit.md workflows/audit.md + memory/quality-bar.md

Read only the command file that matches the request. Do not load all commands simultaneously.

Non-Negotiable Invariants

  1. Contextual Decision Layer (CDL): Resolve project baselines via /brief or .tidyfactor/next-brief.md before emitting code.
  2. Locked Tenant Isolation: Every tenant-owned table MUST include tenant_id uuid NOT NULL REFERENCES tenants(id) ON DELETE CASCADE.
  3. Forced RLS Boundary: Every tenant table MUST have ENABLE ROW LEVEL SECURITY and FORCE ROW LEVEL SECURITY.
  4. Zero Service-Role Leaks: Never expose SUPABASE_SERVICE_ROLE_KEY to client components or public API responses.
  5. 7-Axis Pre-Emit Critique: All generated code must be evaluated with /* Pre-emit critique: P5 H5 E5 S5 R5 V5 D5 */.