Skip to content
Development
Skill

/swiftui-component-audit-workflow

Audit and repair SwiftUI code toward self-contained declarative components, local reactive state, framework-native data flow, and simple reusable view interfaces. Use when an existing SwiftUI feature has external ViewModels, injected collaborators, imperative coordination,

From plugin
socket
9200 skills5 MCP

Claude Code

$ npx -y skills add gaelic-ghost/socket --skill swiftui-component-audit-workflow --agent claude-code

SKILL.md

swiftui-component-audit-workflow.SKILL.md
name: swiftui-component-audit-workflow
description: Audit and repair SwiftUI code toward self-contained declarative components, local reactive state, framework-native data flow, and simple reusable view interfaces. Use when an existing SwiftUI feature has external ViewModels, injected collaborators, imperative coordination, duplicated state, environment dumping, or unclear component ownership.

SwiftUI Component Audit Workflow

Purpose

Audit or repair a SwiftUI feature without importing AppKit, UIKit, or generic imperative architecture into a declarative view tree. SwiftUI components stand on their own: they render from explicit values and framework state, own local presentation state, and express user intent through narrow actions. A feature service, when needed, is a direct concrete owner of one capability rather than a wrapper stack.

SwiftData And SwiftUI Rule

Keep SwiftData directly integrated with SwiftUI through `modelContainer`, environment `modelContext`, `@Query`, model objects, and narrow bindings. Do not insert repositories, stores, service mirrors, DTO mirrors, ViewModel caches, or other abstraction layers between SwiftData and SwiftUI. Hand persistence-specific decisions to `swiftdata-workflow`.

When To Use

  • Use for a SwiftUI architecture review, component audit, repair, or refactor.
  • Use when reusable views receive ViewModels, stores, services, managers, coordinators, or other collaborating objects.
  • Use when state is duplicated, a router or coordinator shadows SwiftUI navigation, or an environment becomes a dependency dump.
  • Use when a team needs concrete good/bad SwiftUI examples before implementing a feature.
  • Hand SwiftData persistence decisions to `swiftdata-workflow`, app and scene ownership to `swiftui-app-architecture-workflow`, and execution to the Xcode build or testing workflows.

Single-Path Workflow

1. Read the relevant Apple documentation through `explore-apple-swift-docs` before proposing a repair. 2. Inventory each view's stored properties, local state, environment reads, preferences, focus, commands, and outward actions. 3. Classify every dependency:

  • component input: value, narrow binding, or action closure
  • component-local state: `@State`, derived value, or locally owned `@Observable` state
  • hierarchy context: existing or custom environment value/action
  • upward layout or presentation fact: preference key
  • active command context: focus or focused value
  • direct persistence state: `ModelContainer`, `modelContext`, `@Query`, model object, or narrow binding
  • non-SwiftUI boundary: networking, import/export, migration, testing, or server sync
  • direct concrete feature service: one capability or cohesive related group with a named app or scene lifecycle owner

4. Report a finding for every reusable view that accepts an external ViewModel, store, coordinator, manager, service, or observable collaborator. 5. Report a finding for every umbrella app service, forwarding service facade, repository/protocol/adapter chain, or service that has no direct capability boundary. 6. Repair from the narrowest honest mechanism outward:

  • replace collaborators with values, bindings, and actions
  • move local presentation state into the owning view
  • use an existing environment action before adding a custom action
  • add a custom environment value or action only for a dynamic or broadly reused hierarchy capability
  • use preferences only for descendant-to-ancestor publication
  • restore direct SwiftData integration when persistence is being mirrored
  • collapse forwarding layers into the concrete feature service that owns the real capability
  • install that service in environment only when independent descendants need direct invocation or observation

7. Remove explicit initializers that only duplicate the synthesized memberwise initializer. 8. Re-audit the changed component boundaries and hand off for build, preview, or tests.

Inputs

  • `repository`: target repository or feature path.
  • `mode`: `audit` for findings only, or `repair` for implementation.
  • `scope`: optional files, feature, scene, or component name.
  • `platform_context`: optional iOS, iPadOS, macOS, or mixed context.

Outputs

  • component inventory and declared ownership boundary
  • findings ordered by severity with the violated component rule
  • a before/after state-flow description
  • exact repair plan or completed edits
  • documented SwiftUI behavior relied on
  • validation and handoff path

Guards and Stop Conditions

  • Do not recommend external ViewModels as a SwiftUI component shape.
  • Do not treat values, bindings, and action closures as dependency injection; they are a declarative component interface.
  • Do not pass collaborating objects between reusable views.
  • Do not replace a documented SwiftUI environment action with an application router or coordinator.
  • Do not add a custom environment action when a local action is sufficient; do add one when a dynamic or broadly shared hierarchy capability honestly needs it.
  • Do not retain an AppService, repository, protocol, adapter, or wrapper layer that only forwards to another service. Keep the direct concrete feature service, and use a protocol only for a demonstrated alternate implementation or isolated test boundary.
  • Do not use preference keys as a general state bus.
  • Do not insert repositories, stores, DTO mirrors, service mirrors, or view-model caches between SwiftData and SwiftUI.
  • Prefer memberwise initializers; an explicit initializer needs real behavior beyond stored-property assignment.
  • Stop and surface a broader app, scene, persistence, or navigation ownership decision rather than hiding it in a local refactor.

Fallbacks and Handoffs

  • Recommend `swiftui-app-architecture-workflow` for app, scene, command, focus, environment, or navigation ownership decisions.
  • Recommend `swiftdata-workflow` for persistence integration or migration decisions.
  • Recommend `exp
Read more
@gaelic-ghost
Ships withsocket

Stuff for Agents on macOS Promo audio: Socket Codex Marketplace Promo

9200 skills5 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
9
Star history of gaelic-ghost/socket on GitHub, a chart by star-history.com

Other skills on socket.

orchestrate-agent-work

orchestrate-agent-work

Coordinate bounded worker tasks with a launch envelope, report-back, escalation, and synthesis contract. Use before spawning,…

@gaelic-ghost@gaelic-ghostInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about swiftui-component-audit-workflow.

Which coding agents can use swiftui-component-audit-workflow?
swiftui-component-audit-workflow installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.