/swift-language-pro:swift-language-profrom swift-language-pro
Helps write idiomatic, safe Swift code covering value vs reference types, optionals, error handling, generics, protocols, and API design naming conventions.
Ships in swift-language-pro. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Write idiomatic, safe, modern Swift. Follow Apple's API Design Guidelines.
Trigger: /swift-language-pro.
struct/enum) by default; use class only for identity or
reference semantics.❌
class Point { var x = 0.0; var y = 0.0 } // accidental shared mutation
✅
struct Point { var x = 0.0; var y = 0.0 }
❌ Two bools that allow impossible states
struct State { var isLoading: Bool; var error: Error? } // loading + error?
✅
enum LoadState<Value> { case idle, loading, loaded(Value), failed(Error) }
if let / guard let; avoid force-unwrap ! outside tests.guard for early exit, keeping the happy path unindented.❌
func name(_ u: User?) -> String { return u!.name }
✅
func name(_ u: User?) -> String {
guard let u else { return "Guest" }
return u.name
}
❌ Boolean failure
func save() -> Bool
✅
enum SaveError: Error { case diskFull, notAuthorized }
func save() throws // call sites use try/catch; errors carry meaning
❌
func insertObject(_ obj: Element, atIndex i: Int)
list.insertObject(x, atIndex: 0)
✅
func insert(_ element: Element, at index: Int)
list.insert(x, at: 0)
where; prefer protocols with associated types over Any.✅
func max<C: Collection>(of items: C) -> C.Element? where C.Element: Comparable {
items.max()
}
class where a struct would do.! in app code.Bool/nil for failures instead of throws.Any/type-erasure where a generic constraint fits.Per issue: file:line, the guideline violated, before/after. Lead with safety (force-unwraps, impossible states) before style.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub laxrajpurohit/swift-skills-pro --plugin swift-language-pro