/swift:writing-apple-platform-documentationfrom Swift
Writes or reviews Swift doc comments, DocC articles, and Apple developer documentation with correct terminology, capitalization, and platform-specific guidance.
Ships in Swift. 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.
Write or review Apple-platform documentation using the terminology, doc-comment, DocC, availability, and privacy rules below. Compose with writing-technical-prose when available for general voice and structure. This skill also supports manual review on its own. When this guidance conflicts with a generic prose rule for Apple-platform prose, this guidance wins. Keep it subordinate to project conventions and Apple's current terminology when verified.
Check the draft against the declarations, implementation, deployment targets, and existing project documentation. Review terminology and caller-facing contracts using the sections below. Report incorrect claims and missing constraints before wording suggestions, with concrete replacements where possible.
If writing-technical-prose is already active in this review, reuse its guidance and continue the same review without restarting its workflow.
When the Universal linter is available, read Terminology checks to combine its generic checks with this skill's Apple rules. Otherwise, review capitalization against the terminology and corrections below, and verify availability, ownership, concurrency, and privacy claims directly against source material. Automated checks are optional.
Prefer precise platform names:
Apple platforms for behavior shared across iOS, iPadOS, macOS, watchOS, tvOS, and visionOS.iOS, iPadOS, macOS, watchOS, tvOS, visionOS when behavior is platform-specific.Swift, SwiftUI, UIKit, AppKit, Foundation, Combine, Observation, Core Data, CloudKit, StoreKit, WidgetKit, XCTest, XCUITest, DocC, Xcode, TestFlight, App Store Connect.Swift Package Manager on first use if readers may not know SwiftPM.APNs, not APNS.In-App Purchase for the Apple commerce feature; in-app purchase for a generic phrase when not naming the feature.MainActor, Sendable, async/await, Task, actor, nonisolated, and other Swift keywords or symbols in backticks when referring to code.Do not use iOS as a synonym for every Apple platform. If an API behaves differently on macOS or visionOS, say so.
Use /// comments for declarations unless the project uses block comments for long DocC articles.
The summary should describe the declaration’s purpose and end with a period; Swift API guidelines commonly use a sentence fragment. Do not start with “This method” or restate the symbol name.
/// Fetches the cached image for a request or loads it from the remote source.
public func image(for request: ImageRequest) async throws -> Image
For complex APIs, add paragraphs in this order when relevant:
/// Coordinates image loading, decoding, and memory-backed caching.
///
/// `ImagePipeline` coalesces identical in-flight requests and stores decoded images
/// in memory until the configured cache evicts them.
///
/// Callers may await results from any actor. Awaiting callers resume under their
/// own isolation; callback delivery requires a separate documented contract.
public actor ImagePipeline { }
Use DocC fields when they improve correct API use.
/// Creates a thumbnail for the image at the specified URL.
///
/// - Parameters:
/// - url: The local file URL of the source image.
/// - size: The target size in points.
/// - Returns: A decoded thumbnail image.
/// - Throws: `ThumbnailError.unsupportedFormat` when the file type cannot be decoded.
public func thumbnail(for url: URL, size: CGSize) async throws -> Image
Use callouts for semantics that affect correctness:
/// - Important: Call this method from the main actor when the result updates UIKit state.
/// - Warning: This method overwrites any existing file at `destinationURL`.
/// - Note: This example API stops future retries on cancellation; document separately
/// whether its underlying request is cancelled.
Do not overuse callouts for ordinary details. A document full of notes is harder to scan than a direct paragraph.
Document these when they affect callers:
@MainActor requirements and main-thread UI constraints.Sendable requirements and whether values cross concurrency domains.async APIs.@State, @Binding, @ObservedObject, @StateObject, @Environment, and @Observable.State availability only when verified from code, package manifests, deployment targets, or current Apple documentation.
Requires iOS 17.0+ and Xcode 16.0+.
Use iOS 17.0+, not iOS17+. If availability is conditional, name the condition.
@available(iOS 17.0, macOS 14.0, *)
public struct SearchConfiguration { }
Do not promise behavior on betas, future OS versions, or unreleased SDKs unless the source material explicitly supports it.
Examples should be close to compile-ready. Include enough context for the reader to understand ownership, actor isolation, and error handling.
let pipeline = ImagePipeline(cache: .shared)
let image = try await pipeline.image(for: ImageRequest(url: avatarURL))
Avoid examples like this unless the surrounding text is explicitly abstract:
let result = try await manager.doThing(foo: "bar")
Prefer comments that explain invariants or platform workarounds.
// UIKit sends a second layout pass after trait changes. Keep the cached size until
// `viewDidLayoutSubviews()` observes the final bounds.
Avoid comments that restate the code.
// Bad: Increment the count.
count += 1
| Weak | Better |
|---|---|
| APNS | APNs |
| OSX | macOS |
| MacOS | macOS |
| IOS | iOS |
| app store | App Store |
| xcode | Xcode |
| swiftui | SwiftUI |
| ui kit | UIKit |
| in app purchase, when naming Apple’s feature | In-App Purchase |
| push notifications service | Apple Push Notification service, then APNs |
For Apple-platform docs, name the user-visible permission, entitlement, or data class when relevant. Do not bury privacy behavior in setup instructions.
The app requests Photos access only when the user imports an image. Denying access leaves the existing project unchanged.
For logs and diagnostics, specify what is redacted.
Diagnostics include request timing and HTTP status codes. They do not include access tokens, image contents, or user-entered text.
Read the reference that matches the check being performed:
Before finishing, check terminology, caller constraints, verified availability, and privacy wording against the sections above.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kylehughes/agent-plugins-for-making-good-software --plugin swift10 skills in this plugin
/designing-swift-apisDesign Swift API names, labels, signatures, and documentation contracts. Use proactively when adding or changing APIs or reviewing call-site clarity against Apple's API Design Guidelines./modeling-swift-types-for-correctnessModel Swift invariants, validated decoding, legal transitions, ownership, and generic relationships. Load before assessing or changing enforcement boundaries; not ordinary output tests or naming./ordering-symbolsOrder Swift members by declaration kind, access, and name when semantics permit. Use proactively when adding or moving members; preserve initialization, enum, UI, and other meaningful order.Other plugins' skills for the same job