Skip to content
Back to skills

Saas Defaults

ASecurity

Production defaults for building web apps, SaaS products, dashboards and admin panels — the hundreds of small details users expect but nobody asks for, such as password show/hide and strength, loading/empty/error states, double-submit protection, unsaved-changes warnings, undo, safe API errors, tenant isolation, audit logs, failed-payment flows and transactional emails. Use this skill whenever you build, extend or review any login, sign-up, guest mode, account page, form, comments, table, lis...

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 25, 2026
ai-agentsgoshellreactnextjsnodeapidatabasefrontendbackendsecurity

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 16 files and shows the line behind each finding

Scanned November 25, 2026

npx -y skills add Digitanomics/saas-defaults --skill saas-defaults --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Saas Defaults?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Saas Defaults
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/digitanomics-saas-defaults/badge)](https://www.skillsdirectory.com/skills/digitanomics-saas-defaults)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: saas-defaults
description: Production defaults for building web apps, SaaS products, dashboards and admin panels — the hundreds of small details users expect but nobody asks for, such as password show/hide and strength, loading/empty/error states, double-submit protection, unsaved-changes warnings, undo, safe API errors, tenant isolation, audit logs, failed-payment flows and transactional emails. Use this skill whenever you build, extend or review any login, sign-up, guest mode, account page, form, comments, table, list, search, filter, CSV import/export, file upload, dashboard, settings page, custom domain, dark mode, notification, billing, checkout or pricing flow, referrals, Stripe webhook, team, invite or role, admin panel, onboarding, AI chat or assistant, AI field rewrite, AI images, AI usage limit, MCP server, streamed response, API endpoint, database model, marketing page, public roadmap or app email — even when the user asks only for the feature and never mentions UX, polish, edge cases, security or best practices.
license: CC-BY-4.0 for the rule text and MIT for the code. See LICENSE and LICENSE-CODE.
metadata:
  version: "1.4.4"
---

# saas-defaults

This skill makes features complete by default: every state, error path, backend
safeguard and email. Rules are cards with an ID (`AUTH-SIGNUP-12`), a level
(MUST / SHOULD / MAY), `Applies:` tags and a testable `Check:`.
There are 11,689 rules in 21 folders. This file sends you to the few cards a task
needs. More detail: `meta/router-details.md`.

## How to use this skill

Follow these five steps for every feature you build or change.

### Step 1 — Read the project profile

Look for `.claude/project-profile.md` (or `PROJECT-PROFILE.md` at the repo root). It lists
the stack, the **commands** (type check, lint, tests, build), the product type and the
**active tags** (`b2b`, `teams`, `billing`…).

- If it exists: apply only rules whose `Applies:` tags match. Respect its Overrides table.
- **The feature's own tag.** When the task builds what a tag describes (API keys or an MCP
  server: `public-api`; paid plans: `billing`; outgoing webhooks: `webhooks`; uploads:
  `file-uploads`; AI features: `ai-features`), that tag is active for this task even when
  the profile lacks it. Say so and offer to add it to the profile.
- If it is missing: infer the stack and product type from the code, list your
  assumptions, and continue. Offer to create the profile from
  `templates/project-profile.md`, then to paste `templates/AGENTS-snippet.md` into the
  project's `AGENTS.md` or `CLAUDE.md` (later agents then use this skill unasked).
- **No profile and no code** (a new project): use only the tags the task clearly implies
  (`billing` for paid plans). Assume `b2b` when it talks about workspaces, teams or
  companies, and say so.
- **Project rules and starter kits.** Read the project's own agent rules (`AGENTS.md`,
  `CLAUDE.md`, a rules folder) first and follow their structure, names, libraries and
  commands; the cards fill the gaps. A project rule counts like the user's request: when
  it conflicts with a card, follow it and name the card you set aside.
- **Tags.** `always` applies everywhere; `teams, billing` means both; `b2b or enterprise`
  means either; `or` splits first. Tag list: `meta/rule-format.md`, section 4.

### Step 2 — Find the recipe and the cards

Most tasks are a **feature**. The routing table below names its folder in `features/`;
the folder's `_index.md` lists its recipes with a "Read when" line. Open only the recipe
you need. If none fits (a one-off screen, an internal tool page), go straight to the
foundation files of the layers you touch.

**Find cards with the search script** when you can run a shell:
`node <skill folder>/scripts/find.mjs "<words>"` prints the 20 best cards (ID, level,
title, tags, file). Add `--tags <profile tags>` and `--level MUST` to narrow it.
`--card <ID>` prints one full card. `--recipe <folder/name> --core` prints a recipe's Parts,
Card index and Core list. Without a shell, read the file's Card index and search for
`### <ID> `.

**Several recipes.** A task often needs two or three (pricing page with checkout:
`website/pricing-page.md`, `billing/checkout.md`, `billing/billing-webhooks.md`). The
recipe closest to the request is the main one: follow its Flow. Use the others only for
the steps they own. From each, read its Contents (Card index and Core list) and the Flow
steps it owns; build its Core list cards and MUST cards for those steps in pass 1. Read
its Also read only when a card you build names a rule ID there. Run each recipe's Finish
check for the parts you built.

**Build tier.** The recipe header names its `Build tier`: `standard` or `deep` with its
reasons; a part named there (`deep for <part>: …`) is deep when you build it. At the start
of a build, read sections 1 to 3 of `meta/models.md` (once per session) and give its one
model and effort line. A deep build follows its section 4.

### Step 3 — Work through the recipe

**How to read a recipe.** Recipes are long (often over 1,000 lines): never read one in one go.
Read the Contents first: its **Card index** (one line per card with level and tags;
"heavy" at the end for a card that adds a new module or service) and its **Core list**
(the cards that make the feature work and safe). Then read the **Flow** (the steps in
order: build in this order). Then open cards by ID (`--card <ID>`, or search for
`### <ID> ` and read until the next card). Pass over cards whose tags are not active.
Handle each Edge case; the Finish check is Step 5.

**How to use "Also read".** **Do not open every file.** Read the entries in order, and
skip an "Only if …" heading whose part you do not build or whose condition does not hold.
For a "Must open" entry, read the file's Card index and the cards the entry names. In that
file, open another card only when it is a MUST whose title names something you build;
skip its other SHOULD and MAY cards unless a Flow step you build names them. Open any
other entry (also one under a heading you skipped) only when a card you build names one
of its rule IDs and the card's own text is not enough; then read only those cards.

**Fields, controls and endpoints.** For each kind of field, control or endpoint you build
that the recipe's cards do not cover (a date, a select, a JSON endpoint), read the Card
index of the foundation file that owns it and build its MUST cards whose title fits.

**Scope.** Build what the user asked for, not the whole recipe. Its **Parts** table (in the
Contents) gives each part's Flow steps and cards: build `core`, and a part when its Build
cell is true (a tag, a product fact) or the request asks. With no table, or for
less than a part (a users table and suspend, but not deletion), follow the Flow steps for
what you build. Rules for parts you did not build are **out of scope**: do not build
them; list them in one line in the report (not as "skipped"). A MUST rule inside your part is never out of
scope (one that needs a whole other feature: Step 4). When the request presupposes data
the code lacks (a workspace and its members), build the smallest model that makes it
true, give the new relation at every creation point (DATA-MIG-84), and list the missing
management screens under "Follow-up".

**Hosted provider pages** (Stripe Checkout, a hosted sign-in page): the provider covers
that page. Check the provider settings that control it (tax collection, terms consent,
receipts) and name them in the report. Before and after the page stays yours.

### Step 4 — Build

**Two passes, one task.** **Pass 1 — the core:** the recipe's Core list cards for the part
you build, in Flow order (with no recipe: the MUST cards you build); then run the
project's commands (Step 5) and fix until they pass. **Pass 2 — the rest:** the other
in-scope rules, by level as below; then run Step 5 in full.

- **MUST** rules that apply: build them. Missing one is a bug.
- **A risky feature** (money, sign-in, tenant data, uploads): write its threat list first
  (SEC-AUTHZ-69).
- **SHOULD**: build the recipe's SHOULD cards for your part (its Finish check lists
  them) and the foundation SHOULD cards a Flow step you built names, unless the profile
  or task gives a clear reason; name any you skip and why. Another foundation SHOULD
  card: only when small (a few lines in code you already touch); do not list the others.
- **MAY**: build when it fits the product; mention your choice.
- **Heavy cards:** a SHOULD or MAY card whose Card index line ends in "heavy" adds a new
  module, store, service or channel (its `Heavy:` line says which). Offer it under
  "Offered, not built", unless the user asked for it or a Core list names it. Build it
  when a MUST or Core card in this build already adds that part. A card that only works
  with an offered heavy card (uses its table, job or service) is offered with it.
- **Build no new subsystem.** Build what the request and the recipe's Core list need. Do not
  add a new subsystem (a content store, history tables, an admin screen, an API route, a
  scheduled job or a cache layer) unless the user asked for it, a Core list card needs it, or a
  MUST card cannot be met without it. Offer it under "Offered, not built" instead, with what it
  would add. Meet a card with the plainest thing that works: a typed file in the code before a
  new table, the framework's own cache before a new one.
- **Undecided business terms.** Never publish a business term the owner has not decided
  (refund or notice period, payment provider, tax handling, reply times) as fact. Leave it out
  or mark it `Owner to decide: <term>`, and list it under "❓ Needs a decision" (CNT-VOICE-73).
- **A MUST that needs a whole other feature** (an audit log page): build the smallest
  safe version inside this feature (write the audit row to a table), not the other
  feature, and add a "Follow-up" line naming the card and the feature it needs.
- **A SHOULD that needs a whole other feature** (notification settings): do not build
  it, unless the card says how to build a small version (CRUD-FORM-45 when the app
  already sends mail). List it under "Offered, not built" with the feature it needs.
- **Stack notes.** For code, look up the rule ID in the stack notes: the note says how
  to build it in this stack; the card says what must be true. When they disagree, the
  card wins; mention the note. **When the stack cannot meet a card,** build the closest
  safe version the note describes, and name the card, the gap and the bigger build under
  "Offered, not built".
- **Deliver a complete change.** Every file the new code imports exists in the repository
  (search before you import) or is part of your change. A schema change comes with its
  migration. Never report as built what exists only in your plan.
- **Every new page has a way in:** a link or button on an existing screen (the row name
  opens the detail page). That one link is in scope even when list changes are not.
- **Use what the project already has.** When a rule calls for a service the project lacks
  (a rate-limit store, a queue), build a working default on the existing stack (a table
  in your database) and offer the service with its setup steps. Never switch on a
  project-wide setting (CAPTCHA, an auth hook, a database default, a global middleware)
  unless the same change updates every flow it touches. Same for a new required relation
  or column: update every flow that creates the row (DATA-MIG-84); Step 5 runs a fresh
  sign-up. Name every new environment variable in the report; code
  that needs one fails loudly when it is missing (BE-CONF-22).
- No fake functionality: no dead buttons, placeholder data or "TODO" handlers shown as
  finished.
- A rule and the user's request conflict: follow the user and name the rule. When the
  request sets aside a MUST card of `SEC-` or `AUTH-`, keep the parts it does not
  touch and add a "❓ Needs a decision" line naming the risk in one sentence.
- **When two cards disagree,** use this order: the safer behaviour wins; then the owner
  card of the topic (the card that defines the value, code or list) wins over cards that
  repeat it; then the more recently changed owner card wins. Name both cards in the
  report (`meta/rule-format.md` section 8).
- `BE-ERR-…` rules (status codes, error bodies) apply to API routes and route handlers.
  For a form handled by a server function (a Next.js Server Action), return the same
  error shape as data (`code`, `detail`, `errors` per field) and show it in the form.

### Step 5 — Finish check

1. **Run the project's commands** (the profile's Commands table: type check, lint, tests,
   build; end-to-end tests when listed). A failing command blocks "done": fix it, or
   report the feature as not done. With no table, find the commands (`scripts` in
   `package.json`), run them, and suggest adding the table.
2. **Walk it in a browser** when a browser tool is available: start the app (the Dev
   server command) and walk the Flow. Screenshot each state: loading, empty, error,
   content, and no-access where roles exist. Console: no errors, or each one named with a
   reason. After a new required relation or column, start with a new sign-up. With no
   browser tool, list the walk under "Not verified".
3. **Run the detector:** `node <skill folder>/scripts/run-detect.mjs <project folder>`
   (the folder of this `SKILL.md`; Node 18+). A match is a suspect, not a failure: in
   the files you changed, fix each or say why it is fine; give the count of the others.
   With no Node, list it under "Not verified".
4. **Ship the security tests** of SEC-AUTHZ-65 for each part of the security set the
   feature touches: another user, another tenant, a denied permission, webhook
   signatures, replays, input limits. A touched part with no test means not done. If the
   project has axe, Lighthouse CI, Spectral or ZAP (or the user agrees), run the matching
   template in `templates/checks/`; otherwise list it under "Offered, not built".
5. **Run `checks/feature-done.md`**: the recipe's Finish check (skip a `heavy` line you
   offered and did not build), the checks of the foundation rule IDs you applied, and
   the universal checks. If `checks/foundations/` is missing, first run
   `node <skill folder>/scripts/build-checks.mjs`. Fix what fails (still failing:
   `meta/models.md` section 5), then report:

```
Feature: <name>
Rules applied: <n> (MUST <n>, SHOULD <n>, MAY <n>)
🧠 Model: tier <tier>[ (<reason>)] · recommended <model · effort> · ran on <model>[ · <effort>] · step-ups <none or IDs>
▶️ Commands run: <type check ✓, lint ✓, tests ✓, build ✓>
🖥️ Browser walk: <states seen>, console <clean, or each error and why>
🕵️ Detector: <n> suspects — <ID> · <file:line> — fixed, or fine because <reason>
🧪 Security tests: <parts touched> — <test name per part>, or "no part touched"
✅ Checked: <n>
⚠️ Skipped with reason: <ID> — <reason>
🔧 Fixed during check: <ID> — <what>
🔎 Not verified (needs a person or a running app): <what>
🧩 Offered, not built: <ID, service or bigger build> — <why>, <setup steps>
🔜 Follow-up: <ID> — <smallest safe version built>, <feature it still needs>
❓ Needs a decision: <ID> — <question>
```

Count only the cards you read and applied. Never guess your model or effort
(`meta/models.md` section 6).
Keep it short: list IDs only for skipped, fixed and open items, and add "Out of scope:
<topics>" when you built part of a recipe.
"Not verified" never counts as passed; leave out empty lines. To **review** a feature, use
the same recipe and Finish check, and report the failures with rule IDs.

## Routing table — features

| When the task involves… | Recipe folder |
|---|---|
| Login, sign-up, verify email, forgot/reset password, magic link, social login, 2FA, passkeys, SSO (SAML/OIDC), session timeout, logout, guest mode (use first, sign up later) | `features/auth/` |
| Profile, change email, change password, sessions and devices, connected accounts, export my data, delete account | `features/account/` |
| Layout and sidebar, header and user menu (including the theme or dark mode switch), workspace switcher, breadcrumbs and page headers, command palette, global search, notifications center, keyboard shortcuts, banners and announcements, error and status pages (404, 403, 500, maintenance) | `features/app-shell/` |
| Lists and tables, search / filter / sort, saved views, bulk actions, detail pages, dashboards, charts, import (CSV, Excel), export (CSV) | `features/data-views/` |
| Create and edit forms, multi-step forms (wizards), autosave and drafts, unsaved changes, inline editing, concurrent edits, duplicate and templates, delete / archive / restore, file and media upload, comments and @mentions, AI that fills a form, rewrites a field or changes records (proposal, accept, undo) | `features/crud/` |
| Organizations and workspaces, invitations, members, roles and permissions, ownership transfer, directory sync (SCIM) | `features/teams/` |
| Settings layout, organization settings, notification preferences, appearance (theme, dark mode) and language, danger zone (delete or transfer an organization), custom domains | `features/settings/` |
| Plans and entitlements, checkout, trials, plan changes (upgrade, downgrade), cancellation and reactivation, failed payments (dunning), invoices and receipts, coupons and discounts, taxes and billing details, usage limits and metering, billing webhooks, referral programs | `features/billing/` |
| First run, setup checklist, sample data, product tours and hints, activation emails | `features/onboarding/` |
| API keys, API docs and sandbox, rate-limit feedback (429, headers), outgoing webhooks, audit log, integrations and OAuth apps, an MCP server for outside AI agents | `features/developer/` |
| Super-admin: users management (suspend, ban), impersonation, feature flags, moderation, user-content reports, system health, support tools, admin safety and audit | `features/admin/` |
| Landing page, pricing page, legal pages, cookie consent, SEO and metadata, blog and changelog, contact and support, status page, waitlist, public roadmap and voting | `features/website/` |
| AI chat or assistant, AI answers (stop, regenerate, copy, feedback), AI usage limits and cost, AI-generated media (images, audio, video), conversation history and memory, workspace AI settings, AI provider and training opt-in, tools the assistant may call (approvals, multi-step runs) | `features/ai-assistant/` |

**AI tasks span folders:**

- AI fills a form, rewrites a field or changes records: `features/crud/ai-changes.md`,
  plus `features/ai-assistant/usage-and-controls.md` (cost limit, limit reached, AI off).
- AI usage limits: `features/ai-assistant/usage-and-controls.md`; add
  `features/billing/usage-limits-and-metering.md` only when plans, credits or invoices
  count AI use.
- An MCP server for outside AI agents: `features/developer/oauth-provider-and-mcp.md`
  plus `foundations/security/ai-and-agents.md` (SEC-AGENT-13 to SEC-AGENT-20,
  which need `ai-features` and `public-api`; SEC-AGENT-01 to SEC-AGENT-06 for its tools).
- A result or job progress streamed with no chat (a report, an export): no recipe. Open
  `foundations/backend/streaming.md` and `foundations/backend/background-jobs.md`
  (BE-JOB-01, BE-JOB-17, BE-JOB-58; BE-JOB-02 if a model writes it). Apply the stream
  cards tagged `realtime` even without that tag. When a model writes it, the
  `ai-features` cards and `features/ai-assistant/usage-and-controls.md` apply too.

## Foundations

Open a foundation file directly when no recipe fits or for one component or endpoint:
read the Card index at the end of its Contents, then the cards a recipe or Flow step
names and the MUST cards whose title names something you build. Folders: `components/`
(controls), `frontend/` (states, forms, saving, navigation, accessibility), `content/`
(copy), `ui/` (layout, type, colour, motion), `backend/` (API, errors, jobs, streaming,
slow or failing outside services), `data/` (also connections and transactions), `security/`
(also packages and CI), `emails/` (also replies by email).

## Stack profiles

Rules are stack-agnostic. Code lives in `stacks/<profile>/`: one notes file per rule
area, one `## <RULE-ID>` section per rule that needs special code (no section: none
needed). Profiles: `next-supabase` (Next.js, Supabase, Stripe;
the default), `next-drizzle` (Next.js, Drizzle, Better Auth; you own every backend
piece), `api-separate` (React SPA plus a separate API; other clients share it).

**Inheritance.** `next-drizzle` and `api-separate` list only what differs from
`next-supabase`. To build a rule in those profiles:

1. Open the profile's own notes file for the rule's area. A `## <RULE-ID>` section there
   replaces the next-supabase one.
2. If there is none, use `stacks/next-supabase/<same file>.md` as written.
3. If that note uses a Supabase service, build the same behaviour with the
   "Equivalents" table in the profile's `_index.md`, and keep the rule's `Check:`.

A default install has only `next-supabase`. For a missing profile, use the folder
the project profile names, or copy `extras/stacks/<profile>/` of the skill's
repository into `stacks/`.

A notes file is named after its folder (`backend.md` for BE, `shell.md` for SHELL; list
in `meta/router-details.md`). Components (CMP) have two: `components.md` for form controls
(PWD, CTRL, FIELD, BTN, INPUT, OTP, SELECT, CHOICE, DATE, FILE, SLIDER, EDIT) and
`components-display.md` for the rest. Content (CNT) needs none. Before you write code, read the
profile's `_index.md` once: versions and the "Rule-relevant differences" that trip AI
agents up. Test a note marked "(unverified: test it)". Another stack: the cards,
`stacks/_template.md` and the stack's own docs.

Before a launch: `checks/pre-launch.md`. All checks and the folder map:
`meta/router-details.md`.

Files in this skill

  • CREDITS.md41.1 KB
  • HOW-TO-USE.md26.2 KB
  • LICENSE18.2 KB
  • LICENSE-CODE1 KB
  • NOTICE.md6.6 KB
  • README.md15.7 KB
  • ROADMAP.md8.4 KB
  • SKILL.md21.5 KB
  • checks/detect.json69.9 KB
  • checks/feature-done.md16.2 KB
  • checks/pre-launch.md34.4 KB
  • features/account/_index.md1.5 KB
  • features/account/change-password.md72.6 KB
  • features/account/connected-accounts.md85.2 KB
  • features/account/export-my-data.md99 KB
  • features/account/profile.md89 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.