Community程式設計與開發github.com

dimillian/swiftui-view-refactor

重構和審查 SwiftUI 視圖檔案,採用強烈預設值,如小型專用子視圖、MV 優先於 MVVM 的資料流、穩定的視圖樹、明確的依賴注入及正確的 Observation 用法。適用於清理 SwiftUI 視圖、拆分冗長主體、移除內聯動作或副作用、減少計算型 `some View` 輔助方法,或標準化 `@Observable` 和視圖模型初始化模式時。

swiftui-view-refactor 是什麼?

此技能專注於重構和審查 SwiftUI 視圖檔案,遵循一套明確的架構預設值,以提升程式碼品質和可維護性。它強調使用小型、專用的子視圖來取代大型主體,並採用 MV(Model-View)風格而非 MVVM(Model-View-ViewModel)的資料流,以保持視圖樹的穩定。此外,該技能鼓勵明確的依賴注入,並正確使用 `@Observable` 巨集與觀察模式,避免常見的副作用和內聯動作。此技能支援任何基於 SwiftUI 的專案,無論是在 Xcode 或其他支援 Swift 的編輯環境中,都能有效協助開發者清理雜亂的視圖、拆分過長的 `body`、減少計算型 `some View` 屬性,並將初始化模式標準化。其運作方式是透過分析現有程式碼,識別違反上述預設值的模式,並提供具體的重構建議或自動進行重構,從而幫助團隊維護一致且高品質的 SwiftUI 程式碼庫。

相容平台~Claude Code~Codex CLI~Cursor
Part ofMobile
npx skills add https://github.com/dimillian/skills/tree/main/skills/swiftui-view-refactor

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

swiftui-view-refactor 是做什麼的?

重構和審查 SwiftUI 視圖檔案,採用強烈預設值,如小型專用子視圖、MV 優先於 MVVM 的資料流、穩定的視圖樹、明確的依賴注入及正確的 Observation 用法。適用於清理 SwiftUI 視圖、拆分冗長主體、移除內聯動作或副作用、減少計算型 some View 輔助方法,或標準化 @Observable 和視圖模型初始化模式時。

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

dimillian/app-store-changelog

Create user-facing App Store release notes by collecting and summarizing all user-impacting changes since the last git tag (or a specified ref). Use when asked to generate a comprehensive release changelog, App Store "What's New" text, or release notes based on git history or tags.

dimillian/ios-debugger-agent

Use XcodeBuildMCP to build, run, launch, and debug the current iOS project on a booted simulator. Trigger when asked to run an iOS app, interact with the simulator UI, inspect on-screen state, capture logs/console output, or diagnose runtime behavior using XcodeBuildMCP tools.

dimillian/macos-spm-app-packaging

Scaffold, build, and package SwiftPM-based macOS apps without an Xcode project. Use when you need a from-scratch macOS app layout, SwiftPM targets/resources, a custom .app bundle assembly script, or signing/notarization/appcast steps outside Xcode.

dimillian/swift-concurrency-expert

Swift Concurrency review and remediation for Swift 6.2+. Use when asked to review Swift Concurrency usage, improve concurrency compliance, or fix Swift concurrency compiler errors in a feature or file. Concrete actions include adding Sendable conformance, applying @MainActor annotations, resolving actor isolation warnings, fixing data race diagnostics, and migrating completion handlers to async/await.

dimillian/swiftui-liquid-glass

Implement, review, or improve SwiftUI features using the iOS 26+ Liquid Glass API. Use when asked to adopt Liquid Glass in new SwiftUI UI, refactor an existing feature to Liquid Glass, or review Liquid Glass usage for correctness, performance, and design alignment.

dimillian/swiftui-performance-audit

Audit and improve SwiftUI runtime performance from code review and architecture. Use for requests to diagnose slow rendering, janky scrolling, high CPU/memory usage, excessive view updates, or layout thrash in SwiftUI apps, and to provide guidance for user-run Instruments profiling when code review alone is insufficient.

dimillian/swiftui-ui-patterns

Best practices and example-driven guidance for building SwiftUI views and components, including navigation hierarchies, custom view modifiers, and responsive layouts with stacks and grids. Use when creating or refactoring SwiftUI UI, designing tab architecture with TabView, composing screens with VStack/HStack, managing @State or @Binding, building declarative iOS interfaces, or needing component-specific patterns and examples.

相關技能