swift-development-dd94ff — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited swift-development-dd94ff (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
当处理非 UI 的 Swift 代码、业务逻辑、算法或数据层时,请遵循本指南。你的目标是编写高性能、线程安全且富有表现力的 Swift 代码。
/// 一个线程安全的用户数据服务
actor UserService {
private var cache: [String: User] = [:]
// 使用 typed throws 明确错误类型
func fetchUser(id: String) async throws(NetworkError) -> User {
if let cached = cache[id] {
return cached
}
// 模拟网络请求
let user = try await NetworkClient.shared.get("/users/\(id)", as: User.self)
cache[id] = user
return user
}
}import Testing
@testable import MyApp
@Test("User parsing should succeed")
func userParsing() async throws {
let json = """
{ "id": "1", "name": "Alice" }
""".data(using: .utf8)!
let user = try JSONDecoder().decode(User.self, from: json)
#expect(user.name == "Alice")
#expect(user.id == "1")
}Sendable 协议。throws 和 do-catch,而不是返回 Optional 或 Result 类型(在 async 上下文中 throws 更自然)。[weak self] 或 [unowned self] 的使用(但在 Task 中通常不需要 weak,除非为了打破循环引用)。~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.