Agent skill

Swiftui View Refactor

by harperreed in harperreed/dotfiles

Refactor and review SwiftUI view files for consistent structure, dependency injection, and Observation usage.

No licenceAuto-check passedDevelopment

Install Swiftui View Refactor

skills CLI
$ npx skills add harperreed/dotfiles --skill swiftui-view-refactor -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install harperreed/dotfiles swiftui-view-refactor --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/harperreed/dotfiles.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/swiftui-view-refactor .claude/skills/swiftui-view-refactor && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
swiftui-view-refactor
GitHub stars
334
Used in
5 other repos
Token cost
~1.3k tokens
SKILL.md length
470 words
Files
2 (incl. references)
Skills in repo
32
Repo updated
First seen
Licence
None found

At a glance

Refactor and review SwiftUI view files for consistent structure, dependency injection, and Observation usage.

  • Works in 5 steps: View ordering (top → bottom) → Prefer MV (Model-View) patterns → Split large bodies and view properties → …
  • Asked to clean up a SwiftUI views layout/ordering
  • SKILL.md covers Overview, Core Guidelines, Workflow and Notes, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Swiftui View Refactor is an agent skill from harperreed/dotfiles. Refactor and review SwiftUI view files for consistent structure, dependency injection, and Observation usage. Use when asked to clean up a SwiftUI view’s layout/ordering, handle view models safely (non-optional when possible), or standardize how dependencies and @Observable state are initialized and passed.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/mv-patterns.md`).

It sits in Development, covering Refactoring and Design patterns. It works with SwiftUI. The repository describes itself as: Dotfiles. Managed by YADM.

When your agent uses it

  • Asked to clean up a SwiftUI views layout/ordering
  • Handle view models safely (non-optional when possible)
  • Standardize how dependencies and @Observable state are initialized and passed

Example prompts

  • “/swiftui-view-refactor”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. View ordering (top → bottom)
  2. Prefer MV (Model-View) patterns
  3. Split large bodies and view properties
  4. View model handling (only if already present)
  5. Observation usage

What it can do on your machine

Read from SKILL.md and the folder at commit b78c10e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are swift).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Swiftui View Refactor loads about 1.3k tokens when it runs, and up to ~3.3k if it reads all its reference files. Until then it costs about 83 tokens; SKILL.md has 470 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~83
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Without a licence we can't republish the file, so here is its outline and opening line. It has 470 words (~1,314 tokens).

“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.”

— opening of SKILL.md by harperreed
name
swiftui-view-refactor

Read the full SKILL.md on GitHub

Files

SKILL.md and 1 other file (references) in .claude/skills/swiftui-view-refactor of harperreed/dotfiles.

  • SKILL.md
  • references/mv-patterns.md

Open the folder on GitHubat commit b78c10e

Used in 5 other repositories

We found 5 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 5 other GitHub owners. This page covers the copy in harperreed/dotfiles, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Swiftui View Refactor next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Swiftui View Refactor compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Swiftui View Refactor this skillharperreed/dotfiles3345 repos~1.3kAutomated safety check: PassNone
Swiftui View RefactorDimillian/Skills4k5 repos~2kAutomated safety check: PassMIT
RTK Rust Design Patternsrtk-ai/rtk83k—~1.9kAutomated safety check: PassApache-2.0
Architecture PatternsKartikLabhshetwar/better-shot2.4k2 repos~1.4kAutomated safety check: PassCustom licence
AST Visitor Pattern for Unionsprisma/orm48k—~830Automated safety check: PassApache-2.0
Coding Best PracticesKartikLabhshetwar/better-shot2.4k2 repos~1.8kAutomated safety check: PassCustom licence

Similar skills

  • Swiftui View Refactor

    Dimillian/Skills

    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.

    4k GitHub starsUsed in 5 repos~2k tokens
    DevelopmentAuto-check passed
  • Describes seven Rust design patterns for the RTK CLI filter modules, with when to use each, RTK examples, and notes on when a pattern is overkill.

    83k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Architecture Patterns

    KartikLabhshetwar/better-shot

    Deep dive into software architecture for macOS. An agent skill from KartikLabhshetwar/better-shot.

    2.4k GitHub starsUsed in 2 repos~1.4k tokens
    DevelopmentAuto-check passed
  • Official

    Replaces a plain TypeScript union plus switch statements with frozen subclasses and a visitor interface when several places dispatch on the same variants.

    48k GitHub stars~830 tokensUpdated today
    DevelopmentAuto-check passed
  • Coding Best Practices

    KartikLabhshetwar/better-shot

    Reviews macOS Swift 6+ code for modern idioms, SOLID principles, SwiftData patterns, and concurrency best practices.

    2.4k GitHub starsUsed in 2 repos~1.8k tokens
    DevelopmentAuto-check passed
  • Solid

    ramziddin/solid-skills

    A skill your agent uses when writing code, implementing features, refactoring, planning architecture, designing systems, reviewing code, or debugging.

    606 GitHub stars~2.7k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed

More from harperreed/dotfiles

All 32 skills in this repo
  • Swiftui Liquid Glass

    harperreed/dotfiles

    Implement, review, or improve SwiftUI features using the iOS 26+ Liquid Glass API.

    334 GitHub starsUsed in 8 repos~941 tokens
    Auto-check passed
  • Swiftui Performance Audit

    harperreed/dotfiles

    Audit and improve SwiftUI runtime performance from code review and architecture.

    334 GitHub starsUsed in 8 repos~1.4k tokens
    Auto-check passed
  • Skill Creator

    harperreed/dotfiles

    Create or update a Codex skill with appropriately scoped instructions and any needed supporting resources.

    334 GitHub starsUsed in 2 repos~3.8k tokens
    Auto-check passed
  • App Store Changelog

    harperreed/dotfiles

    Create user-facing App Store release notes by collecting and summarizing all user-impacting changes since the last git tag (or a specified ref).

    334 GitHub starsUsed in 4 repos~465 tokens
    Auto-check passed
  • Nothing Design

    harperreed/dotfiles

    This skill should be used when the user explicitly says "Nothing style", "Nothing design", "/nothing-design", or directly asks to use/apply the Nothing design system.

    334 GitHub starsUsed in 3 repos~2.3k tokens
    Auto-check passed
  • Native App Performance

    harperreed/dotfiles

    Native macOS/iOS app performance profiling via xctrace/Time Profiler and CLI-only analysis of Instruments traces.

    334 GitHub starsUsed in 4 repos~538 tokens
    Auto-check passed

Works with

Categories

Questions about Swiftui View Refactor

What does Swiftui View Refactor do?

Refactor and review SwiftUI view files for consistent structure, dependency injection, and Observation usage. Swiftui View Refactor is an agent skill from harperreed/dotfiles. Refactor and review SwiftUI view files for consistent structure, dependency injection, and Observation usage.

When should I use Swiftui View Refactor?

Swiftui View Refactor fits situations like: asked to clean up a SwiftUI views layout/ordering; handle view models safely (non-optional when possible); standardize how dependencies and @Observable state are initialized and passed.

How do I install Swiftui View Refactor in Claude Code?

Run `npx skills add harperreed/dotfiles --skill swiftui-view-refactor -a claude-code`. Or copy the skill folder (.claude/skills/swiftui-view-refactor in harperreed/dotfiles) into .claude/skills/swiftui-view-refactor in your project. Claude Code loads it when a task matches its description.

How do I install Swiftui View Refactor in Codex?

Run `npx skills add harperreed/dotfiles --skill swiftui-view-refactor -a codex`. Or copy the skill folder (.claude/skills/swiftui-view-refactor in harperreed/dotfiles) into .agents/skills/swiftui-view-refactor in your project. Codex loads it when a task matches its description.

Can I use Swiftui View Refactor in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add harperreed/dotfiles --skill swiftui-view-refactor -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/swiftui-view-refactor, .gemini/skills/swiftui-view-refactor, .github/skills/swiftui-view-refactor and .opencode/skills/swiftui-view-refactor in your project.

What does Swiftui View Refactor need to run?

SKILL.md names no scripts, command-line tools or credentials: Swiftui View Refactor is instructions for the agent only.

Does Swiftui View Refactor access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Swiftui View Refactor safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Swiftui View Refactor use?

No licence was found for Swiftui View Refactor or its repository. Without one, default copyright applies: ask the author before reusing or redistributing it.

How many tokens does Swiftui View Refactor use?

About 1.3k tokens (SKILL.md is roughly 5.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2k tokens, read only when the agent opens those files.

What are the alternatives to Swiftui View Refactor?

Skills that share tags, products or a category with Swiftui View Refactor: Swiftui View Refactor (Dimillian/Skills, 4k stars), RTK Rust Design Patterns (rtk-ai/rtk, 83k stars), Architecture Patterns (KartikLabhshetwar/better-shot, 2.4k stars) and AST Visitor Pattern for Unions (prisma/orm, 48k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Swiftui View Refactor?

harperreed (a GitHub user) maintains it in harperreed/dotfiles, which has 334 GitHub stars. The repository holds 32 skills in this directory. The repository was last updated on October 3, 2026.

Source: harperreed/dotfiles on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.