agentsclimarketplace

Phone auth

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

Template for Flutter mobile applications.

Install
npx -y skills add launch52-ai/flutter-template --skill phone-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

Phone OTP authentication - country data, phone formatting, E.164 validation, rate limiting, retry patterns. Use when implementing phone verification flows. Supports Supabase and custom backends.

SKILL.md

3.7 KB, as published. Nobody here has run it

Phone Auth - Phone OTP Authentication

Phone number OTP authentication with Clean Architecture. Backend handles security (OTP generation, rate limiting). Mobile handles UX (formatting, countdown, error display).

When to Use This Skill

  • Adding phone number login/signup to a Flutter app
  • Implementing OTP verification flows
  • User asks to "add phone auth", "phone login", or "OTP verification"

Questions to Ask

  1. Backend type: Supabase or Custom API?
  2. Countries data: Local JSON (faster) or Backend API (dynamic)?

Responsibilities

MobileBackend
Display country pickerOTP generation (cryptographic)
Format phone inputOTP storage (hashed)
Convert to E.164Rate limiting
Show countdown timerExpiration checking
Display errorsAttempt counting
Call backend APIsUser auth/creation

Reference Files

reference/
├── models/           # Country model (Freezed)
├── utils/            # Phone formatting, E.164 conversion
├── repositories/     # Domain interface + mock
├── providers/        # Riverpod notifier + state
└── failures/         # Sealed Failure types

See: implementation-guide.md for complete file list and copy instructions.

Workflow

  1. Copy data/countries.json to assets/data/
  2. Copy reference files to project (see implementation-guide.md)
  3. Implement repository (Supabase or API) - see implementation-guide.md
  4. Register provider in lib/core/providers.dart
  5. Run dart run build_runner build
  6. Use /design for UI components

Core API

// Format and convert
final e164 = PhoneFormatUtils.toE164(localNumber, country);

// Send OTP
await repository.sendOtp(e164);

// Verify OTP
await repository.verifyOtp(phoneNumber, otp);

Failure Types

TypeWhenUI Action
InvalidPhoneFailureBad formatValidation error
RateLimitFailure(retryAfter)Too many sendsCountdown
InvalidOtpFailure(remaining)Wrong OTPShow attempts
OtpExpiredFailureOTP timed outResend option
MaxAttemptsFailure3+ failuresForce new OTP
PhoneAuthNetworkFailureConnectionRetry button

Retry Pattern

Escalating intervals: 30s → 40s → 60s → 90s → 120s

See reference/providers/phone_auth_providers.dart for configuration.

Guides

FileContent
implementation-guide.mdStep-by-step with Supabase + API examples
best-practices-guide.mdSecurity, UX patterns
phone-formats-guide.mdE.164, country formats
checklist.mdImplementation verification

Checklist

  • countries.json copied to assets/data/
  • PhoneAuthRepository interface extends base AuthRepository
  • sendOtp(e164PhoneNumber) and verifyOtp(phone, otp) implemented
  • PhoneFormatUtils handles E.164 conversion
  • All Failure types implemented (InvalidPhone, RateLimit, InvalidOtp, etc.)
  • Retry intervals configured (30s → 40s → 60s → 90s → 120s)
  • Provider registered in lib/core/providers.dart
  • build_runner executed successfully
  • Error messages use i18n keys

Related Skills

  • /social-login - Can combine with phone auth
  • /design - Phone input and OTP UI components
  • /i18n - Localized error messages
  • /testing - Unit and widget tests

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.