- Installs
- 15.2K
- Last 24h
- +50
- Trending rank
- #3345
- Security
- Warn
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/clerk/skills --skill clerk-swift- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads clerk-swift automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
Security audits
Independent scans of the skill's instructions and bundled files, each dated to when it ran.
SKILL.md
The instructions your agent reads when the skill is triggered.
Clerk Swift (Native iOS and macOS)
This skill builds Clerk authentication UI in native Swift projects: prebuilt ClerkKitUI views or custom flows on ClerkKit. Setup (SDK, capabilities, native registration, and Clerk initialization) comes first and has its own workflow.
Activation Rules
Activate this skill when either condition is true:
- The user explicitly asks for Swift, SwiftUI, UIKit, or native iOS or macOS Clerk implementation.
- The project appears to be native Swift (for example
.xcodeproj,.xcworkspace,Package.swift, Swift targets).
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 of this one.
Set up Clerk first
If Clerk isn't set up yet (no clerk-ios package, no Clerk.configure call, or no Clerk application chosen), follow the iOS setup prompt before any UI work. It uses the Clerk CLI to choose a Clerk application, install the SDK, configure capabilities, register the native app, and hand off the remaining Swift integration. The CLI also supplies the publishable key, so don't ask the user to paste one.
If the CLI can't set up the project (for example, Xcode isn't available or the project isn't supported), follow the manual iOS quickstart instead.
If the user already asked for sign-in UI, such as a custom flow, continue here once setup's build check passes. Otherwise, return to this skill when the user wants sign-in UI added or changed.
What Do You Need?
| Task | Reference |
|---|---|
| Prebuilt AuthView / UserButton (fastest) | references/prebuilt.md |
| Custom API-driven auth flows (full control) | references/custom.md |
Quick Start
| Step | Action |
|---|---|
| 1 | Confirm the project is native Swift and not Expo/React Native |
| 2 | If Clerk isn't set up, follow the iOS setup prompt first (see above) |
| 3 | Determine the flow type (prebuilt or custom); ask if it's undecided, then load the matching reference |
| 4 | Check the prerequisites the selected flow needs, such as a package product or capability, and make only the targeted changes that are missing |
| 5 | Implement the flow by following the selected reference |
| 6 | Build the target and report what remains unverified |
Decision Tree
User asks for Clerk in Swift
|
+-- Expo/React Native project detected?
| |
| +-- YES -> Do not use this skill
| |
| +-- NO -> Continue
|
+-- Clerk set up in this project?
| |
| +-- NO -> Follow the iOS setup prompt (manual quickstart if the CLI can't)
| |
| +-- YES -> 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
|
+-- Make targeted prerequisite changes for the selected flow
|
+-- Implement using selected flow reference
Flow References
After flow type is known, load exactly one:
- Prebuilt flow: references/prebuilt.md
- Custom flow: references/custom.md
Do not blend the two references in a single implementation unless the developer explicitly asks for a hybrid approach.
Interaction Contract
Before UI implementation edits, the agent must have a flow choice: prebuilt or custom. If it's missing, ask the user and wait for the answer. Only skip asking when the user has already chosen in this conversation or the existing UI makes the choice clear.
Preserve Completed Setup
- Keep the existing
Clerk.configurecall and how the app loads its publishable key, including plist, build-setting, or other custom key loading. Don't replace it with a hardcoded key. - Keep existing package requirements, capabilities, and entitlements. Add only what the selected flow needs and is missing.
- To check Clerk and project setup without changing anything, run
npx -y clerk@latest doctor. It reports SDK linkage, capabilities, native registration, and the Apple connection.
Source-Driven Implementation
Use the installed clerk-ios package source as the reference for UI behavior, especially for custom flows.
| Use Case | Source of Truth in Installed Package |
|---|---|
| SDK products, platform support, and dependency constraints | Package manifest and target product definitions for ClerkKit and ClerkKitUI |
| Auth flow sequencing and gating | ClerkKitUI AuthView implementation and how it reads the injected Clerk instance's environment |
| Native Sign in with Apple | Apple sign-in behavior in the selected flow reference |
Workflow
- Detect native Swift vs Expo/React Native.
- If Clerk isn't set up, follow the iOS setup prompt (or the manual quickstart when the CLI can't set up the project), then continue.
- If the flow type isn't known, ask for
prebuiltorcustom. - Load the matching flow reference.
- Check that flow's prerequisites and make only the missing, targeted changes, preserving completed setup and custom key loading.
- Implement using the selected reference.
- Verify using the selected reference, then build the target.
Common Pitfalls
| Level | Issue | Prevention |
|---|---|---|
| CRITICAL | Doing setup by hand when Clerk isn't set up | Follow the iOS setup prompt; it runs the Clerk CLI. Use the manual quickstart only when the CLI can't set up the project |
| CRITICAL | Asking the user to paste a publishable key | The CLI provides it during setup; keep an existing app's own key loading |
| CRITICAL | Replacing custom key loading or existing setup | Keep the existing Clerk.configure, packages, and capabilities; add only what's missing |
| CRITICAL | Starting UI implementation before the flow type is confirmed | Confirm the flow first and load the matching reference |
| 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 or gating when uncertain | Reference installed ClerkKitUI behavior and mirror it |
| HIGH | Hardcoding this instance's current settings into custom flow code | Gate steps at runtime from the injected Clerk instance's environment, as AuthView does |
| HIGH | Using this skill for Expo/React Native | Detect and route away before implementation |
See Also
- iOS setup prompt for setting up Clerk with the Clerk CLI
clerkskill for top-level Clerk routingclerk-setupskill for non-native or cross-framework setuphttps://github.com/clerk/clerk-ios
FAQ
What does the clerk-swift skill do?
Implement Clerk authentication UI in native Swift apps on iOS and macOS with ClerkKitUI prebuilt views or custom ClerkKit flows. Set up Clerk first with the iOS setup prompt, which uses the Clerk CLI. Do not use for Expo or React Native projects.
How do I install clerk-swift?
Run npx skills add https://github.com/clerk/skills --skill clerk-swift in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/clerk-swift/ (personal) or .claude/skills/clerk-swift/ (project).
Which AI agents can use clerk-swift?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is clerk-swift safe to install?
Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk flagged items to review; Runlayer flagged items to review; ZeroLeaks passed. As with any skill, read the SKILL.md and bundled scripts before installing.
Who maintains clerk-swift?
It is published by clerk in clerk/skills, and it is an official skill from the maker of the technology it covers. It has 15,173 recorded installs.
More from clerk/skills
clerk-setup
clerk/skills
Set up Clerk authentication in any project with the Clerk CLI and official framework quickstarts. Use when adding Clerk, initializing Clerk, scaffolding a new app with Clerk, or migrating an existing authentication system to Clerk.
clerk-custom-ui
clerk/skills
Custom authentication flows and component appearance - hooks (useSignIn, useSignUp), themes, colors, fonts, CSS. Use for custom sign-in/sign-up flows, appearance styling, visual customization, branding.
clerk-backend-api
clerk/skills
Clerk Backend REST API explorer and executor. Browse tags, inspect endpoint schemas, and execute authenticated requests. Use when listing users, managing organizations, or calling any Clerk API endpoint.
clerk-nextjs-patterns
clerk/skills
Advanced Next.js patterns - middleware, Server Actions, caching with Clerk.
clerk-webhooks
clerk/skills
Clerk webhooks for real-time events and data syncing. Verify with verifyWebhook from the framework-specific package. Handle user, session, organization, billing, and payment events. Build event-driven features like database sync, notifications, and integrations.
clerk-orgs
clerk/skills
Clerk Organizations for B2B and multi-tenant apps - org switching, roles and permissions, verified domains, and enterprise SSO. Use for team workspaces, RBAC, org-scoped routing, member management. Also load this when a project treats teams, workspaces, tenants, or companies as its customers - shared accounts, inviting teammates, per-seat pricing, per-company data isolation - even when the words "organization" or "B2B" are never used.
Popular mobile skills
design-mobile-apps
designed-by-ai/skills
Design mobile app screens with Sleek, edit Sleek projects, and implement their designs in React Native or HTML.
ios-design
uizze.sh
Design and review iOS UI/UX for iPhone apps in SwiftUI, UIKit, or React Native. Use for mobile app design, screen redesigns, navigation flows, typography, forms, keyboard and safe-area layout, and accessibility checks. Apply Apple Human Interface Guidelines and consult real product references through the optional Uizze connection.
vercel-react-native-skills
vercel-labs/agent-skills
React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.
animate-expo
emilkowalski/skills
Build animations in React Native and Expo, making the decisions in the order that determines whether they feel right — should it animate, which thread it runs on, which properties, spring or timing, how the gesture hands off, how it degrades. Writes the implementation with Reanimated, Gesture Handler, Expo Router and expo-haptics. Use when animating anything in an Expo app, adding gestures, sheets, screen transitions, press feedback or haptics, or fixing motion that stutters on device. For web animation use animate.
write-swift
emilkowalski/skills
How to write modern Swift well — modeling with value types, Swift 6 data-race safety and approachable concurrency (@concurrent, main-actor-by-default, actors, task groups), protocols and generics (some vs any), API design, performance and ARC, Swift Testing, macros, and the modern language features agents don't know about yet. Use when writing, reviewing, or migrating Swift, or when a concurrency error, a hang, a data race, a retain cycle, or a performance problem needs fixing.
xcode-project-setup
firebase/agent-skills
Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).
