NOASSERTIONupdated 1mo ago
Let be the absolute plugin directory two levels above this SKILL.md. Resolve that path before running commands or opening shared references. When these instructions say swiftui-ctx, invoke /scripts/swiftui-ctx; do not assume the command is on PATH.
What can you do with Swiftui Modernize?
name: swiftui-modernize description: Modernize existing macOS SwiftUI code by replacing deprecated APIs with verified current production patterns. license: MIT
Bundled resource root
Let <swiftui-plugin-root> be the absolute plugin directory two levels above this SKILL.md. Resolve that path before running commands or opening shared references. When these instructions say swiftui-ctx, invoke <swiftui-plugin-root>/scripts/swiftui-ctx; do not assume the command is on PATH.
swiftui-modernize β fix deprecated/stale SwiftUI
Operates on code that already exists: it finds deprecated and outdated SwiftUI and migrates it to what
shipping macOS apps use today, using swiftui-ctx as the source of truth. (Writing new code β swiftui-examples.
Scaffolding a whole pattern β macos-app-patterns.)
swiftui-ctx = <swiftui-plugin-root>/scripts/swiftui-ctx (or swiftui-ctx on PATH). It self-builds + self-locates the catalog.
The rule
Do not guess whether an API is current. Check it. A call that compiles can still be deprecated β the catalog knows (it's flagged across 200β1,100 real repos). Announce: "Using swiftui-modernize to verify against production."
Workflow
- Find candidates. Scan the target file/diff for SwiftUI symbols (modifiers, types, wrappers).
- Check each.
swiftui-ctx deprecated <api>β it returnsdeprecated: true/false, thereplacement, and a note. Runswiftui-ctx deprecated(no arg) once to see the full deprecated-in-the-wild list to scan against. - Get the real migration. For each deprecated hit,
swiftui-ctx lookup <replacement>β the modern idiom +file --smarta real example, then rewrite. - Report, don't silently change: list each
old β newwith the permalink evidence, then apply.
The common migrations are tabulated in references/migrations.md (read it for the fast path).
Behavioral rules
- Never leave a deprecated API in place once flagged β migrate it or call out why you can't.
- Prefer the
replacementthe tool gives; confirm the new call's shape vialookup <replacement>consensus. - Modernity isn't only deprecation: prefer
@ObservableoverObservableObject,NavigationStack/SplitoverNavigationView, theSettingsscene +MenuBarExtrafor macOS βswiftui-ctx lookupshows current adoption. - Pair with sosumi.ai (the
doc:link) to confirm the replacement's signature before rewriting.
Errors β actions
3 not-found β swiftui-ctx search "<broader>". 5 no catalog β STOP, tell the user, don't fabricate a migration.
References
| File | Read when |
|---|---|
references/migrations.md |
You want the common deprecatedβmodern macOS SwiftUI migration table up front. |
Install
Add Swiftui Modernize to your client. Pick the one you use.
npx skills add yigitkonur/plugin-swiftuiInstalls every skill in the repository, then prompts for which to keep.
/plugin marketplace add yigitkonur/plugin-swiftuiAdds the repository as a plugin marketplace; install individual plugins with `/plugin install`.
git clone https://github.com/yigitkonur/plugin-swiftui
cp -r plugins/swiftui/skills/swiftui-modernize ~/.claude/skills/A skill is a plain directory. Copy it into `.claude/skills/` in a project or in your home directory.
Score
58 / 100
Adequate