Clerk Android (Native)
This skill implements Clerk in native Android projects by following current clerk-android SDK and docs patterns.
Activation Rules
Activate this skill when either condition is true:
- The user explicitly asks for Android, Kotlin, Jetpack Compose, or native mobile Clerk implementation on Android.
- The project appears to be native Android (for example
build.gradle(.kts)with Android plugins,AndroidManifest.xml,app/src/main/java, Compose UI files).
Do not activate this skill when either condition is true:
- The project is Expo.
- The project is React Native.
If Expo/React Native signals are present, route to the general setup skill instead.
What Do You Need?
Quick Start
Decision Tree
Flow References
After flow type is known, load exactly one:
- Prebuilt flow: references/prebuilt.md [blocked]
- Custom flow: references/custom.md [blocked]
Do not blend the two references in a single implementation unless the developer explicitly asks for a hybrid approach.
Interaction Contract
Before any implementation edits, the agent must have both:
- flow choice:
prebuiltorcustom - a real Clerk publishable key
If either value is missing from the user request/context:
- ask the user for the missing value(s)
- pause and wait for the answer
- do not edit files or install dependencies yet
Only skip asking when the user has already explicitly provided the value in this conversation.
Source-Driven Templates
Do not hardcode implementation examples in this skill. Inspect current clerk-android source/docs for the installed SDK version before implementing.
Execution Gates (Do Not Skip)
- No implementation edits before prerequisites
- Do not edit project files until flow type is confirmed and a valid publishable key is available.
- Missing flow or key must trigger a question
- If flow choice is missing, explicitly ask: prebuilt views or custom flow.
- If publishable key is missing/placeholder/invalid, explicitly ask for a real key.
- Do not continue until both answers are provided.
- Publishable key wiring mode is mandatory
- By default, wire the developer-provided key directly in
Clerk.initialize(...). - Do not introduce secret-management indirection unless explicitly requested.
- Artifact install policy is mandatory
- Prebuilt flow: use
clerk-android-ui(includes API). - Custom flow: use
clerk-android-apiunless prebuilt components are explicitly requested. - If Clerk artifacts are missing, add the latest stable release available.
- Android quickstart compliance is mandatory
- Verify Native API is enabled for the Clerk app.
- Verify Android requirements from quickstart are implemented in project (minimum SDK and Java target, manifest internet permission, app-level Clerk initialization).
- Verify app waits for SDK initialization (
Clerk.isInitialized) before assuming auth-ready state.
- Capability-driven behavior is mandatory
- Use Clerk runtime capability/settings state (for example enabled factors/social providers/MFA flags) to gate flow behavior.
- Do not hardcode factor assumptions that may conflict with dashboard configuration.
- Reference-file discipline is mandatory
- Once flow is selected, follow only that flow reference file for implementation and verification.
- Custom-flow structure parity is mandatory
- For
customflow, preserve multi-step auth progression and factor-specific handling (no single all-fields form by default). - Keep UI, state orchestration, and Clerk API integration in separate modules.
- Prebuilt preference is mandatory when selected
- For
prebuiltflow, do not rebuild auth forms with custom API calls unless explicitly requested. - Use
AuthView/UserButtonas default building blocks.
Workflow
- Detect native Android vs Expo/React Native.
- If flow type is not explicitly provided, ask user for
prebuiltorcustom. - If publishable key is not explicitly provided, ask user for it.
- Wait for both answers before changing files.
- Load matching flow reference file.
- Ensure
Clerk.initialize(...)path and publishable key wiring are valid. - Ensure dependencies/artifacts match selected flow.
- Review Android quickstart requirements and apply missing setup in project.
- Implement using selected reference checklist.
- Verify using selected reference checklist plus shared gates.
Common Pitfalls
See Also
clerkskill for top-level Clerk routingclerk-setupskill for cross-framework quickstart setuphttps://github.com/clerk/clerk-androidhttps://clerk.com/docs/android/getting-started/quickstart
