Token导航 LogoToken导航TokenDH.com
AI 工具只读github未标认证来源可访问clear审计通过

modern-swiftmodern Swift 命令行

Agent Skill

modern-swift 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,621

周安装

105

GitHub Stars

167

下载量

848
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:modern-swift(modern Swift 命令行)
来源仓库:https://github.com/johnrogers/claude-swift-engineering
仓库路径:skills/modern-swift
安装命令:
npx skills add https://github.com/johnrogers/claude-swift-engineering --skill modern-swift
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/johnrogers/claude-swift-engineering --skill modern-swift

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中整理仓库状态和代码变更。
  • 可结合来源仓库和原始 README 核验具体用法。
  • 安装前建议确认权限范围和维护状态,避免触发联网或文件读写。
  • modern-swift 属于AI 工具类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Modern Swift (6.2+)

Swift 6.2 introduces strict compile-time concurrency checking with async/await, actors, and Sendable constraints that prevent data races at compile time instead of runtime. This is the foundation of safe concurrent Swift.

Overview

Modern Swift replaces older concurrency patterns (completion handlers, DispatchQueue, locks) with compiler-enforced safety. The core principle: if it compiles with strict concurrency enabled, it cannot have data races.

Quick Reference

NeedUseNOT
Async operationasync/awaitCompletion handlers
Main thread work@MainActorDispatchQueue.main
Shared mutable stateactorLocks, serial queues
Parallel tasksTaskGroupDispatchGroup
Thread safetySendable@unchecked everywhere

Core Workflow

When writing async Swift code:

  1. Mark async functions with async, call with await
  2. Apply @MainActor to view models and UI-updating code
  3. Use actor instead of locks for shared mutable state
  4. Check Task.isCancelled or call Task.checkCancellation() in loops
  5. Enable strict concurrency in Package.swift for compile-time safety

Reference Loading Guide

ALWAYS load reference files if there is even a small chance the content may be required. It's better to have the context than to miss a pattern or make a mistake.

ReferenceLoad When
Concurrency EssentialsWriting async code, converting completion handlers, using await
Swift 6 ConcurrencyUsing @concurrent, nonisolated(unsafe), or actor patterns
Task GroupsRunning multiple async operations in parallel
Task CancellationImplementing long-running or cancellable operations
Strict ConcurrencyEnabling Swift 6 strict mode or fixing Sendable errors
MacrosUsing or understanding Swift macros like @Observable
Modern AttributesMigrating legacy code or using @preconcurrency, @backDeployed
Migration PatternsModernizing delegate patterns or UIKit views

Common Mistakes

  1. @unchecked Sendable as a quick fix — Using @unchecked Sendable to silence compiler errors means you've opted out of safety. If the error persists after @unchecked, your code has a potential data race. Fix the underlying issue instead.
  2. Missing await at call sites — Forgetting await when calling async functions is a compiler error, but checking Task.isCancelled in a loop without calling Task.checkCancellation() silently ignores cancellation.
  3. Capturing self in async blocks without weak — Holding a strong reference to self in a long-running async task prevents deinit. Always use [weak self] in closures or use .task which auto-manages the lifecycle.
  4. Not checking task cancellation — Long-running operations should regularly check Task.isCancelled or call Task.checkCancellation(), otherwise cancellation signals are ignored.
  5. Forgetting @MainActor on UI code and test suites — Main test struct and view models that update @Published properties need @MainActor. Forgetting it silently allows cross-thread mutations. Apply @MainActor to: view models, view structs, main test structs, and any type that touches UI.
  6. Actor re-entrancy surprisesawait inside an actor method can release the lock temporarily. Another task may modify actor state. Design actor methods assuming state can change between await points.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

32.57%
按下载量换算276

OpenCode

24.6%
按下载量换算209

Codex

16.51%
按下载量换算140

Cursor

12.24%
按下载量换算104

Antigravity

7.9%
按下载量换算67

Gemini CLI

3.31%
按下载量换算28

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills