Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Applies Swift API Design Guidelines to name, label, and document Swift APIs, covering argument labels and call-site clarity.
87% 96%+9 ptsof test cases passed
Passed 22 of 23 test cases with the skill, and 20 of 23 without it.
I am writing a Swift view container type. I need a method signature to add a subview parameter of type `UIView`. Developers might write `func add(subview: UIView)`. What parameter label and method name structure should be used for call-site clarity?
The method base name incorporates the word Subview or subview.
3 of 3 safety checks passed
Apply the Swift API Design Guidelines to naming, labels, documentation, and
call-site clarity. For mixed requests, handle the API-design portion here and
route language/type-system work to swift-language, concurrency to
swift-concurrency, and lint configuration to swiftlint.
Argument labels determine how a call site reads. Apply the first matching row:
| Situation | Rule | Example |
|---|---|---|
| First arg completes grammatical phrase | Omit label, merge words into base name | addSubview(y) |
| Value-preserving init conversion | Omit first label | Int64(someUInt32) |
| Arguments are indistinguishable peers | Omit all labels | min(x, y) |
| First arg completes prepositional phrase | Label with preposition | fade(from: red) |
| First two args form a single abstraction | Fold preposition into base name | moveTo(x: b, y: c) |
| Everything else | Label it | split(maxSplits: 2) |
Load Argument Labels and Parameters when resolving abstraction boundaries, multiple prepositions, conversion initializers, indistinguishable peers, parameter naming, or default arguments.
Use imperative verbs for operations with side effects, result-describing noun
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.