agentleFS
chatquillchatquill/claude-code-websites/.claude/skills/add-auth/SKILL.md

add-auth

Skill1 starsChanged 24 days agoMITView on GitHub

Adds authentication and authorisation (sessions, OAuth, magic links, passkeys, MFA, roles, organisations) using the provider in project.yaml stack.auth (Clerk, Auth.js, Better Auth, Supabase Auth, Firebase Auth or custom sessions). Use when the product needs login, signup, protected routes, roles or teams.

  • Reads credentials

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If stack.auth is null, ask: "Which auth approach?" with options fitted to the stack, e.g.

    line 26
  2. Distinctive:

    Ask: "Create stories for this (recommended), or implement directly now?"

    line 54

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Add Auth

Integration playbook for authentication and authorisation. Prefers a maintained provider over hand-rolled auth. Uses test/development instances only; never touches production auth settings.

Inputs

  • project.yaml → stack.auth, stack.frontend, stack.backend, privacy.regions
  • PRD and specs: who signs up, roles, teams/orgs, SSO needs, account deletion
  • .claude/docs/stack-matrix.md for the specialist pairing

Phases

Phase 1: Provider

If stack.auth is null, ask: "Which auth approach?" with options fitted to the stack, e.g. Clerk (hosted, orgs built in), Auth.js / Better Auth (self-hosted, in your DB), Supabase Auth / Firebase Auth (when on that BaaS), Framework-native (Laravel Fortify/Sanctum, Django auth, Rails authentication generator). Give cost, lock-in and data-residency trade-offs. On a choice: draft an ADR (/architecture-decision format, template adr), and after approval run bash .claude/scripts/config-set.sh stack.auth=<value>.

Phase 2: Requirements

Confirm: sign-in methods (email+password, magic link, OAuth providers, passkeys), MFA, roles and permissions, organisations/teams, invitations, account deletion, session length. Spawn security-lead for a short threat model (template threat-model): enumeration, brute force, session fixation, CSRF, OAuth redirect abuse, privilege escalation, tenant isolation. Spawn privacy-compliance-specialist if privacy.regions is set.

Phase 3: Plan the work

auth-specialist with the stack specialists proposes:

  • provider setup and env vars (placeholders added to .env.example, never real values)
  • route protection (middleware) plus a server-side requireUser() / policy helper used by every handler
  • the authorisation model: a single can(user, action, resource) layer, tenant scoping
  • user record sync / webhooks (verified signatures)
  • UI: sign-in, sign-up, reset, account settings, org switcher (design-system components)
  • tests: per-role integration tests, Playwright sign-up/sign-in journey

Ask: "Create stories for this (recommended), or implement directly now?"

Phase 4: Do it

  • Stories → /create-stories format with ACs for each method, role and failure case.
  • Direct → run /dev-story style TDD with auth-specialist, asking before every write.

Never

Store passwords or tokens in logs or localStorage; roll custom crypto; rely on hidden UI for authorisation; use production keys.

Next step

/security-audit auth once implemented.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.