Agent skill
auth-skill
Handle secure user authentication including signup, signin, password hashing, JWT tokens, and Better Auth integration. Use for authentication and authorization systems.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/auth-skill
SKILL.md
Auth Skill – Secure Authentication & Authorization
Instructions
-
Signup & Signin
- Implement secure signup and login flows
- Prevent account enumeration
- Handle failed authentication attempts safely
-
Password Hashing
- Hash passwords using bcrypt or argon2
- Always apply salting
- Never store or log plaintext passwords
-
JWT Token Management
- Generate access and refresh tokens securely
- Validate token signature, claims, and expiration
- Rotate and revoke tokens when required
-
Better Auth Integration
- Configure Better Auth securely
- Integrate with existing user models
- Follow Better Auth recommended defaults
-
Validation & Error Handling
- Validate all authentication inputs
- Use safe, generic error messages
- Protect against common auth attacks
Best Practices
- Apply least-privilege access control
- Use HTTP-only, secure cookies when applicable
- Enforce strong password policies
- Set proper token expiration strategies
- Follow OWASP authentication guidelines
Example Structure
// Password hashing
const hashedPassword = await bcrypt.hash(password, 12);
// JWT generation
const token = jwt.sign(
{ userId: user.id },
process.env.JWT_SECRET,
{ expiresIn: "15m" }
);
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?