agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when writing Swift for iOS, macOS, or server-side. Covers value semantics, optionals, protocol-oriented design, structured concurrency with async/await and actors, and SwiftUI state management.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill swift --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/swiftContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when writing Swift for iOS, macOS, or server-side. Covers value semantics, optionals, protocol-oriented design, structured concurrency with async/await and actors, and SwiftUI state management.
name: swift description: Use when writing Swift for iOS, macOS, or server-side. Covers value semantics, optionals, protocol-oriented design, structured concurrency with async/await and actors, and SwiftUI state management. metadata: category: languages version: 1.0.0 tags: [swift, ios, concurrency, actors, swiftui]
Write Swift that leans on value semantics and the concurrency model rather than fighting them: structs by default, actors for shared mutable state, and no force-unwrapping.
1. **Prefer structs** — Reach for a class only when identity or shared mutation is required. 2. **Eliminate optionals early** — Unwrap once at the boundary with `guard`; the rest of the function works with non-optionals. 3. **Isolate mutable state** — Any shared mutable state becomes an actor or is confined to the main actor. 4. **Model async explicitly** — Replace completion handlers with `async` functions; use task groups for concurrency. 5. **Gate** — Build with strict concurrency checking and treat warnings as errors.
**Actor-isolated cache with concurrent loading:**
actor ImageCache {
private var cache: [URL: UIImage] = [:]
private var inFlight: [URL: Task<UIImage, Error>] = [:]
func image(for url: URL) async throws -> UIImage {
if let cached = cache[url] { return cached }
if let existing = inFlight[url] { return try await existing.value }
let task = Task<UIImage, Error> {
let (data, _) = try await URLSession.shared.data(from: url)
guard let image = UIImage(data: data) else { throw CacheError.decodeFailed(url) }
return image
}
inFlight[url] = task
defer { inFlight[url] = nil }
let image = try await task.value
cache[url] = image
return image
}
}A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…