clerk-swift by clerk/skills
npx skills add https://github.com/clerk/skills --skill clerk-swift此技能通过读取已安装的包源码并镜像当前 ClerkKit/ClerkKitUI 的行为,在原生 Swift/iOS 项目中实现 Clerk。
当满足以下任一条件时激活此技能:
.xcodeproj、.xcworkspace、Package.swift、Swift 目标)。当满足以下任一条件时不要激活此技能:
如果存在 Expo/React Native 信号,请路由到通用设置技能,而不是此技能。
| 步骤 | 操作 |
|---|---|
| 1 | 确认项目类型是原生 Swift/iOS 且非 Expo/React Native |
| 2 | 确定流程类型(prebuilt 或 )并加载匹配的参考文件 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
custom| 3 | 确保存在有效的可发布密钥(或询问开发者)并直接在配置中连接它 |
| 4 | 确保 clerk-ios 包已安装,且产品适用于所选流程;如果缺失,使用“up-to-next-major”版本要求安装最新的可用版本 |
| 5 | 检查已安装的 ClerkKitUI 源码,以确定哪些 Environment 字段驱动功能/步骤控制 |
| 6 | 在步骤 5 之后调用 /v1/environment,并仅根据与 ClerkKitUI 对齐的字段映射进行评估 |
| 7 | 在已安装的 clerk-ios 包 README 中找到 iOS 快速开始 URL,追加 .md,然后访问并读取该 Markdown URL 以编译必需步骤清单 |
| 8 | 验证并完成此项目的所有快速开始先决条件(例如关联域和必需的能力) |
| 9 | 仅按照选定的参考清单实现流程 |
用户要求 Swift/iOS 中的 Clerk
|
+-- 检测到 Expo/React Native 项目?
| |
| +-- 是 -> 不使用此技能
| |
| +-- 否 -> 继续
|
+-- 检测到现有认证 UI?
| |
| +-- 检测到预构建视图 -> 加载 references/prebuilt.md
| |
| +-- 检测到自定义流程 -> 加载 references/custom.md
| |
| +-- 新实现 -> 询问开发者选择 prebuilt/custom,然后加载匹配的参考
|
+-- 确保可发布密钥存在并直接连接
|
+-- 确保 clerk-ios 已安装
|
+-- 检查 ClerkKitUI Environment 字段使用情况
|
+-- 使用该字段映射调用 /v1/environment
|
+-- 访问/读取已安装 clerk-ios 包 README 中的快速开始 URL
|
+-- 验证所有快速开始先决条件是否已完成
|
+-- 使用选定的流程参考进行实现
确定流程类型后,精确加载其中一个:
除非开发者明确要求混合方法,否则不要在单个实现中混合这两个参考。
在进行任何实现编辑之前,代理必须同时拥有:
prebuilt 或 custom如果用户请求/上下文中缺少任一值:
仅当用户已在此对话中明确提供了该值时,才跳过询问。
不要在此技能中硬编码实现示例。在实现之前检查当前已安装的包源码。
| 用例 | 已安装包中的事实来源 |
|---|---|
| SDK 包产品、平台支持和依赖约束 | ClerkKit 和 ClerkKitUI 的包清单和目标产品定义,以及包要求样式(up-to-next-major) |
| 可发布密钥验证和前端 API 派生 | Clerk 配置逻辑(搜索符号:configure(publishableKey、frontendApiUrl、invalidPublishableKeyFormat) |
| 环境端点契约和字段语义 | 环境请求路径和请求构建,加上 ClerkKitUI 中用于控制的 Environment 字段使用(搜索符号:/v1/environment、Request<Clerk.Environment>、ClerkKitUI 中的 Environment 使用) |
| iOS 快速开始要求 | 已安装 clerk-ios 包 README 中的快速开始链接加上访问/读取的快速开始页面清单步骤(包括项目设置先决条件) |
| 原生“使用 Apple 登录”实现 | 所选流程参考中的 Apple 能力和原生登录行为 |
Clerk.configure 的应用配置中,直接使用开发者提供的可发布密钥。clerk-ios 未安装,使用最新的可用版本并采用“up-to-next-major”要求添加它。ClerkKitUI 源码,并确定哪些 Environment 字段为所选流程控制认证行为。/v1/environment 调用之前,构建一个代理内部的字段映射。/v1/environment。ClerkKitUI 对齐的字段映射将响应传递到选定的参考工作流中:
clerk-ios 包 README 中找到 iOS 快速开始 URL,追加 .md,然后访问并读取该 Markdown URL。添加关联域能力(https://clerk.com/docs/ios/getting-started/quickstart#add-associated-domain-capability),并确保关联域条目符合快速开始要求(webcredentials:{YOUR_FRONTEND_API_URL})。custom 流程,布局和流程结构必须在实质上接近 ClerkKitUI AuthView 的默认设置。AuthView 有重大结构/布局偏差的设计。Environment 使用/语义不确定/困惑,请参考已安装的 ClerkKitUI 行为并镜像它。prebuilt 或 custom。Clerk.configure 中连接。ClerkKitUI 源码,以映射所选流程中用于控制/必需行为的 Environment 字段。/v1/environment 并通过步骤 8 的字段映射解释响应。clerk-ios 包 README 中找到 iOS 快速开始 URL,追加 .md,然后访问并读取它。webcredentials:{YOUR_FRONTEND_API_URL})。| 级别 | 问题 | 预防措施 |
|---|---|---|
| CRITICAL | 在实现前未询问缺失的流程选择 | 在编辑前询问 prebuilt 与 custom 并等待 |
| CRITICAL | 在实现前未询问缺失的可发布密钥 | 在编辑前询问密钥并等待 |
| CRITICAL | 在确认流程类型前开始实现 | 首先确认流程并加载匹配的参考 |
| CRITICAL | 未经请求使用 plist/本地/环境间接方式处理可发布密钥 | 默认直接在配置中连接密钥 |
| CRITICAL | 在实现前跳过 /v1/environment 调用 | 始终为预构建和自定义流程调用环境端点 |
| CRITICAL | 在包安装 + ClerkKitUI Environment 字段检查之前调用 /v1/environment | 先安装 clerk-ios,检查 ClerkKitUI Environment 使用情况,然后调用端点 |
| HIGH | 默认安装带有精确/过时版本的 clerk-ios | 如果缺失,使用“up-to-next-major”要求安装最新的可用版本 |
| CRITICAL | 跳过快速开始先决条件审核 | 访问/读取已安装 clerk-ios 包 README 中的快速开始 URL,并验证所有必需的设置步骤已完成 |
| CRITICAL | 检测到缺失的快速开始能力/域但未应用它们 | 在完成前添加所有缺失的必需快速开始能力和关联域 |
| CRITICAL | 跳过快速开始关联域能力步骤 | 执行快速开始 添加关联域能力 并确保 webcredentials:{YOUR_FRONTEND_API_URL} 存在 |
| CRITICAL | 将能力/必需字段矩阵写入应用代码 | 将矩阵保持在代理内部,仅在 UI/认证流程代码中应用最终行为 |
| CRITICAL | 自定义流程布局在未经明确请求的情况下偏离 AuthView | 默认保持自定义屏幕在实质上接近 AuthView 结构和步骤组成 |
| CRITICAL | 将自定义认证折叠成单个全字段屏幕 | 遵循 AuthView 风格的多步骤推进和步骤特定的字段收集 |
| CRITICAL | 不确定时猜测自定义排序/控制/Environment 使用 | 参考已安装的 ClerkKitUI 行为并镜像它以进行最终实现 |
| HIGH | 将此技能用于 Expo/React Native | 在实现前检测并路由到其他技能 |
../clerk/SKILL.md 用于顶级 Clerk 路由../setup/SKILL.md 用于非原生或跨框架设置clerk-ios 包 README.md(当前 iOS 快速开始链接的来源)https://github.com/clerk/clerk-ios每周安装数
270
代码库
GitHub 星标数
22
首次出现
10 天前
安全审计
安装于
codex265
cursor263
gemini-cli262
github-copilot262
opencode262
cline261
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.
| 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: , , usage in ) |
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.| 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 |
../clerk/SKILL.md for top-level Clerk routing../setup/SKILL.md for non-native or cross-framework setupclerk-ios package README.md (source for current iOS quickstart link)https://github.com/clerk/clerk-iosWeekly Installs
270
Repository
GitHub Stars
22
First Seen
10 days ago
Security Audits
Gen Agent Trust HubPassSocketWarnSnykFail
Installed on
codex265
cursor263
gemini-cli262
github-copilot262
opencode262
cline261
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
103,800 周安装
OpenAPI 转 TypeScript 工具 - 自动生成 API 接口与类型守卫
563 周安装
数据库模式设计器 - 内置最佳实践,自动生成生产级SQL/NoSQL数据库架构
564 周安装
Rust Unsafe代码检查器 - 安全使用Unsafe Rust的完整指南与最佳实践
564 周安装
.NET并发编程模式指南:async/await、Channels、Akka.NET选择决策树
565 周安装
韩语语法检查器 - 基于国立国语院标准的拼写、空格、语法、标点错误检测与纠正
565 周安装
技能安全扫描器 - 检测Claude技能安全漏洞,防范提示注入与恶意代码
565 周安装
/v1/environmentRequest<Clerk.Environment>EnvironmentClerkKitUI| 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 |
webcredentials:{YOUR_FRONTEND_API_URL} when missing).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 |