All skills
clerk avatar

/clerk-android

@dbc2e14 official
by clerkclerk/skills83 stars
5

Implement Clerk authentication for native Android apps using Kotlin and Jetpack Compose with clerk-android source-guided patterns. Use for prebuilt AuthView/UserButton or custom API-driven auth flows. Do not use for Expo or React Native projects.

Use this Skill: https://skilld.dev/gh/clerk/skills/clerk-android

This session only. Nothing lands on disk.

referencescustom.md

≈968 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Custom Flow Reference (Clerk Android API)

Use this file only when flow type is custom.

Purpose

Implement native Android auth with Clerk API primitives while preserving Clerk's multi-step auth semantics and dashboard-driven capability gating.

Source-Driven Requirements

Use current clerk-android source/docs as primary references:

  • source/api for sign-in/sign-up/session/auth APIs.
  • source/ui/auth and samples/custom-flows for flow sequencing patterns.
  • Android quickstart for required project setup.

Source priority rules for custom flow:

  • Primary source: Clerk Android API and auth flow source.
  • Secondary source: samples/custom-flows.
  • Fallback only: high-level docs when behavior is unclear from SDK/source.

Required Patterns

  1. Artifact selection
  • Ensure com.clerk:clerk-android-api is installed.
  • Do not add clerk-android-ui unless developer explicitly asks for a hybrid prebuilt/custom approach.
  1. Quickstart prerequisite audit
  • Read the official Android quickstart: https://clerk.com/docs/android/getting-started/quickstart.
  • Verify required project setup (Native API, min SDK/Java, manifest internet permission, app-level initialization).
  • Implement missing required setup before finishing custom auth work.
  1. Initialization and state contract
  • Initialize via Clerk.initialize(...) at app startup.
  • Wait for Clerk.isInitialized before treating Clerk as ready.
  • Drive session/user UI from Clerk.userFlow/Clerk.sessionFlow.
  1. Capability-driven flow logic
  • Use Clerk runtime capability/settings fields to drive flow branches (first factors, social providers, MFA, Google One Tap support).
  • Do not hardcode fixed factor/provider assumptions.
  1. Multi-step flow progression
  • Keep sign-in/sign-up progression split into explicit steps/states.
  • Avoid collapsing all required auth input into one monolithic screen.
  • Keep branching aligned with factor requirements and verification states returned by Clerk.
  1. API usage patterns
  • Use Clerk sign-in/sign-up APIs and verification methods with structured success/failure handling.
  • Keep request/response handling explicit and status-driven.
  • Use Clerk error helpers/messages for user-visible errors.
  1. OAuth/social policy
  • Use provider flows supported by Clerk APIs.
  • For Google, honor runtime One Tap capability and use the appropriate Clerk path.
  • Do not bypass Clerk by implementing provider-specific token exchange directly unless explicitly requested.
  1. Code organization and separation of concerns
  • Split custom auth into focused modules:
    • UI step views/components
    • Flow/state orchestration (view models/state machines)
    • Clerk API integration layer
  • Keep module boundaries clear and composable.
  1. Avoid hidden dependencies
  • Do not silently add prebuilt UI dependencies to custom-only implementations.
  • Do not introduce local config indirection for publishable key unless requested.

Verification Checklist

  1. Quickstart prerequisites are complete
  • Required Android/Clerk setup from quickstart is present.
  • Missing required setup was applied.
  1. Correct artifact usage
  • clerk-android-api is present.
  • clerk-android-ui is absent unless explicitly required.
  1. Initialization and auth state handling
  • UI/runtime waits for Clerk.isInitialized.
  • Auth/session/user state derives from Clerk flows.
  1. Capability-driven behavior
  • Flow branches align with runtime capabilities and dashboard configuration.
  • No hardcoded factor/provider matrix independent of Clerk state.
  1. Multi-step auth quality
  • Flow uses explicit steps with clear transitions.
  • Required fields and verifications are fully covered.
  1. Architecture quality
  • UI, orchestration, and Clerk integration are separated into focused files/modules.
  1. OAuth/social correctness
  • OAuth handling uses Clerk APIs and supported provider paths.

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill provides safe and standard instructions for integrating Clerk authentication into native Android applications using official SDKs and documentation.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    3/4 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at dbc2e14. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 6 months ago
What it can do
Network
metadata
{
  "author": "clerk",
  "version": "1.2.0"
}
compatibility
Requires Android Studio and clerk-android Gradle dependency
All 1 allowed tools
WebFetch
  • android
  • kotlin
  • jetpack-compose
  • clerk
  • authentication
  • native-mobile
  • auth-ui

README badge

README badge for clerk/skills/clerk-android

Implements Clerk authentication in native Android apps using the clerk-android SDK with Kotlin and Jetpack Compose, supporting both prebuilt AuthView/UserButton components and custom API-driven flows. Does not work with Expo or React Native projects.

Generated from the current SKILL.md.

Does this skill work with Expo or React Native?
No. This skill is for native Android projects only. For Expo or React Native, use the general Clerk setup skill instead.
What are the two auth flow options?
Prebuilt flow uses AuthView and UserButton components for fastest setup. Custom flow gives full control over the auth UI and sequencing by calling the Clerk API directly.
Do I need a publishable key to use this skill?
Yes. The skill requires a real Clerk publishable key and will ask for it before making any implementation changes.
Which Gradle dependency should I add?
For prebuilt flow, add clerk-android-ui (which includes the API). For custom flow, add clerk-android-api unless you also need prebuilt components.
What Android setup does this skill verify?
The skill checks that the Clerk Native API is enabled, minimum SDK and Java version match requirements, internet permission is in the manifest, and app-level Clerk initialization is in place before auth is used.

Generated from the current SKILL.md. These answers refresh after source changes.