agentleFS
lightpointventureslightpointventures/claude-code-starter/skills/auth/SKILL.md

auth

Skill36 starsChanged 8 months agoMITView on GitHub

当用户想加登录、注册、用户认证、OAuth、JWT、权限控制时使用 — 为项目添加完整的用户认证系统

17 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

添加登录功能

帮用户为项目添加完整的用户认证系统。

步骤

1. 了解需求

问题 1:认证方式

你想用哪种登录方式?

  • 邮箱 + 密码(最常见)
  • OAuth 社交登录(Google、GitHub 等)
  • 两者都要 不确定的话,先用邮箱+密码,后续再加社交登录。

问题 2:是否需要注册页面

需要用户注册页面吗?还是只需要后端认证逻辑?

2. 检测技术栈

查看项目结构,确定:

  • 前端框架(React/Vue/纯 HTML)→ 决定登录页面怎么写
  • 后端框架(FastAPI/Express/Next.js)→ 决定认证逻辑怎么实现
  • 已有数据库 → 复用;没有 → 建议先用 /database 配置

3. 生成认证系统

后端:

  • 用户模型(邮箱、密码哈希、创建时间)
  • 注册接口(密码加密存储,邮箱去重检查)
  • 登录接口(密码验证,返回 JWT token)
  • 认证中间件(验证 token,保护需要登录的路由)

前端:

  • 登录页面(邮箱+密码输入,错误提示)
  • 注册页面(如果需要)
  • 登录状态管理(存储 token,自动附加到请求)

安全措施:

  • 密码使用 bcrypt 加密,绝不明文存储
  • JWT 设置合理的过期时间
  • 防止常见攻击(SQL 注入、XSS)

4. 验证

测试完整流程:注册 → 登录 → 访问受保护页面 → 登出。

登录功能已添加。测试流程正常。 需要加社交登录或忘记密码功能吗?

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.