/swift:writing-swiftfrom Swift
Writes, debugs, reviews, or migrates Swift code and packages. Guides Swift source, package manifests, Xcode builds, and compiler diagnostics with idiomatic patterns and compatibility awareness.
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; scripts run unread.
Write correct, idiomatic Swift while respecting the repository's compatibility contract. This skill is an implementation hub: load only the focused companion skill or reference required by the request.
git status --short; never discard edits, create commits, or run broad migrations unless requested.For compatibility decisions, use Swift compatibility for the version axes and build policy. For dated compiler, SDK, or type-system support, consult feature status only when needed; do not silently upgrade the project.
For broad orientation, run the project-context script. Resolve bundled paths relative to this skill directory.
State the behavior or diagnostic, identify the owning layer, make the narrowest coherent edit, and compile early. Add focused tests for changed behavior, then run proportional validation and required repository checks. Inspect git diff --check, git diff --stat, and the final diff; report commands and gaps. Review-only requests produce findings without edits; explanation-only requests do not mutate the repository.
try! except for explicit, documented invariants.some, any, type erasure, macros, wrappers, and compiler attributes only for a real boundary or measured benefit. The exception is @inlinable, which public generic API in a source-built library module should carry by default.Load only the concern-specific guidance needed for the task. Use repository instructions first, then the focused companion skill, then this hub's defaults. Prefer the focused sibling skill when available; otherwise use the matching bundled reference. Do not load both by default.
Sendable, tasks, actors, cancellation, or async sequences: using-swift-concurrency; if unavailable, use Concurrency for repair patterns or consult it only for an unresolved detail.testing-swift-code; if unavailable, use Testing Swift or consult it only for an unresolved detail.testing-async-swift-code; if unavailable, use the async portions of Testing Swift or consult them only for an unresolved detail.designing-swift-apis; type and file layout: organizing-swift-types; member placement: ordering-symbols.localizing-strings), UIKit cell content (configuring-ios-content), or modal sheets (presenting-ios-modals): consult the matching skill when the apple-apps plugin is installed.structuring-swift-packages.@inlinable, @usableFromInline, or @frozen: Inlining and cross-module optimization. Read it when writing such API, not only when asked about performance.writing-apple-platform-documentation.Treat concurrency as architecture. Identify mutable-state ownership, check default actor isolation, use structured child tasks, retain and cancel unstructured tasks when lifetime matters, and use detached tasks or unchecked escape hatches only with a concrete safety argument. Account for actor reentrancy and cancellation; never suspend while holding a lock.
Preserve the repository's test framework. Prefer Swift Testing for new unit or integration tests when supported; keep XCTest for UI, performance, existing, or framework-specific suites. Avoid sleeps, shared mutable globals, live network dependencies, and order dependence. Test error, cancellation, isolation, and boundary behavior, not only success.
For SwiftPM, discover and use the repository's standard commands; the usual sequence is swift package dump-package, swift build, and swift test, with the SwiftPM check script when applicable. For Xcode, discover the workspace/project, scheme, and destination before using xcodebuild; preserve CI signing and derived-data conventions. Run configured formatters and linters, the changed-file lint script, and—for public generic library APIs or @inlinable/@usableFromInline edits—the inlinable linter (python3 scripts/lint_inlinable.py <paths...>, adding --resilient for resilient binaries) before manual review. Do not update dependencies, regenerate projects, or mass-format without a task requirement.
Prioritize crashes, data loss, races, security/privacy, incorrect behavior, cancellation/lifetime bugs, compatibility, availability, and demonstrated performance regressions. Give file and line evidence; do not manufacture findings.
Before finishing, confirm requested behavior, repository instructions, compatibility and public API stability, defensible isolation/cancellation, proportional deterministic tests, required checks, and a clean diff without generated artifacts, secrets, or dependency churn.
Read only the references relevant to the requested work. The focused companion skills above are preferred routers.
Sendable, tasks, actors, cancellation, continuations, streams, and repairs.@inlinable and @usableFromInline, by distribution model.@inlinable on public generic library APIs and invalid or redundant @usableFromInline usage (supports --resilient).references/swift-compatibility.md)agents/openai.yaml (opens in a new tab)evals/trigger-evals.json (opens in a new tab)references/api-design-and-style.md (opens in a new tab)references/concurrency.md (opens in a new tab)references/inlining-and-cross-module-optimization.md (opens in a new tab)references/packages-builds-and-platforms.md (opens in a new tab)references/review-and-debugging.md (opens in a new tab)references/swift-compatibility.md (opens in a new tab)references/testing.md (opens in a new tab)scripts/lint-changed-swift.sh (opens in a new tab)scripts/lint_inlinable.py (opens in a new tab)scripts/swift-project-context.sh (opens in a new tab)scripts/swiftpm-check.sh (opens in a new tab)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./organizing-swift-typesOrganize Swift types, conformances, extensions, access control, and files. Use proactively when adding or restructuring declarations; apply repository conventions before the suggested layout./structuring-swift-packagesStructure Swift package boundaries, dependencies, exports, and composition roots. Use proactively for module placement or dependency cycles; preserve the repository’s architecture and naming./testing-async-swift-codeMake Swift async tests deterministic. Use proactively for timing, observer readiness, completion, cancellation, cleanup, or flaky tests; not general test organization.Other plugins' skills for the same job