Auth logo

Auth

Community
MartinOlivero
auth

This skill should be used when adding authentication or authorization to an app or SaaS — login, signup, sessions, tokens, roles, permissions, multi-tenant access, SSO, or social login. Trigger phrases include "add login", "add auth", "sign in with Google", "protect this route", "user roles", "admin permissions", "JWT or sessions", "which auth provider", "RBAC", "multi-tenant access", "who can see what", "magic link", "SSO". It picks the right provider and pattern instead of rolling auth from scratch.

Overview

PublisherMartinOlivero
Repositorysaas-builder
Skill nameauth
Stars
4
Forks
2
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by MartinOlivero on GitHub. Read the source before you install it.

Installation

Install the Auth AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/MartinOlivero/saas-builder/tree/main/skills/auth
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/MartinOlivero/saas-builder.git /tmp/saas-builder
mkdir -p .claude/skills
cp -r /tmp/saas-builder/skills/auth .claude/skills/auth
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Auth in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Auth on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Auth is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Auth

This skill makes the two decisions every SaaS gets wrong: which auth provider and how to model permissions. It picks a vetted provider over hand-rolled auth, and a permission model that fits the product.

Analogy: auth is the lock and the guest list for your building. You don't forge your own lock (you'd leave it pickable) — you buy a good one and decide who gets which key.

The one rule

Don't roll your own auth. Password hashing, session rotation, OAuth flows, and reset tokens are where subtle, catastrophic bugs live. Use a provider or a battle-tested library. (Pairs with the secure-coding skill, which covers the OWASP auth-failure defenses.)

Discovery (max 3 questions, only if unknown)

  1. Is this B2C (individual users) or B2B (organizations/teams with members)?
  2. Do you need enterprise SSO (SAML/OIDC) for buyers — now or soon?
  3. What's the stack/backend — Supabase, plain Vercel + Postgres, or full-stack TypeScript?

Step 1 — Pick the provider (decision tree)

SituationUseWhy
Building with an agent / on InsForgeInsForge AuthAgentic-native — the agent wires auth + RLS through its own skills/MCP; every query scopes to the user in SQL.
Already on SupabaseSupabase AuthFree, RLS-native — every query scopes to the user in SQL. Most-proven ecosystem.
Want the best React DX / drop-in components, not tied to a backendClerkBest components, orgs/teams built in. ~$0.02/MAU after a free tier.
Full-stack TypeScript, want self-hosted controlBetter Auth (~28k⭐)TS-native, framework-agnostic, orgs/RBAC/passkeys/SSO.
Enterprise SSO is a buyer requirementAuth0 / WorkOSSAML/OIDC, directory sync, the enterprise checkboxes.

Default for a fresh React + Vite + Postgres SaaS with no SSO need: InsForge Auth if you're building agent-first, Supabase Auth if on Supabase, or Clerk otherwise. All three scope to the user via RLS — match the auth host to the DB host from the data-modeling skill.

Step 2 — Sessions vs JWT

  • Classic web app → server-side sessions in an httpOnly, Secure, SameSite cookie. Easy revocation, no token-in-JS exposure.
  • Stateless API / mobile / microservices → short-lived JWT access token + refresh token.
  • Never store JWTs in localStorage (XSS-readable). Cookie or in-memory only.
  • Keep authorization out of the JWT body beyond coarse role hints — baked-in roles go stale until expiry and can't be revoked. Check permissions server-side per request.

Step 3 — Model authorization (RBAC by default)

  • Default to RBAC: a small set of roles — owner / admin / member / viewer. Covers most SaaS.
  • Add ABAC/policy rules only when access depends on attributes: resource owner, department, plan tier, time. Example: "edit invoice only if role=manager AND same department."
  • Centralize the check in one middleware/guard or policy layer. Never scatter if (role === 'admin') across handlers — that's how a forgotten check becomes a breach.

Step 4 — Multi-tenant scoping (B2B)

  • Scope every authz check by tenant_id / org_id. A valid user of org A must never read org B.
  • Let Postgres Row-Level Security be the backstop (see the data-modeling skill) so even a missed app-layer check can't leak across tenants.
  • Use OAuth/OIDC via the provider for social + SSO logins — never handle raw third-party password flows yourself.

Delegation & fallback

  • Provider available → wire it (InsForge/Supabase/Clerk/Better Auth) and configure roles/orgs through it. On InsForge, its insforge and insforge-integrations skills wire auth — including external providers (Clerk/Auth0/WorkOS) into JWT-based RLS — so the agent sets it up end to end.
  • No provider chosen / offline → fall back to a well-known library (Better Auth or Lucia), httpOnly cookie sessions, bcrypt/argon2 password hashing, and the RBAC pattern above. Never block on a missing provider.

Step 5 — Verify the guard from outside

Auth that has not been attacked with curl is assumed, not known. Before calling it done:

  • Request every protected route with no session and look at the response body size, not just the status. A redirect can carry the fully rendered page.
  • Put the guard where it runs before rendering (middleware), not in a layout — and confirm the middleware file is in the location your framework actually loads.
  • The server validates the session token with the provider. A readable cookie is not identity.
  • Log out, then replay the old refresh token. If it still mints access tokens, logout is cosmetic.
  • Test in Safari when the backend is on a different domain: its refresh cookie is a third-party cookie.
  • OAuth callback is a public route that exchanges the code; redirect parameters accept only paths starting with a single /.

Field notes

references/field-notes.md holds 15 auth failures from production apps. The three that cost the most:

  1. A 307 redirect to login that carried 441 KB of customer data in its body.
  2. A middleware file in the wrong directory that never executed.
  3. Blank screens with no error: queries running as anonymous and RLS returning empty lists.

Output

Deliver: the provider recommendation with a one-line reason, the session/token decision, a concrete role model for this product, the protected-route guard wired in, and the multi-tenant scoping rule if B2B.

Reference

InsForge Auth (~5k⭐, agentic-native), Better Auth (~28k⭐), Auth.js/next-auth (~28k⭐), Clerk, Supabase Auth (part of supabase ~104k⭐).

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Auth AI skill do?

This skill should be used when adding authentication or authorization to an app or SaaS — login, signup, sessions, tokens, roles, permissions, multi-tenant access, SSO, or social login. Trigger phrases include "add login", "add auth", "sign in with Google", "protect this route", "user roles", "admin permissions", "JWT or sessions", "which auth provider", "RBAC", "multi-tenant access", "who can see what", "magic link", "SSO". It picks the right provider and pattern instead of rolling auth from scratch.

Why use Auth on TypingMind?

Because you install it once and use it with any model. Auth is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Auth in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/MartinOlivero/saas-builder/tree/main/skills/auth. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Auth?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Auth?

As many as you like. As long as a model supports skills, you can use Auth with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Auth AI skill free?

Yes. It is published on GitHub by MartinOlivero under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇