skills/clerk-swift/SKILL.md
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 skillsauth add awfixers-stuff/opencode-config clerk-swiftInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill implements Clerk in native Swift/iOS projects by reading installed package source and mirroring current ClerkKit/ClerkKitUI behavior.
Activate this skill when either condition is true:
.xcodeproj, .xcworkspace, Package.swift, Swift targets).Do not activate this skill when either condition is true:
If Expo/React Native signals are present, route to the general setup skill instead of this one.
| Task | Reference | |------|-----------| | Prebuilt AuthView / UserButton (fastest) | references/prebuilt.md | | Custom API-driven auth flows (full control) | references/custom.md |
| Step | Action |
|------|--------|
| 1 | Confirm project type is native Swift/iOS and not Expo/React Native |
| 2 | Determine flow type (prebuilt or custom) and load the matching reference file |
| 3 | Ensure a valid publishable key exists (or ask developer) and wire it directly in configuration |
| 4 | Ensure clerk-ios package is installed with correct products for selected flow; if missing, install latest available release using an up-to-next-major version requirement |
| 5 | Inspect installed ClerkKitUI source to identify which Environment fields drive feature/step gating |
| 6 | Call /v1/environment after step 5 and evaluate only against the ClerkKitUI-aligned field map |
| 7 | Find the iOS quickstart URL in the installed clerk-ios package README, append .md, then visit and read the markdown URL to compile a required-step checklist |
| 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 reference
After flow type is known, load exactly one:
Do not blend the two references in a single implementation unless the developer explicitly asks for a hybrid approach.
Before any implementation edits, the agent must have both:
prebuilt or customIf either value is missing from the user request/context:
Only skip asking when the user has already explicitly provided the value in this conversation.
Do not hardcode implementation examples in this skill. Inspect current installed package source before implementing.
| Use Case | Source of Truth in Installed Package |
|----------|--------------------------------------|
| SDK package products, platform support, and dependency constraints | Package manifest and target product definitions for ClerkKit and ClerkKitUI, plus package requirement style (up-to-next-major) |
| Publishable key validation and frontend API derivation | Clerk configuration logic (search symbols: configure(publishableKey, frontendApiUrl, invalidPublishableKeyFormat) |
| Environment endpoint contract and field semantics | Environment request path and request construction plus ClerkKitUI Environment field usage for gating (search symbols: /v1/environment, Request<Clerk.Environment>, Environment usage in ClerkKitUI) |
| iOS quickstart requirements | Installed clerk-ios package README quickstart link plus the visited/read quickstart page checklist steps (including project setup prerequisites) |
| Native Sign in with Apple implementation | Apple capability and native sign-in behavior in selected flow reference |
Clerk.configure.clerk-ios is not installed, add it using the latest available release with an up-to-next-major requirement.ClerkKitUI source and identify which Environment fields gate auth behavior for the selected flow./v1/environment call./v1/environment only after package install and step 5 field-map inspection.ClerkKitUI-aligned field map:
clerk-ios package README, append .md, then visit and read that markdown URL.Add associated domain capability (https://clerk.com/docs/ios/getting-started/quickstart#add-associated-domain-capability) and ensure the associated-domain entry matches quickstart requirements (webcredentials:{YOUR_FRONTEND_API_URL}).custom flow, layout and flow structure must remain materially close to ClerkKitUI AuthView defaults.AuthView.Environment usage/semantics, defer to installed ClerkKitUI behavior and mirror it.prebuilt or custom.Clerk.configure.ClerkKitUI source to map Environment fields used for gating/required behavior in the selected flow./v1/environment and interpret response through the step 8 field map.clerk-ios package README, append .md, then visit and read it.webcredentials:{YOUR_FRONTEND_API_URL} when missing).| Level | Issue | Prevention |
|-------|-------|------------|
| CRITICAL | Not asking for missing flow choice before implementation | Ask for prebuilt vs custom and wait before edits |
| 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 /v1/environment call before implementation | Always call environment endpoint for both prebuilt and custom flows |
| CRITICAL | Calling /v1/environment before package install + ClerkKitUI Environment field inspection | Install clerk-ios first, inspect ClerkKitUI Environment usage, then call endpoint |
| HIGH | Installing clerk-ios with exact/stale version by default | If missing, install latest available release using up-to-next-major requirement |
| CRITICAL | Skipping quickstart prerequisite audit | Visit/read quickstart URL from installed clerk-ios package README and verify all required setup steps are completed |
| 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 Add associated domain capability and ensure webcredentials:{YOUR_FRONTEND_API_URL} is present |
| 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 AuthView without explicit request | Keep custom screens materially close to AuthView structure and step composition by default |
| CRITICAL | Collapsing custom auth into a single all-fields screen | Follow AuthView-style multi-step progression and step-specific field collection |
| CRITICAL | Guessing custom sequencing/gating/Environment usage when uncertain | Reference installed ClerkKitUI behavior and mirror it for final implementation |
| HIGH | Using this skill for Expo/React Native | Detect and route away before implementation |
clerk skill for top-level Clerk routingclerk-setup skill for non-native or cross-framework setupclerk-ios package README.md (source for current iOS quickstart link)https://github.com/clerk/clerk-iosdevelopment
Use when starting dev servers, watchers, tilt, or any process expected to outlive the conversation. Provides zmx session management patterns for long-lived processes.
development
Zig testing skill for writing and running tests. Use when using zig build test, writing comptime tests, using test filters, working with test allocators to detect leaks, or using Zig's built-in fuzz testing (0.14+). Activates on queries about Zig tests, zig test, zig build test, comptime testing, test allocators, Zig fuzz testing, or detecting memory leaks in Zig tests.
development
Zig debugging skill. Use when debugging Zig programs with GDB or LLDB, interpreting Zig runtime panics, using std.debug.print for tracing, configuring debug builds, or debugging Zig programs in VS Code. Activates on queries about debugging Zig, Zig panics, zig gdb, zig lldb, std.debug.print, Zig stack traces, or Zig error return traces.
tools
Zig cross-compilation skill. Use when cross-compiling Zig programs to different targets, using Zig's built-in cross-compilation for embedded, WASM, Windows, ARM, or using zig cc to cross-compile C code without a system cross-toolchain. Activates on queries about Zig cross-compilation, zig target triples, zig cc cross-compile, Zig embedded targets, or Zig WASM.