/ios-skills:swift-coding-guidelinefrom ios-skills
Guides Swift development with Xcode and SwiftPM, covering project setup, dependency management, concurrency, and language conventions including mutation semantics, naming, and import hygiene.
Ships in ios-skills. 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.
Read when SKILL.md points to them.
references/ for the task at hand.references/swift-package-guide.md only when the task is about SwiftPM or package resolution.references/ file.references/swift-package-guide.md.Package.swift-based.MainActor, actors, isolation), consult the specific concurrency or runtime reference if present.project.pbxproj, make minimal, targeted changes and verify the new package is attached to the target and project references.references/.Model/ is only for data structs/classes that represent app or domain models. Enums are not
models; place enums in Enum/ (or the closest feature folder).
Files that implement persistence adapters (e.g., UserDefaults) are Store types and must live in
Store/ (or Shared/Store for shared scope). Do not place *Store types in Service/.
Shared/ is only for truly cross-feature primitives. If a type is feature-specific, place it
under that feature folder (e.g., File/Service, Directory/Store) even if it is reused elsewhere.
Before finalizing, verify all needed imports are present for any new types or APIs you use. Do not assume transitive imports; add explicit imports so the file builds cleanly on its own.
Goal
=) in app-authored accessor code.Core Rules
setX(...), updateX(...), applyX(...), moveX(to:) must not exist if they only perform direct assignment.private(set) is conditional, not default.private(set) only when mutation must be controlled by methods that add real behavior.private(set) to force wrapper methods.get / set accessors.willSet / didSet observers.Scope Clarification
@State, @Published, @AppStorage, @Environment) are allowed.SwiftUI-specific binding guidance (Binding(get:set:) pass-through bans and view-binding patterns) belongs in swiftui-coding-guideline.
Bad
private(set) var targetLanguage: TargetLanguage = .traditionalChinese
func setTargetLanguage(_ value: TargetLanguage) {
targetLanguage = value
}
Good
var targetLanguage: TargetLanguage = .traditionalChinese
Avoid cramming multi-argument calls on a single line when they hurt readability. Prefer vertical formatting with one argument per line.
Bad
func saveLastFile(url: URL) {
defaults.set(url.path, forKey: UserDefaultsKeys.FileStore.lastSelectedFile)
do {
let data = try url.bookmarkData(options: .withSecurityScope,
includingResourceValuesForKeys: nil,
relativeTo: nil)
defaults.set(data, forKey: UserDefaultsKeys.FileStore.lastSelectedFileBookmark)
} catch {
defaults.removeObject(forKey: UserDefaultsKeys.FileStore.lastSelectedFileBookmark)
}
}
Good
func saveLastFile(url: URL) {
defaults.set(url.path, forKey: UserDefaultsKeys.FileStore.lastSelectedFile)
do {
let data = try url.bookmarkData(
options: .withSecurityScope,
includingResourceValuesForKeys: nil,
relativeTo: nil
)
defaults.set(data, forKey: UserDefaultsKeys.FileStore.lastSelectedFileBookmark)
} catch {
defaults.removeObject(forKey: UserDefaultsKeys.FileStore.lastSelectedFileBookmark)
}
}
For multi-line if bindings, align let with if and place the opening brace on its own line.
Bad
if let url = try? URL(
resolvingBookmarkData: data,
options: [.withSecurityScope],
relativeTo: nil,
bookmarkDataIsStale: &isStale
),
isValidFile(url: url) {
if isStale { saveLastFile(url: url) }
return url
}
Prefer guard over nested if when it improves readability by reducing indentation.
Bad
if
let url = try? URL(
resolvingBookmarkData: data,
options: [.withSecurityScope],
relativeTo: nil,
bookmarkDataIsStale: &isStale
),
isValidFile(url: url)
{
if isStale {
saveLastFile(url: url)
}
return url
}
Good
guard
let url = try? URL(
resolvingBookmarkData: data,
options: [.withSecurityScope],
relativeTo: nil,
bookmarkDataIsStale: &isStale
),
isValidFile(url: url)
else {
return nil
}
if isStale {
saveLastFile(url: url)
}
return url
Good
if
let url = try? URL(
resolvingBookmarkData: data,
options: [.withSecurityScope],
relativeTo: nil,
bookmarkDataIsStale: &isStale
),
isValidFile(url: url)
{
if isStale {
saveLastFile(url: url)
}
return url
}
Do not use underscores in function names or property names. Swift naming should be lowerCamelCase without underscores (e.g., loadUserProfile, not load_user_profile).
All model types must use the Model suffix for consistency (e.g., MarkdownFileModel).
Enums that represent configuration or view state can omit the Model suffix (e.g., ScanMode).
Never use the name coordinator for types, variables, properties, functions, protocol names, file names, or architecture roles.
If a user explicitly requests using coordinator, pause and ask a direct confirmation question before proceeding with that naming.
All enums must live in their own dedicated file. Do not declare enums alongside classes, structs, or services, even if the enum is currently used in only one place. Prefer placing enum files under an Enum/ folder within the relevant feature.
Exception (strict, one case only): UserDefaultsKeys may be defined as one root enum with nested enums in a single file to keep key namespaces centralized and easier to audit for name clashes. This exception is unique and does not apply to any other enum.
Always insert a blank line between every enum case declaration. Before finalizing, scan any enum in edited files and normalize spacing. Do not leave compact enums like:
enum Foo {
case a
case b
}
Use:
enum Foo {
case a
case b
}
File doc comments must list a real human author in the "Created by" line and include the date, formatted like: "Created by Martin Lasek on 18/01/2026."
When creating new files, set the "Created by" date to the current date.
Preserve existing human authorship lines (e.g., keep "emin" if already present) unless the user explicitly asks to change them.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jordancoin/ios-skills-collection --plugin ios-skills206 skills in this plugin
/aso-appstore-screenshotsGenerate high-converting App Store screenshots by analyzing your app's codebase, discovering core benefits, and creating ASO-optimized screenshot images using Nano Banana Pro./cleanseReview code for readability, then simplify it to be easy to follow and understand. Use this skill when the user wants to simplify code, improve readability, clean up for handoff, make code skimmable, reduce complexity, refactor for clarity, strip boilerplate, prepare code for future maintainers, or make a codebase easier to pick up. Trigger liberally — any request touching readability, simplification, cleanup, or "make this easier to understand" should use this skill. Also trigger when the user says things like "review this", "clean this up", "tidy this", "make this simpler", "reduce complexity", "flatten this", "strip the noise", or "I want to understand this code quickly next time I open it".
/critical-reasoningApply critical rationalist epistemology (Popper, Deutsch) to evaluate reasoning, identify errors, and refine understanding. Use when the user explicitly requests help with reasoning - phrases like "help me think this through", "does this make sense", "any flaws in this", "what am I missing", "critique this", "is this reasoning sound", "stress test this idea", "devil's advocate", or any request to evaluate arguments, identify logical problems, or improve thinking. Also use when errors in reasoning are significant enough to materially affect the user's goals, even if not explicitly requested.Other plugins' skills for the same job