swiftui-view-refactor
Skill7.2k starsChanged 2 months agoMITView on GitHub
SwiftUI view refactor/review: layout, DI, Observation, view models.
7 other projects use a version of this, 7 of them edited.
Trending
Less talk lately.about the whole repository
Most recently taken up by
- omarshahine/HomeClawedited, first seen Sep 29, 2026
- fiveonecode/agent-skillsedited, first seen Sep 6, 2026
- robinebers/skillsedited, first seen Jun 25, 2026
- openai/pluginsedited, first seen May 13, 2026
- Dimillian/Skillsedited, first seen Mar 6, 2026
- ParkerRex/Skillsedited, first seen Feb 27, 2026
Who's talking about steipete/agent-scripts
- waddle-social/waddle“fix(server): accept text/html link previews served with unknown-total range”GitHub · Jun 18, 2026 · 2 reactions
- ArchonVII/github-workflows“Review scripts for potential integration”GitHub · Jun 16, 2026 · 1 reactions
- sator-imaging/suggest-skills“[bot] Generate Manifests”GitHub · Oct 3, 2026
- sudosubin/agents.nix“agent-skills.github.steipete.agent-scripts: init at 0.12.0”GitHub · Oct 2, 2026
- sator-imaging/suggest-skills“[bot] Generate Manifests”GitHub · Sep 30, 2026
The biggest 5 of 35 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 35
Talked about on GitHub (35 times).
On GitHub · 35
- Jun 18, 2026fix(server): accept text/html link previews served with unknown-total range — waddle-social/waddle2 reactions · 2 comments
- Jun 16, 2026Review scripts for potential integration — ArchonVII/github-workflows1 reaction
- Oct 3, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Oct 2, 2026agent-skills.github.steipete.agent-scripts: init at 0.12.0 — sudosubin/agents.nix0 reactions
- Sep 30, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
30 more on GitHub
- Sep 24, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 23, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 23, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 19, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 19, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Aug 31, 2026[upstream] chore: refresh upstream skills to 8649e48; graduate one-password to native — novotnyllc/agent-utilities0 reactions
- Aug 29, 2026docs: replace retired gitcrawl gh workflow examples — openclaw/gitcrawl0 reactions · 2 comments
- Aug 25, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 21, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 18, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 14, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 11, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 7, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 4, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Jul 31, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Jul 31, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Jul 28, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Jul 24, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Jul 20, 2026build(deps): bump plugins/steipete-agent-scripts from `e3b05be` to `b7f7269` — mikeastock/dotfiles0 reactions
- Jul 18, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Jul 15, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Jul 13, 2026build(deps): bump plugins/steipete-agent-scripts from `e3b05be` to `01e4910` — mikeastock/dotfiles0 reactions · 1 comment
- Jul 10, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Jun 30, 2026feat: Use to triage issues — joeldevz/skynex-pi0 reactions
- Jun 11, 2026research(swarm,review-cycle): live end-to-end proof via computer use as a verification tier (extends #1357) — deftai/directive0 reactions
- Jun 11, 2026feat(triage): contributor trust signals in triage:queue (extends #1318) — deftai/directive0 reactions · 1 comment
- Jun 11, 2026feat(swarm,review-cycle): decision-ready boundary + owner decision brief (human-facing handoff contract) — deftai/directive0 reactions
- May 29, 2026Review steipete/agent-scripts skills for adoption candidates — NodeJSmith/Claudefiles0 reactions
- Apr 2, 2026Skill discovery: alternativas ao fluxo nexus_list + nexus_get — dougss/nexus0 reactions
- Dec 30, 2025agent-scripts — nicholaswilde/homelab0 reactions
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 7
- openai/plugins★ 7.3k19% same
- Dimillian/Skills★ 4k19% same
- omarshahine/HomeClaw★ 17618% same
- robinebers/skills★ 4819% same
- fiveonecode/agent-skills★ 1918% same
- eugenepyvovarov/mcpbundler-agent-skills-marketplace★ 1169% same
- ParkerRex/Skills★ 291% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository54 other files it gives its agents.
- AGENTS.MDAGENTS.md
- agent-transcriptSkill
- beeperSkill
- browser-useSkill
- clawsweeper-statusSkill
- clickclackSkill
- cloudflare-registrarSkill
- codexbarSkill
- codex-debuggingSkill
- codex-firstSkill
- codex-huge-contextSkill
- create-cliSkill
- discord-clawdSkill
- domain-dns-opsSkill
- fleet-maintenanceSkill
- frontend-designSkill
- github-author-contextSkill
- github-cache-hygieneSkill
- github-deep-reviewSkill
- github-project-triageSkill
- hopper-debuggerSkill
- instruments-profilingSkill
- mac-maintenanceSkill
- maintainer-orchestratorSkill
- markdown-converterSkill
- nano-banana-proSkill
- native-app-performanceSkill
- notcrawlSkill
- npmSkill
- obsidianSkill
- openai-image-genSkill
- openclaw-relaySkill
- oracleSkill
- project-structureSkill
- release-mac-appSkill
- release-tweetsSkill
- remindersSkill
- remote-macSkill
- skill-cleanerSkill
- sonosSkill
- speakingSkill
- ssh-doctorSkill
- swift-concurrency-expertSkill
- swiftui-liquid-glassSkill
- swiftui-performance-auditSkill
- telecrawlSkill
- things-todoSkill
- twilio-smsSkill
- video-transcript-downloaderSkill
- vm-labSkill
- whatsappSkill
- wranglerSkill
- xcode-syncSkill
- xurlSkill
The file
We split this skill into the rules it gives an agent
9 rules. 3 are common, 3 are distinctive, and 3 are very specific to this project.
3
Common
Most of the 7 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Default to MV: Views are lightweight state expressions.
- Very specific: line 32
If body grows beyond a screen or has multiple logical sections, split it into smaller subviews.
- Distinctive: line 35
Prefer passing small inputs (data, bindings, callbacks) over reusing the entire parent view state.
- Common: line 103
Do not introduce a view model unless the request or existing code clearly calls for one.
- Common: line 104
If a view model exists, make it non-optional when possible.
- Very specific: line 126
If a view model exists, replace optional view models with a non-optional @State view model initialized in init by passing dependencies from …
- Common: line 128
Keep behavior intact: do not change layout or business logic unless requested.
- Distinctive: line 132
Prefer small, explicit helpers over large conditional blocks.
- Very specific: line 133
Keep computed view builders below body and non-view computed vars above init.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SwiftUI View Refactor
Attribution: copied from @Dimillian’s Dimillian/Skills (2025-12-31).
Overview
Apply a consistent structure and dependency pattern to SwiftUI views, with a focus on ordering, Model-View (MV) patterns, careful view model handling, and correct Observation usage.
Core Guidelines
1) View ordering (top → bottom)
- Environment
private/publiclet@State/ other stored properties- computed
var(non-view) initbody- computed view builders / other view helpers
- helper / async functions
2) Prefer MV (Model-View) patterns
- Default to MV: Views are lightweight state expressions; models/services own business logic.
- Favor
@State,@Environment,@Query, andtask/onChangefor orchestration. - Inject services and shared models via
@Environment; keep views small and composable. - Split large views into subviews rather than introducing a view model.
3) Split large bodies and view properties
- If
bodygrows beyond a screen or has multiple logical sections, split it into smaller subviews. - Extract large computed view properties (
var header: some View { ... }) into dedicatedViewtypes when they carry state or complex branching. - It's fine to keep related subviews as computed view properties in the same file; extract to a standalone
Viewstruct only when it structurally makes sense or when reuse is intended. - Prefer passing small inputs (data, bindings, callbacks) over reusing the entire parent view state.
Example (extracting a section):
var body: some View {
VStack(alignment: .leading, spacing: 16) {
HeaderSection(title: title, isPinned: isPinned)
DetailsSection(details: details)
ActionsSection(onSave: onSave, onCancel: onCancel)
}
}Example (long body → shorter body + computed views in the same file):
var body: some View {
List {
header
filters
results
footer
}
}
private var header: some View {
VStack(alignment: .leading, spacing: 6) {
Text(title).font(.title2)
Text(subtitle).font(.subheadline)
}
}
private var filters: some View {
ScrollView(.horizontal, showsIndicators: false) {
HStack {
ForEach(filterOptions, id: \.self) { option in
FilterChip(option: option, isSelected: option == selectedFilter)
.onTapGesture { selectedFilter = option }
}
}
}
}Example (extracting a complex computed view):
private var header: some View {
HeaderSection(title: title, subtitle: subtitle, status: status)
}
private struct HeaderSection: View {
let title: String
let subtitle: String?
let status: Status
var body: some View {
VStack(alignment: .leading, spacing: 4) {
Text(title).font(.headline)
if let subtitle { Text(subtitle).font(.subheadline) }
StatusBadge(status: status)
}
}
}4) View model handling (only if already present)
- Do not introduce a view model unless the request or existing code clearly calls for one.
- If a view model exists, make it non-optional when possible.
- Pass dependencies to the view via
init, then pass them into the view model in the view'sinit. - Avoid
bootstrapIfNeededpatterns.
Example (Observation-based):
@State private var viewModel: SomeViewModel
init(dependency: Dependency) {
_viewModel = State(initialValue: SomeViewModel(dependency: dependency))
}5) Observation usage
- For
@Observablereference types, store them as@Statein the root view. - Pass observables down explicitly as needed; avoid optional state unless required.
Workflow
- Reorder the view to match the ordering rules.
- Favor MV: move lightweight orchestration into the view using
@State,@Environment,@Query,task, andonChange. - If a view model exists, replace optional view models with a non-optional
@Stateview model initialized ininitby passing dependencies from the view. - Confirm Observation usage:
@Statefor root@Observableview models, no redundant wrappers. - Keep behavior intact: do not change layout or business logic unless requested.
Notes
- Prefer small, explicit helpers over large conditional blocks.
- Keep computed view builders below
bodyand non-view computed vars aboveinit. - For MV-first guidance and rationale, see
references/mv-patterns.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

