agentleFS
launch52-ailaunch52-ai/flutter-template/.claude/skills/auth/SKILL.md

auth

Skill2 starsChanged 9 months agoMITView on GitHub

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.

We split this skill into the rules it gives an agent

5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 17 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After /core skill completes

    line 13
  2. Very specific:

    Before adding specific auth methods (/social-login, /phone-auth)

    line 14
  3. Distinctive:

    Use AskUserQuestion to gather:

    line 55
  4. Distinctive:

    Create standard Clean Architecture feature:

    line 62
  5. Very specific:

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

    line 149

“Common” is measured: kept by at least 6 in 10 of the 17 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

Download now (ZIP)

  • Other versions20 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 20

    1. openai/plugins★ 7.4ksame name
    2. epicenter-md/epicenter★ 4.8ksame name
    3. EpicenterHQ/epicenter★ 4.8ksame name
    4. microsoft/apm★ 4.2ksame name
    5. danielmeppiel/apm★ 4ksame name
    6. crbnos/carbon★ 2.8ksame name
    7. vercel/vercel-plugin★ 323same name
    8. kagenti/kagenti★ 300same name
    9. kid-sid/claude-spellbook★ 190same name
    10. YepAPI/skills★ 8same name

    10 more not listed

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects with it also use error-handling, logging and 7 more.

    Other files people use alongside this one.

    Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
    • MicrosoftSkill

      error-handling

      统一错误处理系统。在添加 API 端点、修改错误处理、添加前端 API 调用、编写错误相关测试时使用。

      Also in 5 projects that use this

    • diego-tobalinaSkill

      logging

      Logging best practices for Java (SLF4J/Logback) and Node.js (Winston/Pino). Use for structured logging, log levels, and avoiding sensitive data exposure.

      Also in 3 projects that use this

    • wrsmith108Skill

      docker

      Container-based development for isolated, reproducible environments. Use when running npm commands, installing packages, executing code, or managing project dependencies. Trigger phrases include "npm install", "run the build", "start the server", "install package", or any code execution request.

      Also in 3 projects that use this

    • SentrySkill

      github-issues

      Create, update, comment on, label, and inspect GitHub issues with concise, evidence-backed content. Use when users ask to open, edit, view, close, reopen, or triage GitHub issues — including tracking bugs, features, or tasks. Prefer this skill over generic repository tools for issue operations; do not use for pull requests, branches, pushes, or PR creation order questions.

      Also in 3 projects that use this

    • SentrySkill

      ui-design

      Also in 3 projects that use this

    • MicrosoftSkill

      typescript

      TypeScript best practices for this monorepo. Use this skill when: (1) writing new TypeScript code, (2) reviewing TypeScript code, (3) working with API responses, fetch calls, or JSON parsing, (4) adding or modifying types and interfaces.

      Also in 3 projects that use this

    • +1 more from microsoft
  • In this repository27 other files it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.