/swift:ordering-symbolsfrom Swift
Orders Swift member declarations by category, access level, static-vs-instance, and name when semantics permit. Preserves initialization, enum, UI, and other meaningful order.
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.
Maintain deterministic, lexicographic ordering of Swift declarations wherever reordering is semantics-preserving. Consistent member ordering removes subjective placement decisions and makes types scannable: readers should know where to find a symbol without knowing its implementation.
Use the repository’s declared ordering first. When none exists, this skill suggests ordering by declaration category, access level, static-vs-instance, and name. These are editorial conventions, not Swift language requirements. Apply them within the requested edit; do not reorder unrelated declarations.
Only reorder sibling declarations or sibling statements when it is safe to do so. Never reorder if the change could affect compilation, overload resolution, initialization order, synthesized API shape, runtime behavior, UI order, availability behavior, reflection, serialization, generated code, or tests.
When editing existing code, move a declaration together with all directly attached documentation comments, attributes, property wrappers, macros, conditional-compilation directives that guard only that declaration, and inline comments that describe that declaration.
If safety is uncertain, preserve the current order rather than guessing.
When a declaration is safe to reorder, compare it using these keys in order:
Use this access order, from broadest to narrowest:
openpublicpackageinternal / omitted access modifierfileprivateprivateRules:
internal, package, public, and open types default to internal; private and fileprivate types narrow member defaults. Explicit extension access, enum cases, and protocol requirements have their own defaults; do not infer member access from the enclosing type modifier alone.public private(set) var title belongs in the public bucket, and private(set) var count belongs in the internal bucket.Use deterministic code-point lexicographic ordering for the comparison string.
init(), init(coder:), init(from:), init(id:name:).subscript signatures after named computed properties and before methods._, $, digits, and capitalization participate in the sort.@MainActor, @objc, @IBAction, @IBOutlet, @Published, @State, @Environment, @Observable, @discardableResult, final, override, required, convenience, mutating, nonmutating, async, throws, rethrows, isolated, nonisolated, and similar annotations for ordering.Before manual ordering review, run the deterministic symbol-order linter (python3 scripts/lint_symbol_order.py <paths...>; add --json for tooling) to flag mechanical access-bucket, member-kind, and lexicographic violations while automatically skipping enum cases, @ViewBuilder/body, #if blocks, and synthesized-memberwise-init struct stored properties.
When writing or editing Swift code:
Load only the reference relevant to the task:
class, struct, actor,
enum, and concrete extension bodies, including type-level declarations, enum cases, stored properties,
initializers/deinitializers, and implementation details.agents/openai.yaml (opens in a new tab)references/complete-type-example.md (opens in a new tab)references/formatting-and-comments.md (opens in a new tab)references/parameters-and-body-ordering.md (opens in a new tab)references/protocols-extensions-and-availability.md (opens in a new tab)references/type-declaration-order.md (opens in a new tab)scripts/lint_symbol_order.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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./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./testing-swift-codePlan or write Swift unit tests with Swift Testing. Use proactively for regression coverage, assertions, suites, traits, or migration; async timing has its own skill and UI tests use XCTest.Other plugins' skills for the same job