Swiftui View Refactor
Refactor SwiftUI view files into stable, testable structure. Use when splitting large views, tightening data flow, or cleaning Observation ownership.
Install
npx skills add robinebers/skills --skill swiftui-view-refactorgit clone --depth 1 https://github.com/robinebers/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/skills/swiftui-view-refactor ~/.claude/skills/swiftui-view-refactorPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# SwiftUI View Refactor ## Overview Refactor SwiftUI views toward small, explicit, stable view types. Default to vanilla SwiftUI: local state in the view, shared dependencies in the environment, business logic in services/models, and view models only when the request or existing code clearly requires one. ## Core Guidelines ### 1) View ordering (top → bottom) - Enforce this ordering unless the existing file has a stronger local convention you must preserve. - Environment - `private`/`public` `let` - `@State` / other stored properties - computed `var` (non-view) - `init` - `body` - computed view builders / other view helpers - helper / async functions ### 2) Default to MV, not MVVM - Views should be lightweight state expressions and orchestration points, not containers for business logic. - Favor `@State`, `@Environment`, `@Query`, `.task`, `.task(id:)`, and `onChange` before reaching for a view model. - Inject services and shared models via `@Environment`; keep domain logic in services/models, not in the view body. - Do not introduce a view model just to mirror local view state or wrap environment dependencies. - If a screen is getting large, split the UI into subviews before inventing a new view model layer. ### 3) Strongly prefer dedicated subview types over computed `some View` helpers - Flag `body` properties that are longer than roughly one screen or contain multiple logical sections.
Details
- Skill name
swiftui-view-refactor- Repository
- robinebers/skills
- Path
skills/swiftui-view-refactor/SKILL.md- Repo updated
- 25 June 2026
FAQ
What does the Swiftui View Refactor skill do?
Refactor SwiftUI view files into stable, testable structure. Use when splitting large views, tightening data flow, or cleaning Observation ownership.
How do I install the Swiftui View Refactor skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add robinebers/skills --skill swiftui-view-refactor. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Swiftui View Refactor popular?
It lives in robinebers/skills, which has 49 GitHub stars and 5 forks.
Related skills
Building Native UI
49robinebers/skills
Complete guide for building beautiful apps with Expo Router. Covers fundamentals, styling, components, navigation, animations, patterns, and native tabs.
Code Upgrade
49robinebers/skills
Engineering-discipline toolkit for non-technical users working with AI coders. Wields KISS, DRY, YAGNI, fail-fast, and idempotency as commands. Use when the user asks to audit, simplify, clean up, dedupe, or harden code; or says "make this simpler", "any duplicates?", "is this safe to run twice", "explain this app", "find dead code", "simplify the plan", or "find silent failures".
Expo API Routes
49robinebers/skills
Guidelines for creating API routes in Expo Router with EAS Hosting
Upgrading Expo
49robinebers/skills
Guidelines for upgrading Expo SDK versions and fixing dependency issues
Swiftui Performance Audit
49robinebers/skills
Audit SwiftUI runtime performance from code first. Use when diagnosing slow rendering, janky scrolling, expensive updates, or profiling needs.
Android CLI
57javimosch/supercli
Build and release Android apps without full Android Studio
Browse the most popular Claude skills, all mobile development skills, or write your own with the skills generator.