agentsclimarketplace

Auth

Skill launch52-ai/flutter-template/.claude/skills/auth

Template for Flutter mobile applications.

Install
npx -y skills add launch52-ai/flutter-template --skill auth

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Generate base authentication feature scaffold with Clean Architecture. Creates shared auth infrastructure (AuthRepository, AuthNotifier, UserProfile, LoginScreen) that /social-login and /phone-auth extend. Run after /core, before specific auth methods.

SKILL.md

7.4 KB, as published. Nobody here has run it

Auth - Base Authentication Scaffold

Creates the authentication feature foundation with Clean Architecture. This skill generates shared infrastructure that /social-login and /phone-auth build upon.

When to Use This Skill

  • After /core skill completes
  • Before adding specific auth methods (/social-login, /phone-auth)
  • Setting up auth from scratch
  • User asks to "add authentication" or "create auth"

Questions to Ask

  1. Backend type: Supabase or Custom API?
  2. Auth methods: (multi-select) Social Login, Phone OTP, Email/Password
  3. User profile fields: Custom fields beyond id/email? (e.g., displayName, avatarUrl)

What This Skill Creates

Base auth infrastructure that specific auth skills extend:

ComponentPurposeExtended By
AuthRepositoryBase interface (signOut, getCurrentUser)social-login, phone-auth
AuthNotifierState management with disposal safetyAll auth screens
AuthStateSealed states (loading, authenticated, error)All auth screens
UserProfileUser modelAll auth methods
AuthResultSign-in result with isNewUser flagsocial-login, phone-auth
LoginScreenBase scaffold for auth UIButtons added by methods
AuthFailureBase failure typesExtended by methods

Reference Files

reference/
├── models/           # UserProfile, AuthResult
├── repositories/     # Interface, Supabase impl, mock
├── providers/        # AuthState, AuthNotifier
├── screens/          # LoginScreen scaffold
└── failures/         # Base auth failure types

See: implementation-guide.md for complete file list.

Workflow

Phase 1: Ask Questions

Use AskUserQuestion to gather:

  • Backend type (Supabase vs Custom API)
  • Which auth methods needed
  • Custom user profile fields

Phase 2: Generate Structure

Create standard Clean Architecture feature:

lib/features/auth/
├── data/          # models/, repositories/
├── domain/        # failures/, repositories/
├── presentation/  # providers/, screens/
└── i18n/          # auth.i18n.yaml

See: implementation-guide.md for complete structure.

Phase 3: Copy Reference Files

  1. Copy models from reference/models/
  2. Copy repository interface from reference/repositories/
  3. Copy implementation (Supabase or API base)
  4. Copy providers from reference/providers/
  5. Copy login screen scaffold from reference/screens/

Phase 4: Register Providers

Add to lib/core/providers.dart:

@riverpod
AuthRepository authRepository(Ref ref) {
  if (DebugConstants.useMockAuth) {
    return MockAuthRepository();
  }
  return AuthRepositoryImpl(Supabase.instance.client);
}

Phase 5: Add Routes

Add to lib/core/router/app_router.dart:

GoRoute(
  path: '/login',
  builder: (context, state) => const LoginScreen(),
),

Phase 6: Run Build

dart run build_runner build --delete-conflicting-outputs

Core API

// Check current auth state
final user = await repository.getCurrentUser();

// Sign out
await repository.signOut();

// Listen to auth changes
repository.authStateChanges.listen((user) => ...);

Auth States

StateWhenUI
initialApp start, checking authSplash
loadingSign-in in progressLoading indicator
authenticated(user)User signed inNavigate to home
unauthenticatedNo user / signed outShow login
error(message)Auth failedError + retry

Base Failure Types

TypeWhenUI Action
AuthNetworkFailureConnection errorRetry button
AuthServerFailureBackend errorGeneric error
AuthSessionExpiredFailureToken expiredRe-login
AuthUnknownFailureUnexpected errorGeneric error

Specific auth methods add their own failure types (see /social-login, /phone-auth).

Next Steps

After running /auth, run these skills based on your selection:

If SelectedRunCreates
Social Login/social-loginGoogle + Apple Sign-In
Phone OTP/phone-authPhone verification
Email/Password(built-in)Email auth methods

Then:

  1. /i18n auth - Localize strings
  2. /design - Polish UI
  3. /testing auth - Write tests

Integration Architecture

┌─────────────────────────────────────────────────────────┐
│                    LoginScreen                          │
│  ┌────────────┐ ┌────────────┐ ┌────────────────────┐  │
│  │ Email Form │ │ Social Btns│ │ Phone Number Input │  │
│  │ (built-in) │ │(/social)   │ │   (/phone-auth)    │  │
│  └─────┬──────┘ └─────┬──────┘ └─────────┬──────────┘  │
└────────┼──────────────┼──────────────────┼─────────────┘
         │              │                  │
    ┌────┴──────────────┴──────────────────┴────┐
    │              AuthNotifier                  │
    │  signInWithEmail | signInWithGoogle | ... │
    └──────────────────┬────────────────────────┘
                       │
    ┌──────────────────┴────────────────────────┐
    │             AuthRepository                 │
    │ implements: SocialAuthRepo, PhoneAuthRepo │
    └───────────────────────────────────────────┘

Guides

FileContent
implementation-guide.mdStep-by-step with code examples
checklist.mdImplementation verification

Checklist

  • AuthRepository interface created with signOut, getCurrentUser, authStateChanges
  • AuthNotifier extends AsyncNotifier with disposal safety
  • AuthState is sealed (initial, loading, authenticated, unauthenticated, error)
  • UserProfile model created with required fields
  • Repository implementation matches backend type (Supabase/Custom)
  • Provider registered in lib/core/providers.dart
  • Login route added to router
  • build_runner executed successfully
  • Mock repository created for testing

Related Skills

  • /social-login - Google + Apple Sign-In (extends auth)
  • /phone-auth - Phone OTP (extends auth)
  • /core - Run before auth (creates services)
  • /design - Login screen UI polish
  • /i18n - Localized auth strings

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.