Authentication setup

From akillness/jeo-skills · View interactive version

Authentication setup is an AI agent skill from the GitHub repository akillness/jeo-skills. Design or refactor product authentication setup for web apps and APIs. Use when choosing hosted/framework-native/platform-native/enterprise-add-on/self-hosted auth, sessions vs JWTs, OAuth/social login, passkeys, org/member models, callback/cookie environment setup, or SSO/SCIM rollout boundaries.

How to use this skill

Skill file

Authentication Setup

Use this skill when the real job is choosing and structuring product authentication for a real app, not dumping JWT snippets or pretending authentication, authorization, security hardening, and docs are all the same task.

authentication-setup owns the setup layer for:

Read these support docs before choosing the lane or handoff:

When to use this skill

When not to use this skill

Instructions

Step 1: Classify the auth job before naming vendors

Normalize the request first.

auth_setup_profile:
  app_type: saas | internal-tool | marketplace | consumer-app | api-only | mixed | unknown
  auth_lane: hosted | framework-native | platform-native | enterprise-add-on | self-hosted | unknown
  runtimes: browser | server | edge | mobile | api | mixed
  login_methods: password | magic-link | social-oauth | passkeys | sso | mixed | unknown
  identity_scope: single-user | teams-orgs | b2b-enterprise | mixed | unknown
  session_model: server-session | stateless-jwt | hybrid | unknown
  data_ownership: vendor-owned | app-owned | hybrid | unknown
  rollout_stage: greenfield | mvp | scale-up | migration | enterprise-expansion

Ask or infer:

  1. What frameworks, runtimes, and deployment surfaces already exist?
  2. Is the team optimizing for fastest safe launch, deeper control, enterprise support, or self-hosting?
  3. Does the app only need sign-in, or also orgs, invites, roles, admin access, and customer SSO?
  4. Which auth/data pieces are already fixed by the current stack?

Step 2: Choose the smallest credible auth lane

Use auth-decision-matrix.md instead of rebuilding the landscape from memory.

Default lane chooser:

Rules:

  1. Recommend one primary lane and at most one fallback.
  2. If the backend platform is already fixed, evaluate platform-native first.
  3. If enterprise identity is mentioned, branch there explicitly instead of flattening it into consumer login.
  4. If migration or cutover risk matters, pull in enterprise-and-migration-notes.md.

Step 3: Draw the provider/app ownership boundary

Before implementation, state who owns what.

Minimum boundary packet:

Use boundary-checklist.md to keep the skill from drifting into neighboring lanes.

Step 4: Choose the session and login model deliberately

Use session-and-deployment-notes.md for the detailed heuristics.

Quick defaults:

Always record:

Step 5: Model app-owned auth data

Even hosted auth rarely removes the need for local tables.

Usually define at least:

Record:

If the request slides into broader schema design, route deeper modeling to database-schema-design.

Step 6: Branch enterprise or migration work explicitly

If the request includes SSO, SCIM, domain verification, existing-user linking, provider migration, or self-hosted cutover risk, use enterprise-and-migration-notes.md.

Name these items directly:

Step 7: Produce an auth setup packet

The output should help the next implementation step succeed.

Preferred packet:

  1. chosen auth lane and why
  2. primary stack recommendation plus fallback
  3. provider/app ownership boundary
  4. session + login model
  5. app-owned data model outline
  6. environment checklist
  7. adjacent route-outs
  8. open risks or migration notes

Output format

Use this structure unless the user asks for another format:

# Authentication Setup Plan

## Auth lane
- chosen lane
- why it fits

## Recommended stack
- primary option
- fallback option
- tradeoffs

## Ownership boundary
- provider owns
- app owns
- shared edge / sync points

## Session + login model
- sessions vs JWT vs hybrid
- chosen login methods
- callback/cookie/runtime notes

## App-owned data model
- users/profiles
- orgs/memberships/roles
- sync strategy

## Environment + rollout checklist
- local
- preview/staging
- production
- migration notes

## Route-outs
- adjacent skills and why

Examples

Example 1: Next.js SaaS with product auth

Input:

Set up auth for a Next.js SaaS app with email login, Google OAuth, org roles, and an admin panel.

Expected handling:

Example 2: Supabase-first app

Input:

We already use Supabase. Decide what auth should live in Supabase vs our app DB, and how roles should work.

Expected handling:

Example 3: Enterprise expansion or migration

Input:

We already have login. Now add enterprise SSO and SCIM for B2B customers without rewriting our whole auth stack.

Expected handling:

Best practices

  1. Start with the auth lane and ownership boundary, not code snippets.
  2. Keep authentication setup separate from deeper authorization policy and general security hardening.
  3. Assume most products still need app-owned user/org/membership tables even with hosted auth.
  4. Treat enterprise SSO/SCIM and migrations as a distinct branch once B2B or cutover pressure appears.
  5. Record environment-specific callback, cookie, and preview-deployment behavior early.
  6. Prefer one clear primary recommendation with a fallback, not a giant vendor list.
  7. Route adjacent work explicitly so authentication-setup stays reusable instead of becoming another backend catch-all.

References

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.