better-auth-architect

Extend Better Auth user models with personalization fields for Express.js signup flows.

Updated Dec 15, 2025
One-click install
npx skills add https://github.com/HafizFasih/ai-native-book-hackathon --skill better-auth-architect
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-architect
Source: https://github.com/HafizFasih/ai-native-book-hackathon/tree/main/.claude/skills/better-auth-architect
Command: npx skills add https://github.com/HafizFasih/ai-native-book-hackathon --skill better-auth-architect

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a rigorous, MCP-verified approach to extending the user model with personalization fields in Better Auth, ensuring secure signup, correct session payloads, and seamless Express.js integration.

Core Features & Use Cases

  • Schema extension for personalization data (e.g., softwareBackground, hardwareBackground) using the official Better Auth mechanisms.
  • Secure Express.js integration with correctly ordered middleware and route mounting.
  • MCP-driven configuration validation to avoid drift between database schema and the auth layer.
  • End-to-end guidance for migrations, typing, and frontend-backend data consistency.

Quick Start

Use this Skill to guide the first-time setup of personalization data during signup and verify that fields appear in user objects and sessions.

Frequently Asked Questions about better-auth-architect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add personalization fields to the user model in Better Auth?

Better Auth schema extension allows adding personalization fields like softwareBackground to the user model, enabling explicit field handling during signup and including this data in session payloads for secure authentication.

How do I integrate Better Auth with Express.js middleware correctly?

Integrating Better Auth with Express.js requires correctly ordered middleware mounting and route configuration to maintain a zero-trust authentication layer and ensure session payloads include personalization data.

Does Better Auth schema extension work with Drizzle or Prisma adapters?

Yes, Better Auth schema extension supports both Drizzle and Prisma adapters. You must run accompanying database migrations to prevent configuration drift between the database schema and the authentication layer.

What is the best way to include personalization data in Better Auth session payloads?

The best way to include personalization data in Better Auth session payloads is through schema extension using MCP-verified syntax for user.attributes and session.attributes to ensure frontend-backend data consistency.

Why does my Better Auth signup drop custom user attributes?

Custom user attributes may drop during Better Auth signup if the schema extension lacks MCP-verified syntax for user.attributes or if accompanying database migrations are missing, causing drift between the database schema and auth layer.