ronjunevaldoz/kmp-agent-skills/kmp-biometric-auth
Claude Code and agent skill by ronjunevaldoz/kmp-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Biometric authentication for Kotlin Multiplatform — a sealed BiometricResult type in commonMain, expect/actual BiometricAuthenticator, Android BiometricPrompt with CryptoObject, iOS LocalAuthentication (LAContext.evaluatePolicy), Koin wiring, and graceful fallback to device PIN/password when biometrics are unavailable.
Install
npx vskill@latest install ronjunevaldoz/kmp-agent-skills/kmp-biometric-authSKILL.md
The same SKILL.md was published earlier as ronjunevaldoz/kmp-agent-skills/kmp-biometric-auth.
When to Use This Skill
Use when:
- Protecting a sensitive action (payment, delete, settings change) with biometric authentication
- Logging in with fingerprint or Face ID instead of a password
- Unlocking stored credentials from the device keystore after biometric verification
- Falling back to device PIN/password when biometrics are unavailable or not enrolled
Trigger keywords: biometric, biometric auth, fingerprint, Face ID, Touch ID, BiometricPrompt, LocalAuthentication, LAContext, biometric result, device credential, biometric unlock, secure auth KMP, expect actual biometric, CryptoObject, biometric fallback.
Freshness rule: androidx.biometric:biometric 1.2+ supports BiometricManager for capability checking before showing the prompt. The BiometricPrompt API is in androidx.fragment; the CryptoObject path requires a FragmentActivity. iOS 17+ deprecated kLAPolicyDeviceOwnerAuthenticationWithBiometrics for some flows — verify against the latest Apple docs when targeting iOS 17+.
Recommendation First
Define BiometricResult in commonMain and use expect/actual BiometricAuthenticator to isolate platform APIs. The ViewModel calls the authenticator and reacts to the result — it never imports BiometricPrompt or LAContext. Always check availability before showing a biometric prompt; show a clear error if neither biometrics nor device credentials are enrolled.
Core types — commonMain
expect/actual BiometricAuthenticator
Android implementation
iOS implementation
ViewModel
Koin wiring
Testing
Common Anti-Patterns
- Calling `BiometricPrompt` directly in a ViewModel — ViewModel is in
commonMain;
BiometricPrompt is Android-only; use the expect/actual BiometricAuthenticator
- Not checking `canAuthenticate()` before showing the prompt — on devices without
enrolled biometrics the prompt either shows nothing or shows an error; check first and fall back gracefully
- Blocking the main thread in iOS `evaluatePolicy` —
evaluatePolicycalls its
completion block on a background queue; suspendCoroutine handles this correctly, but never wrap the callback in a runBlocking
- Using `BiometricStrength.Weak` for sensitive actions — class 2 (weak) biometrics
(face unlock on low-end Android) should not gate payment or credential flows; use BiometricStrength.Strong for any security-sensitive prompt
- No fallback for `NotEnrolled` — users who haven't set up biometrics need a clear
message directing them to device settings, not a silent failure
Related Skills
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/kmp-biometric-auth/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ronjunevaldoz/kmp-agent-skills/kmp-biometric-auth)