Install any skill in seconds. Free to start, no credit card required.
Get Started Free →dpearson2699/swift-api-design-guidelines
Apply Swift API Design Guidelines to name, label, and document Swift APIs. Covers argument label rules (prepositional phrase rule, grammatical phrase rule, first-label omission), mutating/nonmutating pair naming (-ed/-ing participle pattern, form- prefix, sort/sorted, formUnion/union), side-effect naming (noun for pure, verb for mutating), documentation comment structure (summary by declaration kind, O(1) complexity rule), clarity at call site, role-based naming, protocol naming (-able/-ible/-in
Passed 22 of 23 test cases with the skill, and 20 of 23 without it.
2 fixed20 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
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?
| Checked | Without skill | With skill |
|---|---|---|
| The method base name incorporates the word Subview or subview. | Missed | Passed |
| The first argument label is omitted using an underscore. | Passed | Passed |
The instructions your model reads when the skill loads.
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
test cases passed, vs 20 / 23 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.