Creator · Prisma-Labs-Dev
Last updated · Sep 3, 2026
Refactor and review SwiftUI view files with strong defaults for small dedicated subviews, MV-over-MVVM data flow, stable view trees, explicit dependency injection, and correct Observation usage. Use when cleaning up a SwiftUI view, splitting long bodies, removing inline actions o
Sandbox only
Install targets
Codex install prompt
Install the "guide-swiftui-view-refactor" agent skill from https://github.com/Prisma-Labs-Dev/apple-skills/tree/main/disabled-skills/guide-swiftui-view-refactor. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Refactor and review SwiftUI view files with strong defaults for small dedicated subviews, MV-over-MVVM data flow, stable view trees, explicit dependency injection, and correct Observation usage. Use when cleaning up a SwiftUI view, splitting long bodies, removing inline actions or side effects, reducing computed `some View` helpers, or standardizing `@Observable` and view model initialization patterns. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"prisma-labs-dev-guide-swiftui-view-refactor","task":"Install guide-swiftui-view-refactor","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
GitHub automation
I need my agent to triage GitHub issues, review pull requests, and summarize repository changes.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add Prisma-Labs-Dev/apple-skills --skill guide-swiftui-view-refactor
Maintenance
fresh
28d since push
Risk
Risky
Financial research output is not financial advice; require human review before any live investment decision
GitHub quality
323
72/100 Quality · 79/100 Trust
Coverage tags
Review notes
Financial research output is not financial advice; require human review before any live investment decision · Potential broker, wallet, exchange, or real-money execution surface; sandbox and explicit approval are required
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
RiskyA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
323 GitHub stars
Repo activity
323 stars, 18 forks
Maintenance
28d since push
License
MIT
Install
npx skills add Prisma-Labs-Dev/apple-skills --skill guide-swiftui-view-refactor
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add Prisma-Labs-Dev/apple-skills --skill guide-swiftui-view-refactorDo not use when
Alternative
175.1K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
85.2K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
1.8K Stars
npx skills add Alisa0808/vox-director --skill vox-director
Alternative
175.1K Stars
npx skills add anthropics/skills --skill canvas-design
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
medium
Skill may inspect schemas, query databases, or work with persistent stores.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20guide-swiftui-view-refactor%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20guide-swiftui-view-refactor%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/prisma-labs-dev-guide-swiftui-view-refactor/install
Agent should check
Copy prompt
Task: Use guide-swiftui-view-refactor in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20guide-swiftui-view-refactor%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/prisma-labs-dev-guide-swiftui-view-refactor/install
Install command: npx skills add Prisma-Labs-Dev/apple-skills --skill guide-swiftui-view-refactor
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/prisma-labs-dev-guide-swiftui-view-refactor/install
LLM text format
/api/skills/prisma-labs-dev-guide-swiftui-view-refactor/install?format=text
Find alternatives
/api/skills/search?q=guide-swiftui-view-refactor&limit=3
Agent prompt
Use guide-swiftui-view-refactor for this task. Review https://www.openagentskill.com/api/skills/prisma-labs-dev-guide-swiftui-view-refactor/install, then install with: npx skills add Prisma-Labs-Dev/apple-skills --skill guide-swiftui-view-refactorRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/prisma-labs-dev-guide-swiftui-view-refactor
LLM text
/api/registry/manifest/prisma-labs-dev-guide-swiftui-view-refactor?format=text
Install alias
/api/registry/install/prisma-labs-dev-guide-swiftui-view-refactor
Recommend
/api/registry/recommend?task=Use%20guide-swiftui-view-refactor%20in%20an%20agent%20workflow&limit=3
Agent fit
GitHub automation
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Prototype with this skill first; keep a fallback candidate ready.
Role in stack
Fallback candidate
Primary fit
GitHub automation
Trust label
Prototype first
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO323 GitHub stars
Stars/forks activity
CHECK323 stars, 18 forks; issue activity unavailable in current metadata
Recent maintenance
PASS28d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Manage repositories
I need my agent to triage GitHub issues, review pull requests, and summarize repository changes.
Parse messy files
I need my agent to read PDFs, extract tables, and turn documents into structured data.
Operate local tools
I need my agent to operate local files and desktop apps in a repeatable workflow.
Workflow fit
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Ingest, retrieve, and cite
A workflow for document-heavy agents that ingest files, create searchable knowledge, retrieve relevant context, and answer with grounded sources.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
--- name: guide-swiftui-view-refactor description: Refactor and review SwiftUI view files with strong defaults for small dedicated subviews, MV-over-MVVM data flow, stable view trees, explicit dependency injection, and correct Observation usage. Use when cleaning up a SwiftUI view, splitting long bodies, removing inline actions or side effects, reducing computed `some View` helpers, or standardizing `@Observable` and view model initialization patterns. type: guide origin: https://github.com/Dimillian/Skills license: MIT ---
> **Guide Skill** — This is an expert workflow/pattern guide, not API reference documentation. > Originally from [Dimillian/Skills](https://github.com/Dimillian/Skills) by Thomas Ricouard. MIT License.
# 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.
## 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, not in the view body. - Do not introduce a view model just to mirror local view state or wrap environment dependencies. - If a screen is getting large, split the UI into subviews before inventing a new view model layer.
### 3) Strongly prefer dedicated subview types over computed `some View` helpers - Flag `body` properties that are longer than roughly one screen or contain multiple logical sections. - Prefer extracting dedicated `View` types for non-trivial sections, especially when they have state, async work, branching, or deserve their own preview. - Keep computed `some View` helpers rare and small. Do not build an entire screen out of `private var header: some View`-style fragments. - Pass small, explicit inputs (data, bindings, callbacks) into extracted subviews instead of handing down the entire parent state. - If an extracted subview becomes reusable or independently meaningful, move it to its own file.
Prefer:
```swift var body: some View { List { HeaderSection(title: title, subtitle: subtitle) FilterSection( filterOptions: filterOptions, selectedFilter: $selectedFilter ) ResultsSection(items: filteredItems) FooterSection() } }
private struct HeaderSection: View { let title: String let subtitle: String
var body: some View { VStack(alignment: .leading, spacing: 6) { Text(title).font(.title2) Text(subtitle).font(.subheadline) } } }
private struct FilterSection: View { let filterOptions: [FilterOption] @Binding var selectedFilter: FilterOption
var body: some View { ScrollView(.horizontal, showsIndicators: false) { HStack { ForEach(filterOptions, id: \.self) { option in FilterChip(option: option, isSelected: option == selectedFilter) .onTapGesture { selectedFilter = option } } } } } } ```
Avoid:
```swift 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) } } ```
### 3b) Extract actions and side effects out of `body` - Do not keep non-trivial button actions inline in the view body. - Do not bury business logic inside `.task`, `.onAppear`, `.onChange`, or `.refreshable`. - Prefer calling small private methods from the view, and move real business logic into services/models. - The body should read like UI, not like a view controller.
```swift Button("Save", action: save) .disabled(isSaving)
.task(id: searchText) { await reload(for: searchText) }
private func save() { Task { await saveAsync() } }
private func reload(for searchText: String) async { guard !searchText.isEmpty else { results = [] return } await searchService.search(searchText) } ```
### 4) Keep a stable view tree (avoid top-level conditional view swapping) - Avoid `body` or computed views that return completely different root branches via `if/else`. - Prefer a single stable base view with conditions inside sections/modifiers (`overlay`, `opacity`, `disabled`, `toolbar`, etc.). - Root-level branch swapping causes identity churn, broader invalidation, and extra recomputation.
Prefer:
```swift var body: some View { List { documentsListContent } .toolbar { if canEdit { editToolbar } } } ```
Avoid:
```swift var documentsListView: some View { if canEdit { editableDocumentsList } else { readOnlyDocumentsList } } ```
### 5) View model handling (only if already present or explicitly requested) - Treat view models as a legacy or explicit-need pattern, not the default. - 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 create the view model in the view's `init`. - Avoid `bootstrapIfNeeded` patterns and other delayed setup workarounds.
Example (Observation-based):
```swift @State private var viewModel: SomeViewModel
init(dependency: Dependency) { _viewModel = State(initialValue: SomeViewModel(dependency: dependency)) } ```
### 6) Observation usage - For `@Observable` reference types on iOS 17+, store them as `@State` in the owning view. - Pass observables down explicitly; avoid optional state unless the UI genuinely needs it. - If the deployment target includes iOS 16 or earlier, use `@StateObject` at the owner and `@ObservedObject` when injecting legacy observable models.
## Workflow
1. Reorder the view to match the ordering rules. 2. Remove inline actions and side effects from `body`; move business logic into services/models and keep only thin orchestration in the view. 3. Shorten long bodies by extracting dedicated subview types; avoid rebuilding the screen out of many computed `some View` helpers. 4. Ensure stable view structure: avoid top-level `if`-based branch swapping; move conditions to localized sections/modifiers. 5. If a view model exists or is explicitly required, replace optional view models with a non-optional `@State` view model initialized in `init`. 6. Confirm Observation usage: `@State` for root `@Observable` models on iOS 17+, legacy wrappers only when the deployment target requires them. 7. Keep behavior intact: do not change layout or business logic unless requested.
## Notes
- Prefer small, explicit view types over large conditional blocks and large computed `some View` properties. - Keep computed view builders below `body` and non-view computed vars above `init`. - A good SwiftUI refactor should make the view read top-to-bottom as data flow plus layout, not as mixed layout and imperative logic. - For MV-first guidance and rationale, see `references/mv-patterns.md`.
## Large-view handling
When a SwiftUI view file exceeds ~300 lines, split it aggressively. Extract meaningful sections into dedicated `View` types instead of hiding complexity in many computed properties. Use `private` extensions with `// MARK: -` comments for actions and helpers, but do not treat extensions as a substitute for breaking a giant screen into smaller view types. If an extracted subview is reused or independently meaningful, move it into its own file.
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for guide-swiftui-view-refactor, ready for a manual X post.
guide-swiftui-view-refactor: Refactor and review SwiftUI view files with strong defaults for small dedicated subviews, MV-... 323 stars https://www.openagentskill.com/skills/prisma-labs-dev-guide-swiftui-view-refactor?ref=x
Listing + install path for guide-swiftui-view-refactor: https://www.openagentskill.com/skills/prisma-labs-dev-guide-swiftui-view-refactor?ref=x Install: npx skills add Prisma-Labs-Dev/apple-skills --skill guide-swiftui-view-refactor
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to Prisma-Labs-Dev but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/prisma-labs-dev-guide-swiftui-view-refactor?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/prisma-labs-dev-guide-swiftui-view-refactor?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/prisma-labs-dev-guide-swiftui-view-refactor/audit)
[](https://www.openagentskill.com/skills/prisma-labs-dev-guide-swiftui-view-refactor?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)Prisma-Labs-Dev
@prisma-labs-dev
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
175.1K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
85.2K StarsVox Director
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
1.8K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
175.1K StarsPermission surface
filesystem or document access, network or browser access
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness