swiftui-modernize

Migrates deprecated macOS SwiftUI APIs to current production patterns verified against real app code.

2|1|Updated Jun 7, 2026
One-click install
npx skills add https://github.com/yigitkonur/plugin-swiftui --skill swiftui-modernize-yigitkonur
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-modernize
Source: https://github.com/yigitkonur/plugin-swiftui/tree/main/plugins/swiftui/skills/swiftui-modernize
Command: npx skills add https://github.com/yigitkonur/plugin-swiftui --skill swiftui-modernize-yigitkonur

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? SwiftUI code that compiles can still use deprecated or stale APIs, and documentation alone does not reveal how shipping macOS apps actually write modern SwiftUI. This Skill detects deprecated modifiers, types, and property wrappers in existing code and replaces them with verified current idioms. ## Core Features & Use Cases - Deprecation Verification: Checks each SwiftUI symbol against a catalog of 1,857 real macOS apps via the swiftui-ctx deprecated command, returning the replacement API and notes. - Evidence-Based Migration: Looks up the modern call shape with swiftui-ctx lookup and real code examples pinned to GitHub permalinks before rewriting. - Modernization Beyond Deprecation: Upgrades stale patterns like ObservableObject to @Observable and NavigationView to NavigationStack/NavigationSplitView. - Use Case: Given a legacy macOS settings view using .foregroundColor, NavigationView, and presentationMode, the Skill flags each deprecated API, reports old-to-new mappings with evidence, and applies the migrations. ## Quick Start Ask the agent to modernize the deprecated SwiftUI APIs in your macOS view file using verified production patterns.

Frequently Asked Questions about swiftui-modernize

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate deprecated SwiftUI APIs in a macOS app?

Scan the target file for SwiftUI symbols, then run swiftui-ctx deprecated <api> for each one to get the replacement and a note. Confirm the new call shape with swiftui-ctx lookup <replacement> and rewrite using a real example from shipping apps.

What replaces NavigationView and foregroundColor in modern SwiftUI?

NavigationView is replaced by NavigationStack for single-column layouts or NavigationSplitView for sidebar-plus-detail macOS layouts. foregroundColor is replaced by foregroundStyle, which accepts any ShapeStyle including gradients and hierarchical styles.

Can SwiftUI code compile but still use deprecated APIs?

Yes, a call that compiles can still be deprecated, which is why the Skill checks every symbol against the catalog instead of trusting compilation. The catalog flags deprecation status across 200 to 1,100 real repositories.

Should I use ObservableObject or @Observable in new macOS code?

Prefer @Observable final classes with @State over ObservableObject with @Published and @StateObject. This is a modernization rather than a formal deprecation, and the migration table in references/migrations.md covers the conversion pattern.

What happens if the SwiftUI catalog is not available?

If swiftui-ctx returns exit code 5 meaning no catalog is found, the Skill stops and tells the user rather than fabricating a migration. For not-found symbols (exit code 3), it retries with a broader search term.