AI SummaryMazeway provides cursor-native rules for building authentication systems in Next.js with Supabase while keeping auth logic in your own codebase. Developers building secure, self-owned authentication layers benefit from these opinionated architectural patterns.
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to add the "Mazeway — Cursor Rules" prompt rules to my project. Repository: https://github.com/mazeway-dev/Mazeway Please read the repo to find the rules/prompt file, then: 1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type) 2. If there's an existing rules file, merge the new rules in rather than overwriting 3. Confirm what was added
Description
Clerk but you own the code because authentication should live in your project, not a node_modules folder.
Component Structure & Dependencies
• MUST: Structure form components hierarchically with AuthForm as parent and specialized validation components as children • AVOID: Direct API calls in form components - use hooks for data fetching/mutations • WHY: Separates form UI from business logic, enables reuse of validation patterns • EXAMPLE: src/components/auth-form.tsx coordinates child components like 2fa-methods.tsx
Authentication Flow Components
• MUST: Use hook-based state management for auth flows (login, signup, 2FA) • AVOID: Mixing auth state across components, keeping auth logic in UI components • WHY: Centralizes auth state management, simplifies testing • EXAMPLE: src/components/user-provider.tsx handles global auth state
Form Validation
• MUST: Implement field-level validation using useFormField hook pattern • AVOID: Custom validation logic inside form components • WHY: Consistent validation behaviors across forms • EXAMPLE: src/components/ui/form.tsx FormFieldContext pattern
Toast Notifications
• MUST: Use centralized toast system via useToast hook for all user feedback • AVOID: Multiple toast implementations or direct toast calls • WHY: Consistent notification styling and behavior • EXAMPLE: src/components/ui/toast.tsx provides toast primitives
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster
Works With
Any AI assistant that accepts custom rules or system prompts