PlugWiki

Better Auth two-factor authentication skill for Claude Code: TOTP, OTP and backup codes

Helps Claude add two-factor authentication to Better Auth: authenticator apps, OTP codes, backup codes and trusted devices.

Installs
35.7K
on skills.sh
Stars
228
on GitHub
Updated
Oct 2026
last repo commit

This skill makes Claude add Better Auth's twoFactor plugin. Its description covers TOTP authenticator apps, OTP codes by email or SMS, backup codes, trusted devices and 2FA sign-in flows.

Setup has four steps: add twoFactor() with an issuer on the server, add twoFactorClient() in the client, migrate, and check that a twoFactorSecret column exists. It bundles no scripts.

Good for

  • Developers adding 2FA to a Better Auth app
  • Teams supporting authenticator apps or SMS codes
  • Anyone handling backup codes and account recovery

Install two-factor-authentication-best-practices

Claude Code

  1. 1

    Copy this prompt.

    Install the two-factor-authentication-best-practices skill in Claude Code. Run this command:
    
    npx skills add https://github.com/better-auth/skills --skill two-factor-authentication-best-practices
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

Configure TOTP authenticator apps, send OTP codes via email/SMS, manage backup codes, handle trusted devices, and implement 2FA sign-in flows using Better Auth's twoFactor plugin. Use when users need MFA, multi-factor authentication, authenticator setup, or login security with Better Auth.

Sections in SKILL.md

  1. Setup
  2. Client-Side Setup
  3. Enabling 2FA for Users
  4. TOTP (Authenticator App)
  5. Displaying the QR Code
  6. Verifying TOTP Codes
  7. TOTP Configuration Options
  8. OTP (Email/SMS)
  9. Configuring OTP Delivery
  10. Sending and Verifying OTP
  11. OTP Storage Security
  12. Backup Codes
  13. Displaying Backup Codes
  14. Regenerating Backup Codes
  15. Using Backup Codes for Recovery
  16. Backup Code Configuration

Key facts

Installs on skills.sh
35,709 (Nov 2, 2026)
GitHub stars (repo)
228 (Nov 2, 2026)
Last repo commit
Oct 19, 2026

What it includes

  • Server plugin with issuer, client plugin, migrate, then verify the column.

    Step 3 runs npx auth@latest migrate or generate plus a push.

    Runs code · Setup (4 steps)

  • How a user turns 2FA on.

    Enabling 2FA for users

  • Show the QR code, verify codes and set TOTP options.

    TOTP (authenticator app)

  • Configure delivery, send and verify codes, and store them securely.

    OTP (email or SMS)

  • Display, regenerate and use codes for recovery, plus config.

    Backup codes

  • The sign-in flow when a user has 2FA on.

    2FA during sign-in

  • Skip repeat prompts on devices the user trusts.

    Trusted devices

  • Session management, rate limiting and encryption at rest.

    Security considerations

  • How a user turns it off.

    Disabling 2FA

From the official docs

Permissions

Low risk

The skill holds instructions, but its setup step runs a CLI command that can change your database schema. Try it on a dev database first.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • Migrate commands change your database

    The setup steps run npx auth@latest migrate, or generate plus a Drizzle or Prisma push. Run them against a dev database first. github.com

Technical details
Talks tonpm registry (npx auth@latest)
Scopes
  • Database connection string (yours)

Questions

How do I install it?

Use the install box above. It installs only two-factor-authentication-best-practices, not the other five skills in the repo.

Which Better Auth skill should I install?

The better-auth/skills repo has six: best-practices (setup and config), create-auth (planning and scaffolding), security, emailAndPassword, organization and twoFactor. Start with create-auth for a new project and best-practices for config questions, then add the topic skill you need.

Does it send SMS codes?

Not by itself. SKILL.md shows how to configure OTP delivery by email or SMS, and you supply the provider.

Is it safe to install?

The folder is one Markdown file with no scripts, so installing adds instructions only. The setup step runs a migrate command that can change your database, so use a dev database first.

Does it work in the Claude app or Codex?

The install box lists a zip upload for the Claude app and a skills folder for Codex. The repo has no README, so the author does not say which clients it supports.

Information

updated Nov 2, 2026

Folder
better-auth/twoFactor

better-auth/skillsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 5
  1. SKILL.md · github.com
  2. skills.sh listing · skills.sh
  3. Repository · github.com
  4. Using skills in Claude · support.claude.com
  5. Claude Code skills · code.claude.com

Updated Nov 2, 2026.