Agent skill · Data & Analytics

swiftui-view-refactor

Refactor SwiftUI views into smaller components with stable, explicit data flow.

Nick44,086★ · +407/wk · 1 repos on radarProfile →
claude-codecodexcursorMIT
Install
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.

Facts
Files in the skill folder: 3
SKILL.md size: 8 KB
Bundled scripts: none
Path: skills/swiftui-view-refactor/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 44,414 · +328 this week
Language: Python
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

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. ## 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,

What's inside
Steps it walks through
  1. Overview
  2. When to Use
  3. Core Guidelines
  4. 1) View ordering (top → bottom)
  5. 2) Default to MV, not MVVM
  6. 3) Strongly prefer dedicated subview types over computed some View helpers
  7. 3b) Extract actions and side effects out of body
  8. 4) Keep a stable view tree (avoid top-level conditional view swapping)
  9. 5) View model handling (only if already present or explicitly requested)
  10. 6) Observation usage
  11. Workflow
  12. Notes
  13. Large-view handling
  14. Limitations
Ships with 2 files
  • agents/openai.yaml
  • references/mv-patterns.md
More from agentic-awesome-skills
All skills →
About this skill
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.

Keep going