Loading...
Loading...
Implement Clerk authentication for native Swift and iOS apps using ClerkKit and ClerkKitUI source-guided patterns. Use for prebuilt AuthView or custom native flows. Do not use for Expo or React Native projects.
npx skill4agent add clerk/skills clerk-swift.xcodeproj.xcworkspacePackage.swift| Step | Action |
|---|---|
| 1 | Confirm project type is native Swift/iOS and not Expo/React Native |
| 2 | Determine flow type ( |
| 3 | Ensure a valid publishable key exists (or ask developer) and wire it directly in configuration |
| 4 | Ensure |
| 5 | Inspect installed |
| 6 | Call |
| 7 | Find the iOS quickstart URL in the installed |
| 8 | Verify and complete all quickstart prerequisites for this project (for example associated domains and required capabilities) |
| 9 | Implement flow by following only the selected reference checklist |
User asks for Clerk in Swift/iOS
|
+-- Expo/React Native project detected?
| |
| +-- YES -> Do not use this skill
| |
| +-- NO -> Continue
|
+-- Existing auth UI detected?
| |
| +-- Prebuilt views detected -> Load references/prebuilt.md
| |
| +-- Custom flow detected -> Load references/custom.md
| |
| +-- New implementation -> Ask developer prebuilt/custom, then load matching reference
|
+-- Ensure publishable key and direct wiring
|
+-- Ensure clerk-ios is installed
|
+-- Inspect ClerkKitUI Environment field usage
|
+-- Call /v1/environment using that field map
|
+-- Visit/read quickstart URL from installed clerk-ios package README
|
+-- Verify all quickstart prerequisites are completed
|
+-- Implement using selected flow referenceprebuiltcustom| Use Case | Source of Truth in Installed Package |
|---|---|
| SDK package products, platform support, and dependency constraints | Package manifest and target product definitions for |
| Publishable key validation and frontend API derivation | Clerk configuration logic (search symbols: |
| Environment endpoint contract and field semantics | Environment request path and request construction plus |
| iOS quickstart requirements | Installed |
| Native Sign in with Apple implementation | Apple capability and native sign-in behavior in selected flow reference |
Clerk.configureclerk-iosClerkKitUIEnvironment/v1/environment/v1/environmentClerkKitUIclerk-ios.mdAdd associated domain capabilityhttps://clerk.com/docs/ios/getting-started/quickstart#add-associated-domain-capabilitywebcredentials:{YOUR_FRONTEND_API_URL}customAuthViewAuthViewEnvironmentClerkKitUIprebuiltcustomClerk.configureClerkKitUIEnvironment/v1/environmentclerk-ios.mdwebcredentials:{YOUR_FRONTEND_API_URL}| Level | Issue | Prevention |
|---|---|---|
| CRITICAL | Not asking for missing flow choice before implementation | Ask for |
| CRITICAL | Not asking for missing publishable key before implementation | Ask for key and wait before edits |
| CRITICAL | Starting implementation before flow type is confirmed | Confirm flow first and load matching reference |
| CRITICAL | Using plist/local/env indirection for publishable key without request | Wire key directly in configuration by default |
| CRITICAL | Skipping | Always call environment endpoint for both prebuilt and custom flows |
| CRITICAL | Calling | Install |
| HIGH | Installing | If missing, install latest available release using up-to-next-major requirement |
| CRITICAL | Skipping quickstart prerequisite audit | Visit/read quickstart URL from installed |
| CRITICAL | Detecting missing quickstart capabilities/domains but not applying them | Add all missing required quickstart capabilities and Associated Domains before completing |
| CRITICAL | Skipping quickstart associated-domain capability step | Execute quickstart |
| CRITICAL | Writing capability/required-field matrices into app code | Keep matrices agent-internal and only apply resulting behavior in UI/auth flow code |
| CRITICAL | Custom flow layout diverges from | Keep custom screens materially close to |
| CRITICAL | Collapsing custom auth into a single all-fields screen | Follow |
| CRITICAL | Guessing custom sequencing/gating/ | Reference installed |
| HIGH | Using this skill for Expo/React Native | Detect and route away before implementation |
../clerk/SKILL.md../setup/SKILL.mdclerk-iosREADME.mdhttps://github.com/clerk/clerk-ios