Loading...
Loading...
Write, review, or improve Swift APIs using Swift API Design Guidelines for naming, argument labels, documentation comments, terminology, and general conventions. Use when designing new APIs, refactoring existing interfaces, or reviewing API clarity and fluency.
npx skill4agent add erikote04/swift-api-design-guidelines-agent-skill swift-api-design-guidelines-skillreferences/promote-clear-usage.mdreferences/strive-for-fluent-usage.mdreferences/parameters.mdreferences/argument-labels.mdreferences/fundamentals.mdreferences/general-conventions.mdreferences/special-instructions.mdParameterReturnsThrowsNoteAnyNSObjectStringIntmakesortsortedformUnionunionisEmptyintersectsO(1)| Situation | Preferred Pattern |
|---|---|
| Mutating verb | |
| Nonmutating verb | |
| Nonmutating noun op | |
| Mutating noun op | |
| Factory method | |
| Boolean query | |
| Situation | Rule |
|---|---|
| Distinguishable unlabeled args | Omit labels only if distinction is still clear |
| Value-preserving conversion init | Omit first label |
| First arg in prepositional phrase | Usually label from the preposition |
| First arg in grammatical phrase | Omit first label |
| Defaulted arguments | Keep labels (they may be omitted at call sites) |
| All other arguments | Label them |
| Declaration Kind | Summary Should Describe |
|---|---|
| Function / method | What it does and what it returns |
| Subscript | What it accesses |
| Initializer | What it creates |
| Other declarations | What it is |
O(1)references/fundamentals.mdreferences/promote-clear-usage.mdreferences/strive-for-fluent-usage.mdreferences/use-terminology-well.mdreferences/general-conventions.mdreferences/parameters.mdreferences/argument-labels.mdreferences/special-instructions.md