writing-skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
saas-scaffolderBuild a SaaS application or vertical slice from a validated brief, covering authentication, tenancy, persistence, billing, deployment, and acceptance checks.
Independent GitHub snapshot · Automated classification · Original documentation governs
Build one deployable vertical slice. Do not generate a large starter kit whose authentication, billing, and data model have never worked together.
Require:
If the product brief is still ambiguous, refine it before scaffolding.
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.
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.
Implement the smallest slice that proves:
Do not claim “production-ready” until this slice works end to end.
Never infer authorization from a client-supplied role or tenant identifier.
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.
Separate:
Treat webhooks as untrusted, duplicated, delayed, and out of order:
Do not gate features only from client-visible price or plan names.
Use a job system only when work outlives the request or requires retry. Define:
Add structured signals for:
Exclude secrets, raw payment data, and sensitive user content from logs.
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.
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.
Return:
Avoid placeholder integrations that compile but cannot complete the user workflow.