Agent skill

Clerk Swift

by geekskai in geekskai/blog

Implement Clerk authentication for native Swift and iOS apps using ClerkKit and ClerkKitUI source-guided patterns.

MITAuto-check passedMobile

Install Clerk Swift

skills CLI
$ npx skills add geekskai/blog --skill clerk-swift -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install geekskai/blog clerk-swift --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/geekskai/blog.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/clerk-swift .claude/skills/clerk-swift && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
clerk-swift
GitHub stars
103
Token cost
~3k tokens
SKILL.md length
1,348 words
Files
3 (incl. references)
Skills in repo
20
Repo updated
First seen
Licence
MIT

At a glance

Implement Clerk authentication for native Swift and iOS apps using ClerkKit and ClerkKitUI source-guided patterns.

  • Works in 12 steps: Detect native iOS/Swift vs Expo/React… → If flow type is not explicitly provided,… → If publishable key is not explicitly… → …
  • Prebuilt AuthView
  • SKILL.md covers Activation Rules, What Do You Need?, Quick Start and Decision Tree, plus 7 more sections
  • Reaches clerk.com and github.com

What it does

Clerk Swift is an agent skill from geekskai/blog. 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.

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/custom.md` and `references/prebuilt.md`). Compatibility notes: Requires Xcode and ClerkKit Swift package

It sits in Mobile, covering iOS development and Cross-platform mobile apps. It works with Expo, React Native and iOS. The repository describes itself as: 🚀 2026 Most Popular FREE Blog Template! Next.js 14, Zero Code - Just Write & Deploy | 2026最火免费博客模板!支持Markdown,一键部署,极致性能!⚡️ ✨ Write in Markdown, get your professional blog in…. The licence is MIT.

When your agent uses it

  • Prebuilt AuthView
  • Custom native flows
  • React Native projects

Example prompts

  • “/clerk-swift”

Requirements

  • Compatibility (from SKILL.md): Requires Xcode and ClerkKit Swift package
  • Pre-approved tools (allowed-tools): WebFetch

Workflow steps

12 steps, taken from the first numbered list in SKILL.md.

  1. Detect native iOS/Swift vs Expo/React Native.
  2. If flow type is not explicitly provided, ask user for prebuilt or custom.
  3. If publishable key is not explicitly provided, ask user for it.
  4. Wait for both answers before changing files.
  5. Load matching flow reference file.
  6. Ensure publishable key is valid and directly wired in Clerk.configure.
  7. Ensure package install/products match selected flow and package requirement follows latest up-to-next-major policy when newly added.
  8. Inspect installed ClerkKitUI source to map Environment fields used for gating/required behavior in the selected flow.
  9. Call /v1/environment and interpret response through the step 8 field map.
  10. Find iOS quickstart URL from installed clerk-ios package README, append .md, then visit and read it.
  11. Build quickstart checklist from the visited markdown quickstart, detect missing required setup, and apply the missing setup in the current…
  12. Ensure the quickstart associated-domain capability step is fully applied (webcredentials:{YOUR_FRONTEND_API_URL} when missing).

What it can do on your machine

Read from SKILL.md and the folder at commit e5554c5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • WebFetch

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • clerk.com
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires Xcode and ClerkKit Swift package

    From compatibility in the SKILL.md frontmatter.

Context cost

Clerk Swift loads about 3k tokens when it runs, and up to ~5.8k if it reads all its reference files. Until then it costs about 56 tokens; SKILL.md has 1,348 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~56
When it runs · the whole SKILL.md, loaded when a task matches
~3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from geekskai/blog at commit e5554c5, republished under its MIT licence (© geekskai). 1,348 words, ~3,016 tokens.

Download SKILL.mdSave it as .claude/skills/clerk-swift/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
clerk-swift
description
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.
allowed-tools
WebFetch
compatibility
Requires Xcode and ClerkKit Swift package
license
MIT
metadata.author
clerk
metadata.version
1.2.0

Clerk Swift (Native iOS)

This skill implements Clerk in native Swift/iOS projects by reading installed package source and mirroring current ClerkKit/ClerkKitUI behavior.

Activation Rules

Activate this skill when either condition is true:

  • The user explicitly asks for Swift, SwiftUI, UIKit, or native iOS Clerk implementation.
  • The project appears to be native iOS/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.

What Do You Need?

TaskReference
Prebuilt AuthView / UserButton (fastest)references/prebuilt.md
Custom API-driven auth flows (full control)references/custom.md

Quick Start

StepAction
1Confirm project type is native Swift/iOS and not Expo/React Native
2Determine flow type (prebuilt or custom) and load the matching reference file
3Ensure a valid publishable key exists (or ask developer) and wire it directly in configuration
4Ensure 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
5Inspect installed ClerkKitUI source to identify which Environment fields drive feature/step gating
6Call /v1/environment after step 5 and evaluate only against the ClerkKitUI-aligned field map
7Find 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
8Verify and complete all quickstart prerequisites for this project (for example associated domains and required capabilities)
9Implement flow by following only the selected reference checklist

Decision Tree

text
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

Flow References

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.

Interaction Contract

Before any implementation edits, the agent must have both:

  • flow choice: prebuilt or custom
  • 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 installed package source before implementing.

Use CaseSource of Truth in Installed Package
SDK package products, platform support, and dependency constraintsPackage manifest and target product definitions for ClerkKit and ClerkKitUI, plus package requirement style (up-to-next-major)
Publishable key validation and frontend API derivationClerk configuration logic (search symbols: configure(publishableKey, frontendApiUrl, invalidPublishableKeyFormat)
Environment endpoint contract and field semanticsEnvironment 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 requirementsInstalled clerk-ios package README quickstart link plus the visited/read quickstart page checklist steps (including project setup prerequisites)
Native Sign in with Apple implementationApple capability and native sign-in behavior in selected flow reference

Execution Gates (Do Not Skip)

  1. No implementation edits before prerequisites
  • Do not edit project files until flow type is confirmed and a valid publishable key is available.
  1. 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.
  1. Publishable key wiring mode is mandatory
  • Use the developer-provided publishable key plainly in app configuration passed to Clerk.configure.
  • Do not introduce plist/local-secrets/env-file/build-setting indirection unless explicitly requested.
  1. Package install/version policy is mandatory
  • If clerk-ios is not installed, add it using the latest available release with an up-to-next-major requirement.
  • Do not pin an exact package version unless the developer explicitly asks for exact pinning.
  1. ClerkKitUI Environment field inspection is mandatory
  • After package install, inspect installed ClerkKitUI source and identify which Environment fields gate auth behavior for the selected flow.
  • Build an agent-internal field map before any /v1/environment call.
  1. Environment call is mandatory (both flows)
  • Make a direct HTTP call to /v1/environment only after package install and step 5 field-map inspection.
  • Pass the response into the selected reference workflow using the ClerkKitUI-aligned field map:
    • prebuilt: use it to determine whether Apple is enabled and capability changes are needed
    • custom: perform full normalization/matrix handling as agent-internal analysis only (never persist matrix artifacts in project code)
  1. Reference-file discipline is mandatory
  • Once flow is selected, follow only that flow reference file for implementation and verification.
  1. Quickstart compliance is mandatory
  • Find the iOS quickstart URL in the installed clerk-ios package README, append .md, then visit and read that markdown URL.
  • Audit the project against all quickstart setup steps before finishing.
  • If required quickstart setup is missing, implement it before completing the task.
  • This includes adding any missing Associated Domains entries and any other required app capabilities from the quickstart.
  • Explicitly execute the quickstart step 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}).
  1. Custom-flow AuthView structure parity is mandatory
  • For custom flow, layout and flow structure must remain materially close to ClerkKitUI AuthView defaults.
  • If the developer did not explicitly request a different UX, do not introduce major structural/layout deviations from AuthView.
  • If unsure/confused about custom sequencing, gating, or Environment usage/semantics, defer to installed ClerkKitUI behavior and mirror it.
Show full SKILL.md (468 more words)Show less

Workflow

  1. Detect native iOS/Swift vs Expo/React Native.
  2. If flow type is not explicitly provided, ask user for prebuilt or custom.
  3. If publishable key is not explicitly provided, ask user for it.
  4. Wait for both answers before changing files.
  5. Load matching flow reference file.
  6. Ensure publishable key is valid and directly wired in Clerk.configure.
  7. Ensure package install/products match selected flow and package requirement follows latest up-to-next-major policy when newly added.
  8. Inspect installed ClerkKitUI source to map Environment fields used for gating/required behavior in the selected flow.
  9. Call /v1/environment and interpret response through the step 8 field map.
  10. Find iOS quickstart URL from installed clerk-ios package README, append .md, then visit and read it.
  11. Build quickstart checklist from the visited markdown quickstart, detect missing required setup, and apply the missing setup in the current project.
  12. Ensure the quickstart associated-domain capability step is fully applied (webcredentials:{YOUR_FRONTEND_API_URL} when missing).
  13. Implement using selected reference checklist.
  14. Verify using selected reference checklist plus shared gates.

Common Pitfalls

LevelIssuePrevention
CRITICALNot asking for missing flow choice before implementationAsk for prebuilt vs custom and wait before edits
CRITICALNot asking for missing publishable key before implementationAsk for key and wait before edits
CRITICALStarting implementation before flow type is confirmedConfirm flow first and load matching reference
CRITICALUsing plist/local/env indirection for publishable key without requestWire key directly in configuration by default
CRITICALSkipping /v1/environment call before implementationAlways call environment endpoint for both prebuilt and custom flows
CRITICALCalling /v1/environment before package install + ClerkKitUI Environment field inspectionInstall clerk-ios first, inspect ClerkKitUI Environment usage, then call endpoint
HIGHInstalling clerk-ios with exact/stale version by defaultIf missing, install latest available release using up-to-next-major requirement
CRITICALSkipping quickstart prerequisite auditVisit/read quickstart URL from installed clerk-ios package README and verify all required setup steps are completed
CRITICALDetecting missing quickstart capabilities/domains but not applying themAdd all missing required quickstart capabilities and Associated Domains before completing
CRITICALSkipping quickstart associated-domain capability stepExecute quickstart Add associated domain capability and ensure webcredentials:{YOUR_FRONTEND_API_URL} is present
CRITICALWriting capability/required-field matrices into app codeKeep matrices agent-internal and only apply resulting behavior in UI/auth flow code
CRITICALCustom flow layout diverges from AuthView without explicit requestKeep custom screens materially close to AuthView structure and step composition by default
CRITICALCollapsing custom auth into a single all-fields screenFollow AuthView-style multi-step progression and step-specific field collection
CRITICALGuessing custom sequencing/gating/Environment usage when uncertainReference installed ClerkKitUI behavior and mirror it for final implementation
HIGHUsing this skill for Expo/React NativeDetect and route away before implementation

See Also

  • clerk skill for top-level Clerk routing
  • clerk-setup skill for non-native or cross-framework setup
  • installed clerk-ios package README.md (source for current iOS quickstart link)
  • https://github.com/clerk/clerk-ios

© geekskai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in .agents/skills/clerk-swift of geekskai/blog.

  • SKILL.md
  • references/custom.md
  • references/prebuilt.md

Open the folder on GitHubat commit e5554c5

Compare with similar skills

Clerk Swift next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Clerk Swift compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Clerk Swift this skillgeekskai/blog103—~3kAutomated safety check: PassMIT
Expo Brownfield Integrationmweinbach/agent-coworker1562 repos~900Automated safety check: NotesCustom licence
Expo UIarcboxlabs/linkcode156—~1.2kAutomated safety check: PassMIT
React Native Healthkit Contributingkingstinct/react-native-healthkit716—~1.3kAutomated safety check: PassMIT
Web To Mobilesuntay44/web-to-mobile-magic-plugin108—~781Automated safety check: PassMIT
Mobile Devcallstackincubator/codex-mobile-dev-plugin150—~5.5kAutomated safety check: PassNone

Similar skills

  • Expo Brownfield Integration

    mweinbach/agent-coworker

    Helps add Expo and React Native to an existing native iOS or Android app, and choose between a prebuilt AAR or XCFramework and a fully integrated build.

    156 GitHub starsUsed in 2 repos~900 tokens
    MobileAuto-check: notes
  • Expo UI

    arcboxlabs/linkcode

    Framework (OSS). An agent skill from arcboxlabs/linkcode.

    156 GitHub stars~1.2k tokensUpdated 11 days ago
    MobileAuto-check passed
  • React Native Healthkit Contributing

    kingstinct/react-native-healthkit

    How to change the react-native-healthkit monorepo itself (packages/core, packages/react-native-healthkit, packages/health-records, apps/example).

    716 GitHub stars~1.3k tokensUpdated 2 days ago
    MobileAuto-check passed
  • Web To Mobile

    suntay44/web-to-mobile-magic-plugin

    Orchestrate website or web app conversion into a mobile app.

    108 GitHub stars~781 tokensUpdated 26 days ago
    MobileAuto-check passed
  • Mobile Dev

    callstackincubator/codex-mobile-dev-plugin

    Official

    A skill your agent uses when building, running, changing, or debugging local iOS, Android, Expo, React Native, or SwiftUI apps.

    150 GitHub stars~5.5k tokensUpdated yesterday
    MobileAuto-check passed
  • Iphone Duo React Native

    mirzaaghazadeh/iphone-duo-skills

    Adapt a React Native or Expo app to iPhone Duo, Apple's first foldable iPhone — asymmetric safe area insets, resize handling, and how to expose the iOS 27.1 reserved-region and hinge APIs through a…

    144 GitHub stars~1.5k tokensUpdated 2 days ago
    MobileAuto-check passed

More from geekskai/blog

All 20 skills in this repo
  • React SPA auth patterns with @clerk/react for Vite/CRA - ClerkProvider setup, useAuth/useUser/useClerk hooks, React Router protected routes, custom sign-in flows.

    103 GitHub starsUsed in 1 repo~1k tokens
    Auto-check: notes
  • React Router v7/v8 patterns with Clerk — rootAuthLoader, getAuth in loaders, clerkMiddleware, protected routes, SSR user data, org switching.

    103 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • TanStack React Start auth patterns with @clerk/tanstack-react-start - createServerFn, beforeLoad guards, loaders, Vinxi server.

    103 GitHub starsUsed in 1 repo~875 tokens
    Auto-check: notes
  • Clerk Android

    geekskai/blog

    Implement Clerk authentication for native Android apps using Kotlin and Jetpack Compose with clerk-android source-guided patterns.

    103 GitHub stars~2.1k tokensUpdated 2 days ago
    Auto-check passed
  • Astro patterns with Clerk — middleware, SSR pages, island components, API routes, static vs SSR rendering.

    103 GitHub stars~822 tokensUpdated 2 days ago
    Auto-check: notes
  • Clerk Billing

    geekskai/blog

    Clerk Billing for subscription management - render Clerk's PricingTable and in-app checkout drawer, configure subscription plans, seat-limit plans for B2B, feature entitlements with has(), and…

    103 GitHub stars~5.1k tokensUpdated 2 days ago
    Auto-check passed

Categories

Questions about Clerk Swift

What does Clerk Swift do?

Implement Clerk authentication for native Swift and iOS apps using ClerkKit and ClerkKitUI source-guided patterns. Clerk Swift is an agent skill from geekskai/blog. Implement Clerk authentication for native Swift and iOS apps using ClerkKit and ClerkKitUI source-guided patterns.

When should I use Clerk Swift?

Clerk Swift fits situations like: prebuilt AuthView; custom native flows; React Native projects.

How do I install Clerk Swift in Claude Code?

Run `npx skills add geekskai/blog --skill clerk-swift -a claude-code`. Or copy the skill folder (.agents/skills/clerk-swift in geekskai/blog) into .claude/skills/clerk-swift in your project. Claude Code loads it when a task matches its description.

How do I install Clerk Swift in Codex?

Run `npx skills add geekskai/blog --skill clerk-swift -a codex`. Or copy the skill folder (.agents/skills/clerk-swift in geekskai/blog) into .agents/skills/clerk-swift in your project. Codex loads it when a task matches its description.

Can I use Clerk Swift in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add geekskai/blog --skill clerk-swift -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/clerk-swift, .gemini/skills/clerk-swift, .github/skills/clerk-swift and .opencode/skills/clerk-swift in your project.

What does Clerk Swift need to run?

SKILL.md names no scripts, command-line tools or credentials: Clerk Swift is instructions for the agent only. Its frontmatter pre-approves these tools: WebFetch. Compatibility (from SKILL.md): Requires Xcode and ClerkKit Swift package.

Does Clerk Swift access the network?

SKILL.md names 2 domains. In commands or code: clerk.com and github.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Clerk Swift safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Clerk Swift use?

Clerk Swift is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Clerk Swift use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.7k tokens, read only when the agent opens those files.

What are the alternatives to Clerk Swift?

Skills that share tags, products or a category with Clerk Swift: Expo Brownfield Integration (mweinbach/agent-coworker, 156 stars), Expo UI (arcboxlabs/linkcode, 156 stars), React Native Healthkit Contributing (kingstinct/react-native-healthkit, 716 stars) and Web To Mobile (suntay44/web-to-mobile-magic-plugin, 108 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Clerk Swift?

geekskai (a GitHub user) maintains it in geekskai/blog, which has 103 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on October 7, 2026.

Source: geekskai/blog on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.