next-js-better-auth-integration
在 Next.js 中整合 Better Auth
App Router 專案中的驗證通常橫跨 server components、middleware、sessions 與 client state。這項 skill 為 Claude、Codex 和 Claude Code 提供一份聚焦的檢查清單,用於實作 Better Auth 模式。
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
Agent 可讀資源
當 AI Agent、爬蟲或腳本需要乾淨脈絡、而不是讀取完整頁面時,請使用這些連結。
測試它
正在使用「next-js-better-auth-integration」。 Plan Better Auth integration for a new App Router project.
預期結果:
- 針對 auth configuration、provider setup 和 session context 的建議設定順序。
- 公用與私有頁面的路由保護計畫。
- 涵蓋 cookies、CSRF、secrets 和 rate limiting 的安全檢查清單。
正在使用「next-js-better-auth-integration」。 Review my protected route strategy.
預期結果:
- 對 server-side 和 client-side session checks 的評估。
- 未驗證使用者的 redirect 行為。
- 正式發布前需要驗證的缺口。
安全審計
安全Reviewed the three static findings in SKILL.md and found no confirmed malicious or unsafe behavior. The flagged lines are descriptive authentication guidance, not executable code, credential access, weak cryptography, or network reconnaissance. No prompt injection attempt or data exfiltration intent was found.
Static false positives ignored (3)
These static matches were dismissed by semantic review or matched schema-only tokens, so they are shown for transparency but do not drive the quality score.
品質評分
你可以打造什麼
為新 App 加入驗證
在撰寫實作程式碼前,規劃 Better Auth 設定、session context 和受保護頁面。
審查驗證架構
檢查是否已涵蓋 session 處理、redirects、token 行為和 cookie 設定。
準備實作任務
將驗證需求轉換為 App Router、middleware 和 UI states 的聚焦工作項目。
試試這些提示
Use this skill to outline the Better Auth setup steps for my Next.js App Router project. Include required files, session flow, and environment variables.
Use this skill to design protected route behavior for these pages: dashboard, settings, and billing. Include unauthenticated redirects and session checks.
Use this skill to review my planned Better Auth session strategy. Focus on cookies, JWT expiration, CSRF protection, rate limiting, and secret handling.
Use this skill to create a phased migration plan from custom auth to Better Auth in a Next.js App Router app with social login and protected server components.
最佳實務
- 在變更路由前,先從 session 和 provider 需求開始。
- 將 authentication secrets 保存在受管理的 environment variables 中。
- 測試過期 sessions、無效 tokens 和未驗證存取路徑。
避免
- 不要將 session tokens 儲存在不安全的 client-side storage 中。
- 不要只用 client-side checks 保護頁面。
- 不要在未進行 rate limiting 和 CSRF 審查的情況下發布驗證流程。