← スキル一覧に戻る

auth-builder
by Rehan-Ul-Haq
⭐ 9🍴 2📅 2026年1月8日
SKILL.md
name: auth-builder description: | Implements secure authentication for web applications. This skill should be used when users want to add login/signup, protect routes, or integrate auth providers into their applications.
Auth Builder
Implement secure authentication adapted to framework and requirements.
What This Skill Does
- Implements authentication flows (signup, login, logout, refresh)
- Configures session or token-based auth
- Protects routes with middleware
- Integrates OAuth providers (optional)
What This Skill Does NOT Do
- Authorization (role-based access control) - separate concern
- Identity management (user profiles, settings)
- Multi-factor authentication setup
- Security auditing
Before Implementation
| Source | Gather |
|---|---|
| Codebase | Framework, existing user model, database |
| Conversation | Auth method, token storage, providers needed |
| Skill References | Security patterns from references/ |
Required Clarifications
| Clarification | Options | Security Implications |
|---|---|---|
| Auth method | JWT / Session / OAuth | Token storage, CSRF needs |
| Token storage | Cookie / localStorage | XSS vs CSRF tradeoffs |
| Refresh strategy | Refresh tokens / Sliding session | Token lifetime |
| Password requirements | Min length, complexity | Brute force resistance |
Implementation Workflow
1. User Model → 2. Password Handling → 3. Auth Routes → 4. Middleware → 5. Token Management
1. User Model
Store only what's needed for auth:
- Email (unique, indexed)
- Password hash (NEVER plaintext)
- Created/updated timestamps
2. Password Handling
See references/security-patterns.md.
Requirements:
- Use bcrypt/argon2 (NOT MD5/SHA1)
- Cost factor ≥ 10
- Never log passwords
3. Auth Routes
| Route | Purpose | Returns |
|---|---|---|
| POST /signup | Create account | User + tokens |
| POST /login | Authenticate | Tokens |
| POST /logout | Invalidate session | Success |
| POST /refresh | Get new access token | New tokens |
4. Middleware
Protect routes requiring authentication.
5. Token Management
JWT Strategy:
- Short-lived access token (15 min)
- Long-lived refresh token (7 days)
- Store refresh token securely (httpOnly cookie)
Security Checklist
- Passwords hashed with bcrypt/argon2
- Tokens have expiration
- Refresh tokens stored in httpOnly cookies
- CSRF protection if using cookies
- Rate limiting on auth endpoints
- No sensitive data in JWT payload
- Secure password reset flow
Reference Files
| File | Use When |
|---|---|
references/security-patterns.md | Password hashing, token security |
references/oauth-integration.md | Adding social login |
references/common-vulnerabilities.md | Avoiding auth pitfalls |
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です