Skill Wiki v0.1.0

Marketplace / Browse / ios-swift

ios-swift

Domain plugin for Swift / iOS / Apple-platform corpora derived from the official Swift API Design Guidelines and the Google Swift Style Guide. Covers naming, protocol- and value-oriented design, optional handling, error propagation, memory management in closures, and structured concurrency.

v0.1.0 17 atoms 34 tags 3 axes

Atom counts by kind

KindCount
rule 14
principle 2
anti-pattern 1

Tag vocabulary

Words a brief might contain that signal this domain.

swiftiosipadosmacoswatchostvosvisionosapplexcodeswiftuiuikitapi-designstyle-guidenamingprotocolprotocol-orientedvalue-typestructenumclassoptionalguardif-letforce-unwrapthrowsresultsendableconcurrencyasync-awaitactorescaping-closureweak-selfretain-cyclearc

Retrieval axes

Domain-specific dimensions used by Prime's retrieval scoring.

scope · 6 matches

What part of a Swift module the guidance shapes — the public surface, internal collaborators, or private implementation.

public-apimodule-boundarycall-siteinternalprivatetest
severity · 5 matches

How firm the recommendation is — a hard rule, a default that may be overridden with reason, or stylistic preference.

mustshouldpreferavoidnever
paradigm · 9 matches

Which Swift design dimension the atom touches — type system, naming, error handling, memory, or concurrency.

namingtypesprotocolsgenericsoptionalserror-handlingmemoryconcurrencyapi-surface

Sample atoms

anti-pattern @ios-swift

Never Force Unwrap Publicly

Reaching for `!` on an `Optional` whose value originates from input — a network response, user input, an `Info.…

ios-swift ↗ 3 · q4.0
principle @ios-swift

Clarity At Call Site

Clarity at the point of use is your most important goal. Code is read far more often than it is written. Strive to make the call site of every API a grammatical English phrase that documents its own intent.…

ios-swift ↗ 5 · q4.0
principle @ios-swift

Swift As Progressive Disclosure

Build APIs and code in the same shape: the common case is a one-liner; the next-most-common case adds one explicit modifier; only the genuinely complex case pulls in the full machinery.…

ios-swift ↗ 5 · q4.0
rule @ios-swift

Await Not Completion Handler

New async APIs are written as `func f(...) async throws -> T`. The call site reads as straight-line code, errors propagate through `try`, cancellation propagates through the cooperative cancellation system, and the struc…

ios-swift ↗ 3 · q4.0
rule @ios-swift

Clarity At Call Site

Code is read far more often than it is written. Every naming and signature decision — argument labels, method vs.…

ios-swift ↗ 4 · q4.0
rule @ios-swift

Error Throws Not Result Where Possible

Swift has two error-handling shapes: throwing functions (`func f() throws -> T`, `func f() async throws -> T`) and `Result<Success, Failure>`.…

ios-swift ↗ 3 · q4.0
rule @ios-swift

Guard Let Early Return

When the rest of a function does not make sense without a particular optional being non-nil, write `guard let x = optionalX else { return ... }`.…

ios-swift ↗ 2 · q4.0
rule @ios-swift

Label Args By Grammar

Argument labels exist to make the call site readable. The decision rule: read the call as English. (1) When the argument is the direct object of a verb method, omit the label: `removeAll()`, `view.add(subview)`.…

ios-swift ↗ 2 · q4.0
rule @ios-swift

Name By Role Not Type

A name should describe what a value *is for*, not what its concrete type happens to be.…

ios-swift ↗ 2 · q4.0
rule @ios-swift

Names Of Side Effects End Imperative

The grammar of a method name signals whether it mutates. Mutating methods use imperative verb phrases: `array.sort()`, `set.insert(x)`, `string.append("!")`.…

ios-swift ↗ 3 · q4.0
rule @ios-swift

Omit Needless Words

Every word in a name should carry information at the call site. Words that merely repeat type information already present in the signature are noise: `removeElement(_ element: Element)` is `remove(_ element: Element)`.…

ios-swift ↗ 2 · q4.0
rule @ios-swift

Optional Chaining Over Nil Check

When the goal is 'do this only if the value is present, otherwise produce nothing or a default', Swift gives three short-circuiting forms that are clearer than an `if x != nil` check followed by a body that uses `x!`.…

ios-swift ↗ 2 · q4.0

See all 17 atoms in ios-swift →