Saas scaffolder

From seaworld008/Commonly-used-high-value-skills · View interactive version

Saas scaffolder is an AI agent skill from the GitHub repository seaworld008/Commonly-used-high-value-skills. Build a SaaS application or vertical slice from a validated brief, covering authentication, tenancy, persistence, billing, deployment, and acceptance checks.

How to use this skill

Skill file

SaaS Scaffolder

Build one deployable vertical slice. Do not generate a large starter kit whose

authentication, billing, and data model have never worked together.

Preconditions

Require:

If the product brief is still ambiguous, refine it before scaffolding.

Discover the Current Stack

For an existing repository, inspect before choosing dependencies:

rg --files -g 'package.json' -g 'pyproject.toml' -g 'go.mod'
rg --files -g '*lock*' -g 'Dockerfile*' -g '.github/workflows/*'
rg -n "auth|session|tenant|workspace|organization|stripe|billing|migration" .

Preserve the established package manager, framework, ORM, test runner, linting,

component library, and deployment target unless the user explicitly requests a

migration.

For a greenfield project, verify current stable versions and setup commands

against official documentation at implementation time. Do not hard-code

framework major versions or copy authentication middleware from old examples.

Architecture Decisions

Record a short decision table:

| Concern | Decision | Evidence | Revisit trigger |

|---|---|---|---|

| Web/runtime | | official docs / repository | unsupported runtime |

| Authentication | | threat model and provider docs | identity model changes |

| Tenancy | | product contract | shared workspace required |

| Database | | access and consistency needs | scale or residency change |

| Billing | | price and entitlement model | pricing migration |

| Jobs | | latency and retry needs | synchronous path exceeds budget |

| Deployment | | environment constraints | regional/compliance change |

Choose dependencies for the first workflow, not for hypothetical scale.

Workflow: Required Vertical Slice

Implement the smallest slice that proves:

  1. a user can sign in
  2. the user can create or enter the correct tenant
  3. authorization protects tenant-owned data
  4. the primary resource can be created, viewed, and updated
  5. entitlement checks gate the paid action
  6. the workflow emits observable success and failure signals
  7. tests exercise the public boundary
  8. the slice deploys to a non-production environment

Do not claim “production-ready” until this slice works end to end.

Authentication and Sessions

Never infer authorization from a client-supplied role or tenant identifier.

Tenancy and Authorization

Model tenant ownership explicitly:

users
tenants
memberships(user_id, tenant_id, role)
resources(tenant_id, ...)

Every tenant-owned query and mutation must be scoped by trusted server-side

tenant context. Add negative tests proving that one tenant cannot read or

modify another tenant's records.

Use database row-level security only when its policies are tested as a primary

authorization boundary; do not assume enabling RLS makes access secure.

Billing and Entitlements

Separate:

Treat webhooks as untrusted, duplicated, delayed, and out of order:

Do not gate features only from client-visible price or plan names.

Database and Migrations

Background Work

Use a job system only when work outlives the request or requires retry.

Define:

Observability

Add structured signals for:

Exclude secrets, raw payment data, and sensitive user content from logs.

Project Shape

Prefer a small, discoverable layout:

app-or-src/
  routes-or-pages/
  domain/
  data/
  auth/
  billing/
  jobs/
tests/
  unit/
  integration/
  e2e/
docs/
  decisions/

Follow the repository's existing layout when present.

Verification

Run the repository's real checks:

<package-manager> lint
<package-manager> typecheck
<package-manager> test
<package-manager> build

Add end-to-end coverage for:

Use local provider emulators or signed fixtures when available. Never exercise

live billing or production mutations during routine verification.

Delivery Contract

Return:

Avoid placeholder integrations that compile but cannot complete the user

workflow.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.