All skills
clerk avatar

/clerk-swift

@dbc2e14 official
by clerkclerk/skills83 stars
5

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.

Use this Skill: https://skilld.dev/gh/clerk/skills/clerk-swift

This session only. Nothing lands on disk.

referencesprebuilt.md

≈826 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Prebuilt Flow Reference (ClerkKitUI)

Use this file only when flow type is prebuilt.

Purpose

Implement native iOS auth with prebuilt ClerkKitUI components, defaulting to combined auth in a sheet.

Required Patterns

  1. Package products
  • If clerk-ios is not installed, add it using the latest available release with an up-to-next-major package requirement.
  • Do not pin an exact package version unless the developer explicitly requests version pinning.
  • Add ClerkKit and ClerkKitUI.
  1. Quickstart prerequisite audit
  • Find the iOS quickstart URL in the installed clerk-ios package README, append .md, then visit and read that markdown URL.
  • Build a checklist from the visited markdown quickstart and verify the current project completed all required setup.
  • If required setup is missing, add it before finishing prebuilt auth implementation.
  • Always add any missing Associated Domains entries and any other capabilities required by the quickstart.
  • Explicitly apply quickstart step Add associated domain capability (https://clerk.com/docs/ios/getting-started/quickstart#add-associated-domain-capability); ensure webcredentials:{YOUR_FRONTEND_API_URL} exists when missing.
  1. Environment check for Apple capability
  • Inspect installed ClerkKitUI source first to identify the Environment fields/semantics used for Apple availability.
  • Then call /v1/environment and evaluate Apple-enabled state using the same field semantics.
  • In prebuilt flow, do not build capability matrices; only use environment here for Apple capability handling.
  1. Signed-out entry pattern
  • Prefer UserButton with signedOutContent for signed-out entry affordance.
  • Use signed-out content action to open the auth sheet.
  1. Auth presentation pattern
  • Present AuthView() in a sheet by default.
  • Keep default combined behavior from AuthView() (no sign-in-only/sign-up-only override by default).
  • Do not use full-screen replacement or push navigation by default unless explicitly requested.
  1. Apple capability requirement
  • If Apple is enabled in the environment and the app is missing Sign in with Apple capability, add it.

Verification Checklist

  1. Quickstart prerequisites are complete
  • Quickstart link was sourced from installed clerk-ios package README, .md was appended, and the markdown page was visited/read.
  • Required project setup from quickstart is present.
  • Any missing quickstart-required Associated Domains/capabilities were added, not just reported.
  • Quickstart Add associated domain capability step was applied, including webcredentials:{YOUR_FRONTEND_API_URL}.
  1. Default entry is prebuilt + sheet
  • Signed-out state uses UserButton(signedOutContent:) (or explicitly approved alternative).
  • AuthView() is presented in .sheet.
  1. Environment check used for Apple enablement
  • Installed ClerkKitUI Environment field usage was inspected before calling /v1/environment.
  • /v1/environment response was used to determine Apple-enabled state using the same ClerkKitUI field semantics.
  1. No default sign-in-only/sign-up-only prebuilt mode
  • Default entry uses AuthView() behavior (combined).
  1. Apple capability when enabled
  • If environment enables Apple and capability was missing, Sign in with Apple capability is added.

Source: SKILL.md on GitHub

2 warnings16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill facilitates the integration of Clerk authentication into Swift and iOS projects. It contains instructions that discourage the use of secret management for public keys and implements a workflow that fetches and follows instructions from remote documentation to modify project settings and entitlements.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: MEDIUM · 2 issues

  • Runlayer7mo

    3/4 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at dbc2e14. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 6 months ago
What it can do
Network
metadata
{
  "author": "clerk",
  "version": "1.2.0"
}
compatibility
Requires Xcode and ClerkKit Swift package
All 1 allowed tools
WebFetch
  • swift
  • ios
  • swiftui
  • uikit
  • clerk
  • authentication
  • native
  • clerkkit

README badge

README badge for clerk/skills/clerk-swift

Implements Clerk authentication in native Swift and iOS apps using ClerkKit and ClerkKitUI, with support for prebuilt AuthView or custom native flows. Does not support Expo or React Native projects.

Generated from the current SKILL.md.

Does this skill work with Expo or React Native?
No. This skill is for native Swift and iOS projects only. Do not activate it for Expo or React Native; route to the general setup skill instead.
Do I need to provide a Clerk publishable key before implementation?
Yes. The skill will not proceed with file edits until you provide a valid publishable key. The key is wired directly into the Clerk.configure call without indirection.
Can I choose between prebuilt views and a custom auth flow?
Yes. The skill supports both prebuilt AuthView (fastest) and custom API-driven flows (full control). You must declare which one you want before implementation begins.
Will this skill handle associated domain setup for Sign in with Apple?
Yes. The skill reads the quickstart from the installed clerk-ios package, audits your project against all required steps, and applies missing setup including the associated domain capability with the correct webcredentials format.
Does this skill inspect my installed ClerkKit package?
Yes. It inspects the installed ClerkKit and ClerkKitUI source to map Environment field usage, determine required capabilities, and call the /v1/environment endpoint before implementation.

Generated from the current SKILL.md. These answers refresh after source changes.