Bỏ qua tới nội dung
TakoAPI
Quay lại kỹ năng

fosmvvm-swiftui-view-generator

bởi foscomputerservices

Coding Agents & IDEs
449Lượt tải do clawskills.sh công bố
0Lượt xem
0 lượt thíchĐăng nhập để thích kỹ năng này
—Chưa có đánh giá
Đánh giá của bạn

Tóm tắt

Generate SwiftUI views that render FOSMVVM ViewModels.

Mô tả

Kỹ năng này làm gì

Generates SwiftUI views that conform to the FOSMVVM ViewModelView protocol. Handles display-only, interactive, form, and container view types with correct property wiring, operation binding, and debug infrastructure. Views are scaffolded to match their corresponding ViewModel by name and structure.

Enforces FOSMVVM's strict separation between rendering and data by generating views that never compute or transform data, only render what the ViewModel provides.

Khi nào nên dùng

  • Scaffolding a new SwiftUI view for an existing FOSMVVM ViewModel
  • Adding form views with field validation and error handling
  • Building container views that compose child views via .bind()
  • Setting up interactive views with operations and repaint toggle
  • Creating SwiftUI previews with stub ViewModels for design iteration

Quy trình ví dụ

ĐẦU VÀO

User asks: Generate an interactive SwiftUI view for TaskViewModel with a submit action and cancel action

AGENT
  1. 1

    Identifies view type as interactive based on operations in TaskViewModel

  2. 2

    Scaffolds TaskView.swift conforming to ViewModelView with viewModel and operations properties

  3. 3

    Adds @State private var repaintToggle and #if DEBUG testDataTransporter modifier

  4. 4

    Generates performAction() and cancel() methods each calling toggleRepaint() after the operation

  5. 5

    Adds .previewHost() previews inside #if DEBUG block

ĐẦU RA

TaskView.swift placed in Sources/{ViewsTarget}/Tasks/ with full ViewModelView conformance, operation wiring, debug infrastructure, and previews

Cài đặt

clawhub install foscomputerservices/fosmvvm-swiftui-view-generator

Chạy lệnh CLI, hoặc dán prompt vào Claude Code, Cursor, Codex hay coding agent bạn đang dùng.

Liên kết