swiftui-view-refactor

Community

Streamline SwiftUI view wiring for cleaner code.

AuthorBumpyClock
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Refactor SwiftUI view files to enforce consistent structure, proper dependency injection, and correct Observation usage across projects.

Core Features & Use Cases

  • Enforces a top-to-bottom view ordering: Environment, private/public lets, @State, computed properties, init, body, then helpers.
  • Encourages MV patterns by keeping views lightweight and pushing business logic to services/models via @Environment and orchestration with @State/@Query.
  • Suggests splitting large bodies into subviews and extracting complex sections into dedicated Views to improve readability and reuse.
  • Ensures proper Observation usage and non-optional view state where appropriate, reducing boilerplate and crash risk.
  • Use Case: refactor a large SwiftUI view with nested components into smaller pieces without affecting layout.

Quick Start

Provide the SwiftUI view file to refactor, and I will reorder the view, extract subviews, and adjust dependency and observation usage according to the guidelines.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: swiftui-view-refactor
Download link: https://github.com/BumpyClock/dotfiles/archive/main.zip#swiftui-view-refactor

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.