Refactor and review SwiftUI view files for consistent structure, dependency injection, and Observation usage. Use when asked to clean up a SwiftUI view’s layout/ordering, handle view models safely (non-optional when possible), or standardize how dependencies and @Observable state are initialized and passed.
Install with Tessl CLI
npx tessl i github:Dimillian/Skills --skill swiftui-view-refactor94
Does it follow best practices?
Validation for skill structure
View member ordering
Environment first
100%
100%
Let before @State
0%
100%
State before computed non-view
100%
100%
Computed non-view before init
100%
100%
Init before body
100%
100%
Body before view builders
100%
100%
View builders before helpers
100%
100%
Helper funcs at bottom
100%
100%
No ordering regressions
100%
100%
Behavior preserved
100%
100%
Output file present
100%
100%
Without context: $0.1834 · 46s · 8 turns · 9 in / 2,607 out tokens
With context: $0.4024 · 1m 25s · 16 turns · 18 in / 5,351 out tokens
MV pattern / no ViewModel
No ViewModel class
100%
100%
@Environment for service
100%
100%
@State for local state
100%
100%
.task for async fetch
100%
100%
Loading state handled
100%
100%
Error state handled
100%
100%
Loaded state displayed
100%
100%
Services not duplicated
100%
100%
View stays composable
50%
100%
Output file present
100%
100%
Without context: $0.1440 · 27s · 8 turns · 9 in / 1,611 out tokens
With context: $0.2788 · 55s · 15 turns · 62 in / 2,664 out tokens
Stable view tree and ViewModel
ViewModel non-optional
100%
100%
@State for ViewModel
100%
100%
Init-based initialization
100%
100%
No bootstrapIfNeeded
100%
100%
No optional unwrap force
100%
100%
Stable root view
0%
100%
Conditions in modifiers/content
0%
100%
Dependencies via init
100%
100%
Behavior intact
100%
100%
Output file present
100%
100%
Without context: $0.3389 · 1m 48s · 8 turns · 9 in / 7,283 out tokens
With context: $0.5260 · 2m 14s · 21 turns · 321 in / 7,372 out tokens
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.