跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 clerk-swift

Clerk Swift

在 iOS 和 macOS 的本地 Swift app 中执行 Clease 认证 UI , 并使用 CleaseKitUI 预建视图或自定义 Clerk Kit 流量 。 先用iOS设置快取设置办事员,使用Clerk CLI. 不使用 Expo 或 React 本地项目 .

14204 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

在 iOS 和 macOS 的本地 Swift app 中执行 Clease 认证 UI , 并使用 CleaseKitUI 预建视图或自定义 Clerk Kit 流量 。 先用iOS设置快取设置办事员,使用Clerk CLI. 不使用 Expo 或 React 本地项目 .

何时用

官方 description 未单独写出 Use when。按规范,代理会在用户任务与这段 description 的关键词匹配时激活本技能。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Clerk Swift (Native iOS and macOS)、Activation Rules、Set up Clerk first、What Do You Need?、Quick Start、Decision Tree。 其中含规范建议的小节:分步指令。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/prebuilt.md、references/custom.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

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.

Clerk Swift (Native iOS and macOS)Activation RulesSet up Clerk firstWhat Do You Need?Quick StartDecision TreeFlow ReferencesInteraction ContractPreserve Completed SetupSource-Driven ImplementationWorkflowCommon Pitfalls

兼容:Requires Xcode and ClerkKit Swift package · 许可:MIT · allowed-tools:WebFetch

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
clerk-swift
description
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.
compatibility
Requires Xcode and ClerkKit Swift package
allowed-tools
WebFetch实验字段,支持情况取决于客户端;字段声明本身不会授予工具权限。
许可
MIT
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 2
  • references/prebuilt.md
  • references/custom.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「clerk-swift」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-904c3d931f5325a1-Clerk-Swift.html
请存为 .cursor/skills/clerk-swift/SKILL.md 或 .claude/skills/clerk-swift/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/clerk/skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/clerk/skills' --list

npx skills add 'https://github.com/clerk/skills' --skill 'clerk-swift'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版

name: clerk-swift description: 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. license: MIT allowed-tools: WebFetch metadata: author: clerk version: 1.2.0 compatibility: Requires Xcode and ClerkKit Swift package

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:

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.configure call 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

  1. Detect native Swift vs Expo/React Native.
  2. 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.
  3. If the flow type isn't known, ask for prebuilt or custom.
  4. Load the matching flow reference.
  5. Check that flow's prerequisites and make only the missing, targeted changes, preserving completed setup and custom key loading.
  6. Implement using the selected reference.
  7. 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
  • clerk skill for top-level Clerk routing
  • clerk-setup skill for non-native or cross-framework setup
  • https://github.com/clerk/clerk-ios

相关技能

Agent 工作流

Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…