Skip to main content
Run any Skill in Manus
with one click

nextjs-better-auth-minimal-api-refactor

Stars1
Forks0
UpdatedFebruary 7, 2026 at 12:33

Refactor Next.js + Better Auth authentication to minimal API with discriminated unions. Use when: (1) Too many auth helper functions causing maintenance burden, (2) Want perfect type safety without optional chaining, (3) Need to optimize auth performance with aggressive cookie caching, (4) Using Better Auth v1.4+ with Next.js 16 App Router and ZenStack ORM. Covers progressive refactoring from backward-compatible to breaking changes, discriminated union type patterns, and systematic multi-file migration.

Installation

Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.

SKILL.md
readonly