auth-expert

Implements JWT authentication, password hashing, and role-based access control for web applications.

3|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/trudyan141/my-antigravity-agents-kit --skill auth-expert-trudyan141
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-expert
Source: https://github.com/trudyan141/my-antigravity-agents-kit/tree/main/templates/.agent/skills/auth-expert
Command: npx skills add https://github.com/trudyan141/my-antigravity-agents-kit --skill auth-expert-trudyan141

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jsonwebtoken, bcrypt.

What problem does it solve? Building secure authentication and authorization is error-prone, and mistakes like weak password hashing, insecure token storage, or missing authorization checks lead to serious vulnerabilities. This Skill provides proven patterns and checklists for implementing auth correctly. ## Core Features & Use Cases - JWT Implementation: Generate and verify access tokens with secure expiry, httpOnly cookie storage, and middleware-based request authentication. - Password Security: Hash and verify passwords using bcrypt with a cost factor of 12 or higher. - RBAC Authorization: Enforce role-based permissions with middleware that checks resource-level access rights. - Use Case: When adding login to an Express or Next.js app, invoke this Skill to get a complete token flow, password hashing utilities, and a security review checklist covering rate limiting, cookie flags, and route protection. ## Quick Start Ask the AI to implement secure JWT authentication with bcrypt password hashing and role-based access control for your API routes.

Frequently Asked Questions about auth-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement JWT authentication in Node.js?

Use the jsonwebtoken library to sign tokens with a strong secret and short expiry such as 15 minutes. Verify tokens in middleware via jwt.verify, and deliver them through httpOnly cookies rather than the Authorization header when possible.

How to hash passwords securely with bcrypt?

Hash passwords with bcrypt using a salt rounds value of at least 12 via bcrypt.hash, and verify logins with bcrypt.compare against the stored hash. Never store plaintext passwords or use fast hashes like MD5 or SHA-1.

Should I store JWT tokens in localStorage or cookies?

Store JWTs in httpOnly, secure, sameSite cookies rather than localStorage. LocalStorage is accessible to any JavaScript on the page, making tokens vulnerable to XSS theft, while httpOnly cookies cannot be read by client scripts.

How do I implement role-based access control in Express?

Define a roles object mapping each role to its allowed permissions, then create middleware that checks the authenticated user's role against the required permission. Return a 403 response when the user's role lacks the permission.

Why is client-side only authentication insecure?

Client-side checks can be bypassed by anyone modifying requests or JavaScript. Always validate tokens and enforce authorization on the server for every protected route and resource.