Macos View Refactor

Refactor macOS SwiftUI views and scenes into stable structure. Use when splitting large views, tightening scene state, or narrowing AppKit escapes.

49 stars 5 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add robinebers/skills --skill macos-view-refactor
Manual install
git clone --depth 1 https://github.com/robinebers/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/skills/macos-view-refactor ~/.claude/skills/macos-view-refactor

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# View Refactor

## Overview

Refactor macOS views toward small, explicit, stable scene and view types. Default
to native SwiftUI for layout, selection, commands, and settings. Reach for AppKit
only at the narrow edges where desktop behavior truly requires it.

## Core Guidelines

### 1) Model scenes explicitly

- Break the app into meaningful scene roots: main window, settings, utility windows, inspectors, or menu bar extras.
- Do not let one giant root view silently own every desktop surface.

### 2) Keep a predictable file shape

- Follow this ordering unless the file already has a stronger local convention:
- Environment
- `private`/`public` `let`
- `@State` / other stored properties
- computed `var` (non-view)
- `init`
- `body`
- computed view builders / other view helpers
- helper / async functions

### 2b) Split files by responsibility

- For non-trivial apps, do not keep the full app, all views, models, stores, networking clients, process clients, and helpers in one Swift file.
- Accept a single Swift file only for tiny throwaway examples or snippets: roughly under 50 lines, one screen, no persistence, no networking/process client, and no reusable models.
- Use `App/<AppName>App.swift` for the `@main` app and `AppDelegate` only.
- Keep `Views/ContentView.swift` focused on root layout and composition; move feature UI into files such as `Views/SidebarView.swift`, `Views/DetailView.swift`, and `Views/ComposerView.swift`.
Read the full skill on GitHub

Details

Skill name
macos-view-refactor
Path
skills/macos-view-refactor/SKILL.md
Repo updated
25 June 2026

FAQ

What does the Macos View Refactor skill do?

Refactor macOS SwiftUI views and scenes into stable structure. Use when splitting large views, tightening scene state, or narrowing AppKit escapes.

How do I install the Macos View Refactor skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add robinebers/skills --skill macos-view-refactor. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Macos View Refactor popular?

It lives in robinebers/skills, which has 49 GitHub stars and 5 forks.

Related skills

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.