swiftui-view-refactor

swiftui-view-refactor is a skill for Claude Code, Codex from eugenepyvovarov/mcpbundler-agent-skills-marketplace. It costs 65 tokens per session (1,395 once invoked), scanned A, a copy of swiftui-view-refactor, MIT.

A guide for organizing SwiftUI view files, passing dependencies, and managing observable state with modern Apple patterns.

In plain words
What is it for?
Use it to review or refactor SwiftUI screens, split large views, and improve view-model or Observation setup.
Why use it?
It reduces tangled view code, unsafe state handling, and inconsistent ways of passing services or models through an app.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to review or refactor SwiftUI screens, split large views, and improve view-model or Observation setup.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/eugenepyvovarov/mcpbundler-agent-skills-marketplace/swiftui-view-refactor
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add eugenepyvovarov/mcpbundler-agent-skills-marketplace --skill swiftui-view-refactor
Clone the repo
git clone --depth 1 https://github.com/eugenepyvovarov/mcpbundler-agent-skills-marketplace

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin swiftui-view-refactor/plugin install swiftui-view-refactor after adding the marketplace above.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for swiftui-view-refactor

README.md
[![agentmods](https://agentmods.dev/badge/skills/eugenepyvovarov/mcpbundler-agent-skills-marketplace/swiftui-view-refactor/github.svg)](https://agentmods.dev/skills/eugenepyvovarov/mcpbundler-agent-skills-marketplace/swiftui-view-refactor)
Your own site
<a href="https://agentmods.dev/skills/eugenepyvovarov/mcpbundler-agent-skills-marketplace/swiftui-view-refactor"><img src="https://agentmods.dev/badge/skills/eugenepyvovarov/mcpbundler-agent-skills-marketplace/swiftui-view-refactor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for swiftui-view-refactor

Your own site · 80×15
<a href="https://agentmods.dev/skills/eugenepyvovarov/mcpbundler-agent-skills-marketplace/swiftui-view-refactor"><img src="https://agentmods.dev/badge/skills/eugenepyvovarov/mcpbundler-agent-skills-marketplace/swiftui-view-refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,395 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00065 $0.01395
Opus 5 $0.00032 $0.00698
Sonnet 5 $0.00013 $0.00279
Haiku 4.5 $0.00006 $0.00139

Measured 9d ago against content hash 3f9b84381434, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

swiftui-view-refactor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to swiftui-view-refactor — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

swiftui-view-refactor/SKILL.md · 170 lines

How it starts

The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SwiftUI View Refactor

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/public let
  • @State / other stored properties
  • computed var (non-view)
  • init
  • body
  • 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, and task/onChange for 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 body grows beyond a screen or has multiple logical sections, split it into smaller subviews.
  • Extract large computed view properties (var header: some View { ... }) into dedicated View types 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 View struct 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 }
            }
        }
    }
}

Read the full file on GitHub · 170 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 170 lines · 65 tokens per session scan A 3f9b84381434

Subscribe to this mod's changes

swiftui-view-refactor is a skill published in the GitHub repository eugenepyvovarov/mcpbundler-agent-skills-marketplace (12 stars, last pushed 6mo ago), licensed MIT. It adds 65 tokens to every session and 1,395 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to swiftui-view-refactor, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

flutter-adaptive-ui

Build, fix, review, and validate adaptive or responsive Flutter UIs for mobile, tablet, desktop, web, large screens, foldables, and mixed input devices. Use when creating breakpoint-driven layouts, responsive navigation, adaptive dialogs/lists/grids, keyboard/mouse/touch behavior, window-size decisions with MediaQuery…

MADTeacher/mad-agents-skills · 83 tokens

safe-area-handling

Complete guide to handling safe areas in Capacitor apps for iPhone notch, Dynamic Island, home indicator, and Android cutouts. Covers CSS, JavaScript, and native solutions. Use this skill when users have layout issues on modern devices.

Cap-go/capgo-skills · 53 tokens

tailwind-capacitor

Guide to using Tailwind CSS in Capacitor mobile apps. Covers mobile-first design, touch targets, safe areas, dark mode, and performance optimization. Use this skill when users want to style Capacitor apps with Tailwind.

Cap-go/capgo-skills · 51 tokens

react-native-unistyles-conventions

Opinionated production conventions for react-native-unistyles v3 (React Native / Expo): Tailwind-style theme scales, dynamic-function styling over conditional arrays, gap-over-margin, theme-only values. Use when styling or theming React Native / Expo components, writing or refactoring StyleSheet.create, converting RN…

AlshehriAli0/agent-skills · 104 tokens

flutter-build-responsive-layout

Use LayoutBuilder, MediaQuery, or Expanded/Flexible to create a layout that adapts to different screen sizes. Use when you need the UI to look good on both mobile and tablet/desktop form factors.

sutchan/Agent-Skills-Hub · 51 tokens

playground

Creates interactive HTML playgrounds — self-contained single-file explorers that let users configure something visually through controls, see a live preview, and copy out a prompt. Use when the user asks to make a playground, explorer, or interactive tool for a topic.

anthropics/claude-plugins-official · 53 tokens