view-refactor

view-refactor is a skill for Codex from fanfan-de/anybox. It costs 33 tokens per session (1,198 once invoked), scanned A, a copy of macos-view-refactor, MIT.

A set of rules for reorganizing macOS SwiftUI views and scenes into smaller, clearer pieces. It favors SwiftUI for normal interface work and limits AppKit, Apple’s older macOS interface framework, to specific platform needs.

In plain words
What is it for?
Use it when splitting large views, separating files by responsibility, clarifying scene state, or reducing unnecessary AppKit code.
Why use it?
It reduces the risk of one large Swift file owning the whole app and makes each window, settings screen, inspector, or menu-bar area easier to understand and change.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it when splitting large views, separating files by responsibility, clarifying scene state, or reducing unnecessary AppKit code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fanfan-de/anybox/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 fanfan-de/anybox --skill view-refactor
Clone the repo
git clone --depth 1 https://github.com/fanfan-de/anybox

Made for: Codex.

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 view-refactor

README.md
[![agentmods](https://agentmods.dev/badge/skills/fanfan-de/anybox/view-refactor/github.svg)](https://agentmods.dev/skills/fanfan-de/anybox/view-refactor)
Your own site
<a href="https://agentmods.dev/skills/fanfan-de/anybox/view-refactor"><img src="https://agentmods.dev/badge/skills/fanfan-de/anybox/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 view-refactor

Your own site · 80×15
<a href="https://agentmods.dev/skills/fanfan-de/anybox/view-refactor"><img src="https://agentmods.dev/badge/skills/fanfan-de/anybox/view-refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,198 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 94% 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.00033 $0.01198
Opus 5.5 $0.00013 $0.00479
Sonnet 5.5 $0.00007 $0.00240
Haiku 4.5 $0.00003 $0.00120

Measured 2mo ago against content hash 924b1a3a6f89, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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 2mo 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

94% identical to macos-view-refactor — 6 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.

plugins/Anybox-Plugins/build-macos-apps/skills/view-refactor/SKILL.md · 110 lines

How it starts

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

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.
  • Move value types and selection enums into Models/*.swift, stores into Stores/*.swift, app-server/network/process clients into Services/*.swift, and small formatters/resolvers/extensions into Support/*.swift.
  • Keep files small and named after the primary type they contain.

3) Prefer dedicated subview types over many computed some View fragments

  • Extract meaningful desktop sections like sidebar rows, detail panels, inspectors, or toolbar content into focused subviews.
  • Keep computed some View helpers small and rare.
  • Pass explicit data, bindings, and actions into subviews instead of handing down the whole scene model.

Read the full file on GitHub · 110 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. 2mo ago First seen · 110 lines · 33 tokens per session scan A 924b1a3a6f89

Subscribe to this mod's changes

view-refactor is a skill published in the GitHub repository fanfan-de/anybox (55 stars, last pushed 1mo ago), licensed MIT. It adds 33 tokens to every session and 1,198 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 94% identical to macos-view-refactor, differing in 6 lines, and is treated as a copy.

Related

view-refactor compared with skills from other repositories

view-refactor next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
view-refactorfanfan-de/anyboxSkill551mo agoMITA33Codex
imagegenopenai/codexSkill133kyesterdayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill99kyesterdayApache-2.0A19Claude Code
local-ai-agentsmicrosoft/ai-agents-for-beginnersSkill79k4d agoMITA200Claude Code, Codex
systematic-debuggingobra/superpowersSkill313k3d agoMITA21Claude Code
next-cache-components-adoptionvercel/next.jsSkill143ktodayMITA95Claude Code
next-partial-prefetching-adoptionvercel/next.jsSkill143ktodayMITA103Claude Code