Logo di Auth

Auth

Community
MartinOlivero
auth

Questa skill va usata quando si aggiungono autenticazione o autorizzazione a un’app o a un SaaS: accesso, registrazione, sessioni, token, ruoli, autorizzazioni, accesso multi-tenant, SSO o accesso tramite social. Tra le frasi che la attivano: «aggiungi l’accesso», «aggiungi l’autenticazione», «accedi con Google», «proteggi questa route», «ruoli utente», «autorizzazioni admin», «JWT o sessioni», «quale provider di autenticazione», «RBAC», «accesso multi-tenant», «chi può vedere cosa», «magic link», «SSO». Sceglie il provider e il modello più adatti, invece di creare da zero un sistema di autenticazione.

Add to TypingMind

Panoramica

Pubblicato daMartinOlivero
Repositorysaas-builder
Nome della skillauth
Stelle
4
Fork
2
File inclusi
1
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 1

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da MartinOlivero su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Auth in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/MartinOlivero/saas-builder/tree/main/skills/auth
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Auth in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Auth non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Auth non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

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⭐).

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Auth?

Questa skill va usata quando si aggiungono autenticazione o autorizzazione a un’app o a un SaaS: accesso, registrazione, sessioni, token, ruoli, autorizzazioni, accesso multi-tenant, SSO o accesso tramite social. Tra le frasi che la attivano: «aggiungi l’accesso», «aggiungi l’autenticazione», «accedi con Google», «proteggi questa route», «ruoli utente», «autorizzazioni admin», «JWT o sessioni», «quale provider di autenticazione», «RBAC», «accesso multi-tenant», «chi può vedere cosa», «magic link», «SSO». Sceglie il provider e il modello più adatti, invece di creare da zero un sistema di aut...

Perché usare Auth su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Auth è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Auth in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/MartinOlivero/saas-builder/tree/main/skills/auth. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Auth?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Auth?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Auth: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Auth è gratuita?

Sì. È pubblicata su GitHub da MartinOlivero con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇