कंटेंट पर जाएँ
TakoAPI
स्किल्स पर वापस

swiftui-view-refactor

steipete द्वारा

iOS & macOS Development
2.3kclawskills.sh द्वारा बताए गए डाउनलोड
6स्टार
0व्यूज़
0 लाइकइस स्किल को लाइक करने के लिए साइन इन करें
—अभी तक कोई रेटिंग नहीं
आपकी रेटिंग

संक्षिप्त

Refactor and review SwiftUI view files.

विवरण

यह स्किल क्या करती है

Applies consistent structure and dependency patterns to SwiftUI view files. Enforces a standard member ordering, promotes Model-View patterns over view models, and standardizes how @Observable state is initialized and passed through views.

Enforces structural conventions that SwiftUI's own documentation leaves implicit, making large codebases easier to navigate and review consistently.

इसे कब इस्तेमाल करें

  • Reordering a SwiftUI view's properties and methods into a consistent declaration order
  • Replacing an optional view model with a non-optional @State initialized in the view's init
  • Breaking a large body into smaller subviews or computed view properties
  • Standardizing how dependencies are injected through view initializers
  • Auditing @Observable usage to remove redundant wrappers or optional state

उदाहरण वर्कफ़्लो

इनपुट

User asks: Clean up this SwiftUI view — it has an optional view model, a huge body, and properties declared in random order

एजेंट
  1. 1

    Reorder view members: environment values first, then let properties, @State, computed vars, init, body, and helpers last

  2. 2

    Locate the optional view model and replace it with a non-optional @State property initialized in the view's init using passed dependencies

  3. 3

    Split the large body into extracted computed view properties or dedicated View structs where sections have distinct logic

  4. 4

    Verify @Observable types are stored as @State at root and passed down explicitly without redundant wrappers

  5. 5

    Confirm no layout or business logic changed from the original

आउटपुट

Refactored SwiftUI view with standard member ordering, non-optional @State view model, and a decomposed body that delegates to named subviews

इंस्टॉलेशन

clawhub install steipete/swiftui-view-refactor

CLI कमांड चलाएँ, या प्रॉम्प्ट को Claude Code, Cursor, Codex या जो भी कोडिंग एजेंट आप इस्तेमाल करते हैं उसमें पेस्ट करें।

लिंक