email-and-password-best-practices — Claude Code skill setup
Configures email verification, password reset flows, and password policies in Better Auth. Helpful when adding credential authentication to your backend.
npx skills add better-auth/skills --skill email-and-password-best-practices -a claude-code
npx skills add better-auth/skills --skill emailAndPassword -a claude-codeWhat email-and-password-best-practices does
This skill guides the setup of email and password authentication in Better Auth. It details how to hook into sendVerificationEmail, enforce mandatory address confirmation before sign-in, and implement password resets while invalidating active sessions with revokeSessionsOnPasswordReset.
The guidance covers token lifetimes, which default to one hour and are single-use. It also demonstrates how to replace the built-in Node.js scrypt hashing with Argon2id via @node-rs/argon2, including specific memory and iteration parameters.
Switching password hashing on an existing database will immediately lock out users with legacy hashes unless you plan a migration flow first. On serverless infrastructure, background email tasks require passing promises to handlers like waitUntil.
What it helps with
- enforce email verification before allowing sign-in
- implement password reset with session invalidation
- replace default
scrypthashing with Argon2id - define minimum and maximum password length boundaries
Example prompts for the agent
- Configure email verification and block unverified sign-ins in Better Auth
- Set up password reset in Better Auth with single-use tokens and session revocation
- Implement Argon2id custom password hashing for Better Auth
How to install email-and-password-best-practices
1Skills CLI (Vercel)
npx skills add better-auth/skills --skill email-and-password-best-practices -a claude-codenpx skills add better-auth/skills --skill emailAndPassword -a claude-code2Manually: put the files in place
~/.claude/skills/emailAndPassword/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/emailAndPassword/
1Skills CLI (Vercel)
npx skills add better-auth/skills --skill emailAndPassword -a codex2Manually: put the files in place
.agents/skills/emailAndPassword/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add better-auth/skills --skill emailAndPassword -a cursor2Manually: put the files in place
.cursor/skills/emailAndPassword/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install better-auth/skills emailAndPassword2Manually: put the files in place
.github/skills/emailAndPassword/SKILL.md1Skills CLI (Vercel)
npx skills add better-auth/skills --skill emailAndPassword -a gemini-cli2Platform CLI
gemini skills install https://github.com/better-auth/skills --path better-auth/emailAndPasswordManually: put the files in place
.devin/skills/emailAndPassword/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add better-auth/skills --skill emailAndPassword -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set5
The whole set →Similar
Questions about email-and-password-best-practices
How to install email-and-password-best-practices in Claude Code?
Run npx skills add better-auth/skills --skill email-and-password-best-practices -a claude-code.
What does email-and-password-best-practices do?
It provides configuration guidance for email and password authentication in Better Auth, covering verification links, reset flows, session revocation, and custom hashers.
What happens if you switch from scrypt to Argon2id?
Better Auth defaults to scrypt. Switching hashing algorithms on a database with existing users breaks their sign-ins unless you handle credential migration.