create-auth 是什么?
Scaffold and implement authentication in TypeScript/JavaScript apps using Better Auth. Detect frameworks, configure database adapters, set up route handlers, add OAuth providers, and create auth UI pages. Use when users want to add login, sign-up, or authentication to a new or existing project with Better Auth.
以上为来源原文,中文用途说明尚待整理。
怎么接入你的 Agent?
- 定位完整 Skill 目录
打开本项目来源,核对
SKILL.md及其引用的脚本和资料。 - 交给你正在用的 Agent
在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。
- 确认识别,再做具体任务
让 Agent 回报安装目录和识别到的名称
create-auth,然后告诉 Agent 你的任务和实际输入,让它先核对触发条件。
展开并复制给 Codex 的安装指令
安装并检查 create-auth
请在 Codex 的当前工作环境中安装并检查 create-auth 这个 Skill。
项目身份:better-auth/skills / create-auth
来源:https://github.com/better-auth/skills/blob/20c9e88a5c007461a703f1c213572b073196113e/better-auth/create-auth/SKILL.md
已定位的源文件:better-auth/create-auth/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Claude Code 的安装指令
安装并检查 create-auth
请在 Claude Code 的当前工作环境中安装并检查 create-auth 这个 Skill。
项目身份:better-auth/skills / create-auth
来源:https://github.com/better-auth/skills/blob/20c9e88a5c007461a703f1c213572b073196113e/better-auth/create-auth/SKILL.md
已定位的源文件:better-auth/create-auth/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Cursor 的安装指令
安装并检查 create-auth
请在 Cursor Agent 的当前工作环境中安装并检查 create-auth 这个 Skill。
项目身份:better-auth/skills / create-auth
来源:https://github.com/better-auth/skills/blob/20c9e88a5c007461a703f1c213572b073196113e/better-auth/create-auth/SKILL.md
已定位的源文件:better-auth/create-auth/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 当前 Agent 的安装指令
安装并检查 create-auth
请在 当前 Agent 的当前工作环境中安装并检查 create-auth 这个 Skill。
项目身份:better-auth/skills / create-auth
来源:https://github.com/better-auth/skills/blob/20c9e88a5c007461a703f1c213572b073196113e/better-auth/create-auth/SKILL.md
已定位的源文件:better-auth/create-auth/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。来源原文与资料状态
- 源文件
- 已保存 SKILL.md,抓取于 2026-11-20T19:31:09.802Z
- 中文使用说明
- 尚待整理,保留英文来源内容
- 安装与任务测试
- 本站未执行安装或任务测试
- 来源复核
- 已保留来源记录;当前完整用法未逐项人工复核
展开 SKILL.md 原文、章节与历史收录资料
better-auth/create-auth/SKILL.md · 抓取时间 2026-11-20T19:31:09.802Z
以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。
抓取成功不代表已完成安装或任务测试。
Scaffold and implement authentication in TypeScript/JavaScript apps using Better Auth. Detect frameworks, configure database adapters, set up route handlers, add OAuth providers, and create auth UI pages. Use when users want to add login, sign-up, or authentication to a new or existing project with Better Auth.
查看源文件章节 / Source sections
- 原文:Create Auth Skill
- 原文:Phase 1: Planning (REQUIRED before implementation)
- 原文:Step 1: Scan the project
- 原文:Step 2: Ask planning questions
- 原文:Step 3: Summarize the plan
- 原文:Phase 2: Implementation
- 安装 / Installation
- 原文:Environment Variables
- 原文:Server Config (auth.ts)
- 原文:Client Config (auth-client.ts)
- 原文:Route Handler Setup
- 原文:Database Migrations
- 原文:Database Adapters
- 原文:Drizzle + PostgreSQL Setup
- 原文:Drizzle Config (`drizzle.config.ts`)
- 原文:Common Plugins
- 原文:Auth UI Implementation
- 原文:Security Checklist
- 故障排查 / Troubleshooting
- 原文:Resources
原文:Create Auth Skill
Guide for adding authentication to TypeScript/JavaScript applications using Better Auth. **For code examples and syntax, see [better-auth.com/docs](https://better-auth.com/docs).** ---
原文:Phase 1: Planning (REQUIRED before implementation)
Before writing any code, gather requirements by scanning the project and asking the user structured questions. This ensures the implementation matches their needs.
原文:Step 1: Scan the project
Analyze the codebase to auto-detect: - **Framework** — Look for `next.config`, `svelte.config`, `nuxt.config`, `astro.config`, `vite.config`, or Express/Hono entry files. - **Database/ORM** — Look for `prisma/schema.prisma`, `drizzle.config.ts`, `package.json` deps (`pg`, `postgres`, `@neondatabase/serverless`, `mysql2`, `better-sqlite3`, `mongoose`, `mongodb`). If `drizzle.config.ts` exists, read its `dialect` field to determine the DB type (e.g., `"postgresql"` → Drizzle + Postgres). Also check which Drizzle driver is installed (`drizzle-orm/node-postgres` → `pg`, `drizzle-orm/postgres-js` → `postgres`, `drizzle-orm/neon-http` → Neon). - **Existing auth** — Look for existing auth libraries (`next-auth`, `lucia`, `clerk`, `supabase/auth`, `firebase/auth`) in `package.json` or imports. - **Package manager** — Check for `pnpm-lock.yaml`, `yarn.lock`, `bun.lockb`, or `package-lock.json`. Use what you find to pre-fill defaults and skip questions you can already answer.
原文:Step 2: Ask planning questions
Use the `AskQuestion` tool to ask the user **all applicable questions in a single call**. Skip any question you already have a confident answer for from the scan. Group them under a title like "Auth Setup Planning". **Questions to ask:** 1. **Project type** (skip if detected) - Prompt: "What type of project is this?" - Options: New project from scratch | Adding auth to existing project | Migrating from another auth library 2. **Framework** (skip if detected) - Prompt: "Which framework are you using?" - Options: Next.js (App Router) | Next.js (Pages Router) | SvelteKit | Nuxt | Astro | Express | Hono | SolidStart | Other 3. **Database & ORM** (skip if detected) - Prompt: "Which database setup will you use?" - Options: PostgreSQL (Prisma) | PostgreSQL (Drizzle) | PostgreSQL (pg driver) | MySQL (Prisma) | MySQL (Drizzle) | MySQL (mysql2 driver) | SQLite (Prisma) | SQLite (Drizzle) | SQLite (better-sqlite3 driver) | MongoDB (Mongoose) | MongoDB (native driver) 4. **Authentication methods** (always ask, allow multiple) - Prompt: "Which sign-in methods do you need?" - Options: Email & password | Social OAuth (Google, GitHub, etc.) | Magic link (passwordless email) | Passkey (WebAuthn) | Phone number - `allow_multiple: true` 5. **Social providers** (only if they selected Social OAuth above — ask in a follow-up call) - Prompt: "Which social providers do you need?" - Options: Google | GitHub | Apple | Microsoft | Discord | Twitter/X - `allow_multiple: true` 6. **Email verification** (only if Email & password was selected above — ask in a follow-up call) - Prompt: "Do you want to require email verification?" - Options: Yes | No 7. **Email provider** (only if email verification is Yes, or if Password reset is selected in features — ask in a follow-up call) - Prompt: "How do you want to send emails?" - Options: Resend | Mock it for now (console.log)
本段为节选,完整内容见源文件。
原文:Step 3: Summarize the plan
After collecting answers, present a concise implementation plan as a markdown checklist. Example: ``` ## Auth Implementation Plan - **Framework:** Next.js (App Router) - **Database:** PostgreSQL via Prisma - **Auth methods:** Email/password, Google OAuth, GitHub OAuth - **Plugins:** 2FA, Organizations, Email verification - **UI:** Custom forms ### Steps 1. Install `better-auth` (the CLI ships as the `auth` package and is run via `npx auth@latest`, no install needed) 2. Create `lib/auth.ts` with server config 3. Create `lib/auth-client.ts` with React client 4. Set up route handler at `app/api/auth/[...all]/route.ts` 5. Configure Prisma adapter and generate schema 6. Add Google & GitHub OAuth providers 7. Enable `twoFactor` and `organization` plugins 8. Set up email verification handler 9. Run migrations 10. Create sign-in / sign-up pages ``` Ask the user to confirm the plan before proceeding to Phase 2. ---
原文:Phase 2: Implementation
Only proceed here after the user confirms the plan from Phase 1. Follow the decision tree below, guided by the answers collected above. ``` Is this a new/empty project? ├─ YES → New project setup │ 1. Install better-auth (+ scoped packages per plan) │ 2. Create auth.ts with all planned config │ 3. Create auth-client.ts with framework client │ 4. Set up route handler │ 5. Set up environment variables │ 6. Run CLI migrate/generate │ 7. Add plugins from plan │ 8. Create auth UI pages │ ├─ MIGRATING → Migration from existing auth │ 1. Audit current auth for gaps │ 2. Plan incremental migration │ 3. Install better-auth alongside existing auth │ 4. Migrate routes, then session logic, then UI │ 5. Remove old auth library │ 6. See migration guides in docs │ └─ ADDING → Add auth to existing project 1. Analyze project structure 2. Install better-auth 3. Create auth config matching plan 4. Add route handler 5. Run schema migrations 6. Integrate into existing pages 7. Add planned plugins and features ``` At the end of implementation, guide users thoroughly on remaining next steps (e.g., setting up OAuth app credentials, deploying env vars, testing flows). ---
文件 SHA256:e3f24141de734690c803c577cc30f19aa0b7a6e408def0d0de7f8e1b6780c5fc
仓库许可证记录:未提供;not-established,查看来源。
Scaffold and implement authentication in TypeScript/JavaScript apps using Better Auth. Detect frameworks, configure database adapters, set up route handlers, add OAuth providers, and create auth UI pages. Use when users want to add login, sign-up, or authentication to a new or existing project with Better Auth.
历史收录数据
| 来源仓库 | better-auth/skills |
|---|---|
| Skill源路径 | better-auth/create-auth/SKILL.md |
安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。
