Swift modernization cleanup workflow
Skill gaelic-ghost/socket/plugins/swift-lang/skills/swift-modernization-cleanup-workflow
Run complete modernization and repair passes over existing Swift code, sequencing formatting, source inventory, file splitting, API cleanup, error handling cleanup, functional pipeline cleanup, concurrency cleanup, tests, docs handoffs, and validation.From its SKILL.md
npx -y skills add gaelic-ghost/socket --skill swift-modernization-cleanup-workflowAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
3.7 KB, 706 tokens by cl100k_base, as published. Nobody here has run it
Swift Modernization Cleanup Workflow
Purpose
Modernize existing Swift code without leaving cleanup half-done.
This is the top-level shared Swift repair workflow for poor-quality implementations, drifted source trees, unclear APIs, imperative pipeline tangles, old concurrency patterns, broad files, and weak validation.
Ownership
- Use this skill for shared Swift language cleanup.
- Use
apple-dev-skillsfor Apple framework behavior, Xcode execution, project membership, UI previews, signing, simulators, devices, and Apple docs gates. - Use
server-side-swiftfor Vapor, Hummingbird, SwiftNIO service hosting, persistence, Docker, Fly.io, auth, observability, and deployment.
Workflow
- Inspect before changing:
AGENTS.md- README or CONTRIBUTING
Package.swift.swiftformat.swiftlint.yml- Xcode or XcodeGen files when present
- CI workflows
- existing validation commands
- Establish the formatting baseline through
swift-format-style-workflow. - Inventory cleanup targets:
- oversized files
- mixed responsibilities
- unclear public or internal APIs
- callback-heavy or nested async code
- mutable shared state
- imperative parser, loader, or transform pipelines
- weak error shapes and log messages
- duplicate helpers
- stale TODO/FIXME comments
- missing or weak tests around changed behavior
- Plan coherent slices:
- source organization
- API shape and naming
- functional data pipelines
- concurrency boundaries
- error and logging quality
- tests
- docs handoffs
- Apply complete passes:
- avoid tiny partial edits when adjacent cleanup is part of the same concern
- split files when concern boundaries are real
- remove duplicate paths and stale wrappers
- keep behavior validation close to each slice
- Format again after structural changes.
- Validate serially with the narrowest useful commands.
Modernization Defaults
- Prefer Swift concurrency over callback pyramids when the target platform and repository support it.
- Prefer value flow over hidden mutation.
- Prefer functional pipelines for transformation-heavy code.
- Prefer
swift-error-handling-style-workflowfor broad failure-shape cleanup, typed throws decisions, domain error modeling, Cocoa bridging, and diagnostics. - Prefer typed domain models over dictionaries, strings, or loosely coupled tuples.
- Prefer small support files with one clear job.
- Prefer tests around behavior before and after risky cleanup.
- Prefer human-readable errors that explain what operation failed and what to inspect next.
Output Shape
Return:
Cleanup state: the current risks and code smells.Slice plan: ordered cleanup slices and why each belongs.Changes: files and responsibilities changed.Handoffs: Apple, server-side, docs, project, or deployment owners.Validation: commands run, results, and manual gaps.
Guardrails
- Do not start with broad rewrites before reading repo guidance and validation commands.
- Do not leave compatibility shims, duplicate code paths, or transitional wrappers unless Gale explicitly approves.
- Do not silently change public API compatibility or deployment behavior.
- Do not run multiple SwiftPM or Xcode build/test commands concurrently.
- Do not claim runtime behavior is validated when only formatting or static checks ran.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.