swiftui-view-refactor
Refactor SwiftUI views into smaller components with stable, explicit data flow.
npx skills add sickn33/agentic-awesome-skills --skill swiftui-view-refactor --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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. ## When to Use - When cleaning up a large SwiftUI view or splitting long `body` implementations. - When you need smaller subviews, explicit dependency injection, or better Observation usage. ## 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,
- Overview
- When to Use
- Core Guidelines
- 1) View ordering (top → bottom)
- 2) Default to MV, not MVVM
- 3) Strongly prefer dedicated subview types over computed some View helpers
- 3b) Extract actions and side effects out of body
- 4) Keep a stable view tree (avoid top-level conditional view swapping)
- 5) View model handling (only if already present or explicitly requested)
- 6) Observation usage
- Workflow
- Notes
- Large-view handling
- Limitations
What does the swiftui-view-refactor skill do?
Refactor SwiftUI views into smaller components with stable, explicit data flow.
How do I install it?
Run `npx skills add sickn33/agentic-awesome-skills --skill swiftui-view-refactor --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From sickn33/agentic-awesome-skills, a repository with 44,414 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.