Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

swiftui-view-refactor

Skill by Funput

Refactors SwiftUI view files into smaller, stable and testable structures. It is for developers who want large views split up and cleaner data flow and Observation ownership.

  • Score 80
  • 59 stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install swiftui-view-refactor

Built from the published package, never by AI.

git clone --depth 1 https://github.com/Funput/Funput /tmp/Funput && mkdir -p ~/.claude/skills && cp -r /tmp/Funput/platforms/ios/.agents/skills/swiftui-view-refactor ~/.claude/skills/swiftui-view-refactor

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install swiftui-view-refactor in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

The swiftui-view-refactor skill guides an AI assistant through refactoring SwiftUI view files into small, explicit and stable view types. It sets an ordering for the parts of a view file, favors dedicated subview types over computed some View helpers, and moves actions and side effects out of body. It also covers keeping a stable view tree and choosing the right Observation wrapper.

The guidance defaults to vanilla SwiftUI and MV patterns, using @State, @Environment, and services or models for logic. View models are treated as a legacy or explicit-need pattern and are introduced only when the request or existing code calls for one. The skill is aimed at developers working on SwiftUI codebases who want large views split up. It says to keep behavior and layout intact unless a change is requested.

Written from the project's SKILL.md and checked against it.

What it can do

  • Reorder view filesArranges a SwiftUI view into a consistent order from environment and properties to body and helpers.
  • Split large viewsExtracts non-trivial sections into dedicated View types, with a rule for files over about 300 lines.
  • Move actions out of bodyReplaces inline button actions and side effects with small private methods and services.
  • Stabilize the view treeReplaces top-level if/else root branch swapping with conditions inside sections and modifiers.
  • Clean Observation ownershipUses @State for root @Observable models on iOS 17+ and legacy wrappers when the deployment target needs them.
  • Handle view modelsMakes existing optional view models non-optional and initializes them in init when they are present or required.

What you need

  • A SwiftUI codebase to refactor
  • Web search access to consult current Apple Developer documentation

Try asking

  • Split this 400-line SwiftUI view into smaller subview types
  • Move the inline button actions in this view out of body
  • Fix the Observation ownership in this SwiftUI screen

Good to know

  • Keeps layout and business logic unchanged unless the user asks for a change
  • Does not introduce a view model unless the request or existing code requires one
  • Legacy @StateObject and @ObservedObject guidance applies only when the deployment target includes iOS 16 or earlier

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: platforms/ios/.agents/skills/swiftui-view-refactor/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to swiftui-view-refactor

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

swiftui-view-refactor: common questions

Does this skill introduce view models into SwiftUI code?

No. The source says view models are a legacy or explicit-need pattern and should only be introduced when the request or existing code clearly calls for one.

When should a SwiftUI view be split into subviews?

The source says to flag body properties longer than roughly one screen or with multiple logical sections. Non-trivial sections with state, async work or branching should become their own View types.

Which Observation wrapper does the skill recommend?

For @Observable reference types on iOS 17+, the source says to store them as @State in the owning view. It uses @StateObject and @ObservedObject only when the deployment target includes iOS 16 or earlier.

How do I install swiftui-view-refactor?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is swiftui-view-refactor free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is swiftui-view-refactor safe to use?

It scores 80 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to swiftui-view-refactor?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

swiftui-view-refactor Install

Add to stack

Loading.