{
  "schemaVersion": "1.0",
  "item": {
    "slug": "fosmvvm-swiftui-view-generator",
    "name": "FOSMVVM SwiftUI View Generator",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/foscomputerservices/fosmvvm-swiftui-view-generator",
    "canonicalUrl": "https://clawhub.ai/foscomputerservices/fosmvvm-swiftui-view-generator",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/fosmvvm-swiftui-view-generator",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=fosmvvm-swiftui-view-generator",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "reference.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/fosmvvm-swiftui-view-generator"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/fosmvvm-swiftui-view-generator",
    "agentPageUrl": "https://openagent3.xyz/skills/fosmvvm-swiftui-view-generator/agent",
    "manifestUrl": "https://openagent3.xyz/skills/fosmvvm-swiftui-view-generator/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/fosmvvm-swiftui-view-generator/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "FOSMVVM SwiftUI View Generator",
        "body": "Generate SwiftUI views that render FOSMVVM ViewModels."
      },
      {
        "title": "Conceptual Foundation",
        "body": "For full architecture context, see FOSMVVMArchitecture.md | OpenClaw reference\n\nIn FOSMVVM, Views are thin rendering layers that display ViewModels:\n\n┌─────────────────────────────────────────────────────────────┐\n│                    ViewModelView Pattern                     │\n├─────────────────────────────────────────────────────────────┤\n│                                                              │\n│  ViewModel (Data)          ViewModelView (SwiftUI)          │\n│  ┌──────────────────┐     ┌──────────────────┐             │\n│  │ title: String    │────►│ Text(vm.title)   │             │\n│  │ items: [Item]    │────►│ ForEach(vm.items)│             │\n│  │ isEnabled: Bool  │────►│ .disabled(!...)  │             │\n│  └──────────────────┘     └──────────────────┘             │\n│                                                              │\n│  Operations (Actions)                                        │\n│  ┌──────────────────┐     ┌──────────────────┐             │\n│  │ submit()         │◄────│ Button(action:)  │             │\n│  │ cancel()         │◄────│ .onAppear { }    │             │\n│  └──────────────────┘     └──────────────────┘             │\n│                                                              │\n└─────────────────────────────────────────────────────────────┘\n\nKey principle: Views don't transform or compute data. They render what the ViewModel provides."
      },
      {
        "title": "View-ViewModel Alignment",
        "body": "The View filename should match the ViewModel it renders.\n\nSources/\n  {ViewModelsTarget}/\n    {Feature}/\n      {Feature}ViewModel.swift        ←──┐\n      {Entity}CardViewModel.swift     ←──┼── Same names\n                                          │\n  {ViewsTarget}/                          │\n    {Feature}/                            │\n      {Feature}View.swift             ────┤  (renders {Feature}ViewModel)\n      {Entity}CardView.swift          ────┘  (renders {Entity}CardViewModel)\n\nThis alignment provides:\n\nDiscoverability - Find the view for any ViewModel instantly\nConsistency - Same naming discipline across the codebase\nMaintainability - Changes to ViewModel are reflected in view location"
      },
      {
        "title": "1. ViewModelView Protocol",
        "body": "Every view conforms to ViewModelView:\n\npublic struct MyView: ViewModelView {\n    private let viewModel: MyViewModel\n\n    public var body: some View {\n        Text(viewModel.title)\n    }\n\n    public init(viewModel: MyViewModel) {\n        self.viewModel = viewModel\n    }\n}\n\nRequired:\n\nprivate let viewModel: {ViewModel}\npublic init(viewModel:)\nConforms to ViewModelView protocol"
      },
      {
        "title": "2. Operations (Optional)",
        "body": "Interactive views have operations:\n\npublic struct MyView: ViewModelView {\n    private let viewModel: MyViewModel\n    private let operations: MyViewModelOperations\n\n    #if DEBUG\n    @State private var repaintToggle = false\n    #endif\n\n    public var body: some View {\n        Button(action: performAction) {\n            Text(viewModel.buttonLabel)\n        }\n        #if DEBUG\n        .testDataTransporter(viewModelOps: operations, repaintToggle: $repaintToggle)\n        #endif\n    }\n\n    public init(viewModel: MyViewModel) {\n        self.viewModel = viewModel\n        self.operations = viewModel.operations\n    }\n\n    private func performAction() {\n        operations.performAction()\n        toggleRepaint()\n    }\n\n    private func toggleRepaint() {\n        #if DEBUG\n        repaintToggle.toggle()\n        #endif\n    }\n}\n\nWhen views have operations:\n\nStore operations from viewModel.operations in init\nAdd @State private var repaintToggle = false (DEBUG only)\nAdd .testDataTransporter(viewModelOps:repaintToggle:) modifier (DEBUG only)\nCall toggleRepaint() after every operation invocation"
      },
      {
        "title": "3. Child View Binding",
        "body": "Parent views bind child views using .bind(appState:):\n\npublic struct ParentView: ViewModelView {\n    @Environment(AppState.self) private var appState\n    private let viewModel: ParentViewModel\n\n    public var body: some View {\n        VStack {\n            Text(viewModel.title)\n\n            // Bind child view with subset of parent's data\n            ChildView.bind(\n                appState: .init(\n                    itemId: viewModel.selectedId,\n                    isConnected: viewModel.isConnected\n                )\n            )\n        }\n    }\n}\n\nThe .bind() pattern:\n\nChild views use .bind(appState:) to receive data from parent\nParent creates child's AppState from its own ViewModel data\nEnables composition without tight coupling"
      },
      {
        "title": "4. Form Views with Validation",
        "body": "Forms use FormFieldView and Validations environment:\n\npublic struct MyFormView: ViewModelView {\n    @Environment(Validations.self) private var validations\n    @Environment(\\.focusState) private var focusField\n    @State private var error: Error?\n\n    private let viewModel: MyFormViewModel\n    private let operations: MyFormViewModelOperations\n\n    public var body: some View {\n        Form {\n            FormFieldView(\n                fieldModel: viewModel.$email,\n                focusField: focusField,\n                fieldValidator: viewModel.validateEmail,\n                validations: validations\n            )\n\n            Button(errorBinding: $error, asyncAction: submit) {\n                Text(viewModel.submitButtonLabel)\n            }\n            .disabled(validations.hasError)\n        }\n        .onAsyncSubmit {\n            await submit()\n        }\n        .alert(\n            errorBinding: $error,\n            title: viewModel.errorTitle,\n            message: viewModel.errorMessage,\n            dismissButtonLabel: viewModel.dismissButtonLabel\n        )\n    }\n}\n\nForm patterns:\n\n@Environment(Validations.self) for validation state\nFormFieldView for each input field\nButton(errorBinding:asyncAction:) for async actions\n.disabled(validations.hasError) on submit button\nSeparate handling for validation errors vs general errors"
      },
      {
        "title": "5. Previews",
        "body": "Use .previewHost() for SwiftUI previews:\n\n#if DEBUG\n#Preview {\n    MyView.previewHost(\n        bundle: MyAppResourceAccess.localizationBundle\n    )\n    .environment(AppState())\n}\n\n#Preview(\"With Data\") {\n    MyView.previewHost(\n        bundle: MyAppResourceAccess.localizationBundle,\n        viewModel: .stub(title: \"Preview Title\")\n    )\n    .environment(AppState())\n}\n#endif"
      },
      {
        "title": "Display-Only Views",
        "body": "Views that just render data (no user interactions):\n\npublic struct InfoView: ViewModelView {\n    private let viewModel: InfoViewModel\n\n    public var body: some View {\n        VStack {\n            Text(viewModel.title)\n            Text(viewModel.description)\n\n            if viewModel.isActive {\n                Text(viewModel.activeStatusLabel)\n            }\n        }\n    }\n\n    public init(viewModel: InfoViewModel) {\n        self.viewModel = viewModel\n    }\n}\n\nCharacteristics:\n\nNo operations property\nNo repaintToggle or testDataTransporter\nJust renders ViewModel properties\nMay have conditional rendering based on ViewModel state"
      },
      {
        "title": "Interactive Views",
        "body": "Views with user actions:\n\npublic struct ActionView: ViewModelView {\n    @State private var error: Error?\n\n    private let viewModel: ActionViewModel\n    private let operations: ActionViewModelOperations\n\n    #if DEBUG\n    @State private var repaintToggle = false\n    #endif\n\n    public var body: some View {\n        VStack {\n            Button(action: performAction) {\n                Text(viewModel.actionLabel)\n            }\n\n            Button(role: .cancel, action: cancel) {\n                Text(viewModel.cancelLabel)\n            }\n        }\n        .alert(\n            errorBinding: $error,\n            title: viewModel.errorTitle,\n            message: viewModel.errorMessage,\n            dismissButtonLabel: viewModel.dismissButtonLabel\n        )\n        #if DEBUG\n        .testDataTransporter(viewModelOps: operations, repaintToggle: $repaintToggle)\n        #endif\n    }\n\n    public init(viewModel: ActionViewModel) {\n        self.viewModel = viewModel\n        self.operations = viewModel.operations\n    }\n\n    private func performAction() {\n        operations.performAction()\n        toggleRepaint()\n    }\n\n    private func cancel() {\n        operations.cancel()\n        toggleRepaint()\n    }\n\n    private func toggleRepaint() {\n        #if DEBUG\n        repaintToggle.toggle()\n        #endif\n    }\n}"
      },
      {
        "title": "Form Views",
        "body": "Views with validated input fields:\n\nUse FormFieldView for each input\n@Environment(Validations.self) for validation state\nButton disabled when validations.hasError\nSeparate error handling for validation vs operation errors"
      },
      {
        "title": "Container Views",
        "body": "Views that compose child views:\n\npublic struct ContainerView: ViewModelView {\n    @Environment(AppState.self) private var appState\n    private let viewModel: ContainerViewModel\n    private let operations: ContainerViewModelOperations\n\n    public var body: some View {\n        VStack {\n            switch viewModel.state {\n            case .loading:\n                ProgressView()\n\n            case .ready:\n                ChildAView.bind(\n                    appState: .init(id: viewModel.selectedId)\n                )\n\n                ChildBView.bind(\n                    appState: .init(\n                        isActive: viewModel.isActive,\n                        level: viewModel.level\n                    )\n                )\n            }\n        }\n    }\n}"
      },
      {
        "title": "When to Use This Skill",
        "body": "Creating a new SwiftUI view for a FOSMVVM app\nBuilding UI to render a ViewModel\nFollowing an implementation plan that requires new views\nCreating forms with validation\nBuilding container views that compose child views"
      },
      {
        "title": "What This Skill Generates",
        "body": "FileLocationPurpose{ViewName}View.swiftSources/{ViewsTarget}/{Feature}/The SwiftUI view\n\nNote: The corresponding ViewModel and ViewModelOperations should already exist (use fosmvvm-viewmodel-generator skill)."
      },
      {
        "title": "Project Structure Configuration",
        "body": "PlaceholderDescriptionExample{ViewName}View name (without \"View\" suffix)TaskList, SignIn{ViewsTarget}SwiftUI views SPM targetMyAppViews{Feature}Feature/module groupingTasks, Auth"
      },
      {
        "title": "Pattern Implementation",
        "body": "This skill references conversation context to determine view structure:"
      },
      {
        "title": "View Type Detection",
        "body": "From conversation context, the skill identifies:\n\nViewModel structure (from prior discussion or specifications read by Claude)\nView category: Display-only, interactive, form, or container\nOperations needed: Whether view has user-initiated actions\nChild composition: Whether view binds child views"
      },
      {
        "title": "Component Selection",
        "body": "Based on view type:\n\nDisplay-only: ViewModelView protocol, viewModel property only\nInteractive: Add operations, repaintToggle, testDataTransporter, toggleRepaint()\nForm: Add Validations environment, FormFieldView, validation error handling\nContainer: Add child view .bind() calls"
      },
      {
        "title": "Code Generation",
        "body": "Generates view file with:\n\nViewModelView protocol conformance\nProperties (viewModel, operations if needed, repaintToggle if interactive)\nBody with rendering logic\nInit storing viewModel and operations\nAction methods (if interactive)\nTest infrastructure (if interactive)\nPreviews for different states"
      },
      {
        "title": "Context Sources",
        "body": "Skill references information from:\n\nPrior conversation: Requirements discussed with user\nSpecification files: If Claude has read specifications into context\nViewModel definitions: From codebase or discussion"
      },
      {
        "title": "Error Handling Pattern",
        "body": "@State private var error: Error?\n\nvar body: some View {\n    VStack {\n        Button(errorBinding: $error, asyncAction: submit) {\n            Text(viewModel.submitLabel)\n        }\n    }\n    .alert(\n        errorBinding: $error,\n        title: viewModel.errorTitle,\n        message: viewModel.errorMessage,\n        dismissButtonLabel: viewModel.dismissButtonLabel\n    )\n}\n\nprivate func submit() async {\n    do {\n        try await operations.submit()\n    } catch {\n        self.error = error\n    }\n    toggleRepaint()\n}"
      },
      {
        "title": "Validation Error Pattern",
        "body": "For forms, handle validation errors separately:\n\nprivate func submit() async {\n    let validations = validations\n    do {\n        try await operations.submit(data: viewModel.data)\n    } catch let error as MyRequest.ResponseError {\n        if !error.validationResults.isEmpty {\n            validations.replace(with: error.validationResults)\n        } else {\n            self.error = error\n        }\n    } catch {\n        self.error = error\n    }\n    toggleRepaint()\n}"
      },
      {
        "title": "Async Task Pattern",
        "body": "var body: some View {\n    VStack {\n        if isLoading {\n            ProgressView()\n        } else {\n            contentView\n        }\n    }\n    .task(errorBinding: $error) {\n        try await loadData()\n    }\n}\n\nprivate func loadData() async throws {\n    isLoading = true\n    try await operations.loadData()\n    isLoading = false\n    toggleRepaint()\n}"
      },
      {
        "title": "Conditional Rendering Pattern",
        "body": "Use ViewModel state for conditionals:\n\nvar body: some View {\n    VStack {\n        if viewModel.isEmpty {\n            Text(viewModel.emptyStateMessage)\n        } else {\n            ForEach(viewModel.items) { item in\n                ItemRow(item: item)\n            }\n        }\n    }\n}"
      },
      {
        "title": "Computed View Components Pattern",
        "body": "Extract reusable view fragments as computed properties:\n\nprivate var headerView: some View {\n    HStack {\n        Text(viewModel.title)\n        Spacer()\n        Image(systemName: viewModel.iconName)\n    }\n}\n\nvar body: some View {\n    VStack {\n        headerView\n        contentView\n    }\n}"
      },
      {
        "title": "Result/Error Handling Pattern",
        "body": "When a view needs to render multiple possible ViewModels (success, various error types), use an enum wrapper:\n\nThe Wrapper ViewModel:\n\n@ViewModel\npublic struct TaskResultViewModel {\n    public enum Result {\n        case success(TaskViewModel)\n        case notFound(NotFoundViewModel)\n        case validationError(ValidationErrorViewModel)\n        case permissionDenied(PermissionDeniedViewModel)\n    }\n\n    public let result: Result\n    public var vmId: ViewModelId = .init(type: Self.self)\n\n    public init(result: Result) {\n        self.result = result\n    }\n}\n\nThe View:\n\npublic struct TaskResultView: ViewModelView {\n    private let viewModel: TaskResultViewModel\n\n    public var body: some View {\n        switch viewModel.result {\n        case .success(let vm):\n            TaskView(viewModel: vm)\n        case .notFound(let vm):\n            NotFoundView(viewModel: vm)\n        case .validationError(let vm):\n            ValidationErrorView(viewModel: vm)\n        case .permissionDenied(let vm):\n            PermissionDeniedView(viewModel: vm)\n        }\n    }\n\n    public init(viewModel: TaskResultViewModel) {\n        self.viewModel = viewModel\n    }\n}\n\nKey principles:\n\nEach error scenario has its own ViewModel type\nThe wrapper enum associates specific ViewModels with each case\nThe view switches on the enum and renders the appropriate child view\nMaintains type safety (no any ViewModel existentials)\nNo generic error handling - each error type is specific and meaningful"
      },
      {
        "title": "ViewModelId Initialization - CRITICAL",
        "body": "IMPORTANT: ViewModelId controls SwiftUI's view identity system via the .id(vmId) modifier. Incorrect initialization causes SwiftUI to treat different data as the same view, breaking updates.\n\n❌ WRONG - Never use this:\n\npublic var vmId: ViewModelId = .init()  // NO! Generic identity\n\n✅ MINIMUM - Use type-based identity:\n\npublic var vmId: ViewModelId = .init(type: Self.self)\n\nThis ensures views of the same type get unique identities.\n\n✅ IDEAL - Use data-based identity when available:\n\npublic struct TaskViewModel {\n    public let id: ModelIdType\n    public var vmId: ViewModelId\n\n    public init(id: ModelIdType, /* other params */) {\n        self.id = id\n        self.vmId = .init(id: id)  // Ties view identity to data identity\n        // ...\n    }\n}\n\nWhy this matters:\n\nSwiftUI uses .id() modifier to determine when to recreate vs update views\nvmId provides this identity for ViewModelViews\nWrong identity = views don't update when data changes\nData-based identity (.init(id:)) is best because it ties view lifecycle to data lifecycle"
      },
      {
        "title": "File Organization",
        "body": "Sources/{ViewsTarget}/\n├── {Feature}/\n│   ├── {Feature}View.swift             # Full page → {Feature}ViewModel\n│   ├── {Entity}CardView.swift          # Child component → {Entity}CardViewModel\n│   ├── {Entity}RowView.swift           # Child component → {Entity}RowViewModel\n│   └── {Modal}View.swift               # Modal → {Modal}ViewModel\n├── Shared/\n│   ├── HeaderView.swift                # Shared components\n│   └── FooterView.swift\n└── Styles/\n    └── ButtonStyles.swift              # Reusable button styles"
      },
      {
        "title": "Computing Data in Views",
        "body": "// ❌ BAD - View is transforming data\nvar body: some View {\n    Text(\"\\(viewModel.firstName) \\(viewModel.lastName)\")\n}\n\n// ✅ GOOD - ViewModel provides shaped result\nvar body: some View {\n    Text(viewModel.fullName)  // via @LocalizedCompoundString\n}"
      },
      {
        "title": "Forgetting to Call toggleRepaint()",
        "body": "// ❌ BAD - Test infrastructure won't work\nprivate func submit() {\n    operations.submit()\n    // Missing toggleRepaint()!\n}\n\n// ✅ GOOD - Always call after operations\nprivate func submit() {\n    operations.submit()\n    toggleRepaint()\n}"
      },
      {
        "title": "Using Computed Properties for Display",
        "body": "// ❌ BAD - View is computing\nvar body: some View {\n    if !viewModel.items.isEmpty {\n        Text(\"You have \\(viewModel.items.count) items\")\n    }\n}\n\n// ✅ GOOD - ViewModel provides the state\nvar body: some View {\n    if viewModel.hasItems {\n        Text(viewModel.itemCountMessage)\n    }\n}"
      },
      {
        "title": "Hardcoding Text",
        "body": "// ❌ BAD - Not localizable\nButton(action: submit) {\n    Text(\"Submit\")\n}\n\n// ✅ GOOD - ViewModel provides localized text\nButton(action: submit) {\n    Text(viewModel.submitButtonLabel)\n}"
      },
      {
        "title": "Missing Error Binding",
        "body": "// ❌ BAD - Errors not handled\nButton(action: submit) {\n    Text(viewModel.submitLabel)\n}\n\n// ✅ GOOD - Error binding for async actions\nButton(errorBinding: $error, asyncAction: submit) {\n    Text(viewModel.submitLabel)\n}"
      },
      {
        "title": "Storing Operations in Body Instead of Init",
        "body": "// ❌ BAD - Recomputed on every render\npublic var body: some View {\n    let operations = viewModel.operations\n    Button(action: { operations.submit() }) {\n        Text(viewModel.submitLabel)\n    }\n}\n\n// ✅ GOOD - Store in init\nprivate let operations: MyOperations\n\npublic init(viewModel: MyViewModel) {\n    self.viewModel = viewModel\n    self.operations = viewModel.operations\n}"
      },
      {
        "title": "Mismatched Filenames",
        "body": "// ❌ BAD - Filename doesn't match ViewModel\nViewModel: TaskListViewModel\nView:      TasksView.swift\n\n// ✅ GOOD - Aligned names\nViewModel: TaskListViewModel\nView:      TaskListView.swift"
      },
      {
        "title": "Incorrect ViewModelId Initialization",
        "body": "// ❌ BAD - Generic identity, views won't update correctly\npublic var vmId: ViewModelId = .init()\n\n// ✅ MINIMUM - Type-based identity\npublic var vmId: ViewModelId = .init(type: Self.self)\n\n// ✅ IDEAL - Data-based identity (when id available)\npublic init(id: ModelIdType) {\n    self.id = id\n    self.vmId = .init(id: id)\n}"
      },
      {
        "title": "Force-Unwrapping Localizable Strings",
        "body": "// ❌ BAD - Force-unwrapping to work around missing overload\nimport SwiftUI\n\nText(try! viewModel.title.localizedString)  // Anti-pattern - don't do this!\nLabel(try! viewModel.label.localizedString, systemImage: \"star\")\n\n// ✅ GOOD - Request the proper SwiftUI overload instead\n// The correct solution is to add an init extension like this:\nextension Text {\n    public init(_ localizable: Localizable) {\n        self.init(localizable.localized)\n    }\n}\n\nextension Label where Title == Text, Icon == Image {\n    public init(_ title: Localizable, systemImage: String) {\n        self.init(title.localized, systemImage: systemImage)\n    }\n}\n\n// Then views use it cleanly without force-unwraps:\nText(viewModel.title)\nLabel(viewModel.label, systemImage: \"star\")\n\nWhy this matters:\n\nFOSMVVM provides the Localizable protocol for all localized strings and includes SwiftUI init overloads for common elements like Text. However, not every SwiftUI element has a Localizable overload yet.\n\nWhen you encounter a SwiftUI element that doesn't accept Localizable directly:\n\nDON'T work around it with try! localizable.localizedString - this bypasses the type system and spreads force-unwrap calls throughout the view code\nDO request that we add the proper init overload to FOSUtilities for that SwiftUI element\nThe pattern is simple: Extensions that accept Localizable and pass .localized to the standard initializer\n\nThis approach keeps the codebase clean, type-safe, and eliminates force-unwraps from view code entirely."
      },
      {
        "title": "File Templates",
        "body": "See reference.md for complete file templates."
      },
      {
        "title": "Naming Conventions",
        "body": "ConceptConventionExampleView struct{Name}ViewTaskListView, SignInViewViewModel propertyviewModelAlways viewModelOperations propertyoperationsAlways operationsError stateerrorAlways errorRepaint togglerepaintToggleAlways repaintToggle"
      },
      {
        "title": "FOSMVVM-Specific Modifiers",
        "body": "// Error alert with ViewModel strings\n.alert(\n    errorBinding: $error,\n    title: viewModel.errorTitle,\n    message: viewModel.errorMessage,\n    dismissButtonLabel: viewModel.dismissButtonLabel\n)\n\n// Async task with error handling\n.task(errorBinding: $error) {\n    try await loadData()\n}\n\n// Async submit handler\n.onAsyncSubmit {\n    await submit()\n}\n\n// Test data transporter (DEBUG only)\n.testDataTransporter(viewModelOps: operations, repaintToggle: $repaintToggle)\n\n// UI testing identifier\n.uiTestingIdentifier(\"submitButton\")"
      },
      {
        "title": "Standard SwiftUI Modifiers",
        "body": "Apply standard modifiers as needed for layout, styling, etc."
      },
      {
        "title": "How to Use This Skill",
        "body": "Invocation:\n\n/fosmvvm-swiftui-view-generator\n\nPrerequisites:\n\nViewModel and its structure are understood from conversation\nOptionally, specification files have been read into context\nView requirements (display-only, interactive, form, container) are clear from discussion\n\nOutput:\n\n{ViewName}View.swift - SwiftUI view conforming to ViewModelView protocol\n\nWorkflow integration:\nThis skill is typically used after discussing requirements or reading specification files. The skill references that context automatically—no file paths or Q&A needed."
      },
      {
        "title": "See Also",
        "body": "Architecture Patterns - Mental models and patterns\nFOSMVVMArchitecture.md - Full FOSMVVM architecture\nfosmvvm-viewmodel-generator - For creating ViewModels\nfosmvvm-ui-tests-generator - For creating UI tests\nreference.md - Complete file templates"
      },
      {
        "title": "Version History",
        "body": "VersionDateChanges1.02026-01-23Initial skill for SwiftUI view generation"
      }
    ],
    "body": "FOSMVVM SwiftUI View Generator\n\nGenerate SwiftUI views that render FOSMVVM ViewModels.\n\nConceptual Foundation\n\nFor full architecture context, see FOSMVVMArchitecture.md | OpenClaw reference\n\nIn FOSMVVM, Views are thin rendering layers that display ViewModels:\n\n┌─────────────────────────────────────────────────────────────┐\n│                    ViewModelView Pattern                     │\n├─────────────────────────────────────────────────────────────┤\n│                                                              │\n│  ViewModel (Data)          ViewModelView (SwiftUI)          │\n│  ┌──────────────────┐     ┌──────────────────┐             │\n│  │ title: String    │────►│ Text(vm.title)   │             │\n│  │ items: [Item]    │────►│ ForEach(vm.items)│             │\n│  │ isEnabled: Bool  │────►│ .disabled(!...)  │             │\n│  └──────────────────┘     └──────────────────┘             │\n│                                                              │\n│  Operations (Actions)                                        │\n│  ┌──────────────────┐     ┌──────────────────┐             │\n│  │ submit()         │◄────│ Button(action:)  │             │\n│  │ cancel()         │◄────│ .onAppear { }    │             │\n│  └──────────────────┘     └──────────────────┘             │\n│                                                              │\n└─────────────────────────────────────────────────────────────┘\n\n\nKey principle: Views don't transform or compute data. They render what the ViewModel provides.\n\nView-ViewModel Alignment\n\nThe View filename should match the ViewModel it renders.\n\nSources/\n  {ViewModelsTarget}/\n    {Feature}/\n      {Feature}ViewModel.swift        ←──┐\n      {Entity}CardViewModel.swift     ←──┼── Same names\n                                          │\n  {ViewsTarget}/                          │\n    {Feature}/                            │\n      {Feature}View.swift             ────┤  (renders {Feature}ViewModel)\n      {Entity}CardView.swift          ────┘  (renders {Entity}CardViewModel)\n\n\nThis alignment provides:\n\nDiscoverability - Find the view for any ViewModel instantly\nConsistency - Same naming discipline across the codebase\nMaintainability - Changes to ViewModel are reflected in view location\nCore Components\n1. ViewModelView Protocol\n\nEvery view conforms to ViewModelView:\n\npublic struct MyView: ViewModelView {\n    private let viewModel: MyViewModel\n\n    public var body: some View {\n        Text(viewModel.title)\n    }\n\n    public init(viewModel: MyViewModel) {\n        self.viewModel = viewModel\n    }\n}\n\n\nRequired:\n\nprivate let viewModel: {ViewModel}\npublic init(viewModel:)\nConforms to ViewModelView protocol\n2. Operations (Optional)\n\nInteractive views have operations:\n\npublic struct MyView: ViewModelView {\n    private let viewModel: MyViewModel\n    private let operations: MyViewModelOperations\n\n    #if DEBUG\n    @State private var repaintToggle = false\n    #endif\n\n    public var body: some View {\n        Button(action: performAction) {\n            Text(viewModel.buttonLabel)\n        }\n        #if DEBUG\n        .testDataTransporter(viewModelOps: operations, repaintToggle: $repaintToggle)\n        #endif\n    }\n\n    public init(viewModel: MyViewModel) {\n        self.viewModel = viewModel\n        self.operations = viewModel.operations\n    }\n\n    private func performAction() {\n        operations.performAction()\n        toggleRepaint()\n    }\n\n    private func toggleRepaint() {\n        #if DEBUG\n        repaintToggle.toggle()\n        #endif\n    }\n}\n\n\nWhen views have operations:\n\nStore operations from viewModel.operations in init\nAdd @State private var repaintToggle = false (DEBUG only)\nAdd .testDataTransporter(viewModelOps:repaintToggle:) modifier (DEBUG only)\nCall toggleRepaint() after every operation invocation\n3. Child View Binding\n\nParent views bind child views using .bind(appState:):\n\npublic struct ParentView: ViewModelView {\n    @Environment(AppState.self) private var appState\n    private let viewModel: ParentViewModel\n\n    public var body: some View {\n        VStack {\n            Text(viewModel.title)\n\n            // Bind child view with subset of parent's data\n            ChildView.bind(\n                appState: .init(\n                    itemId: viewModel.selectedId,\n                    isConnected: viewModel.isConnected\n                )\n            )\n        }\n    }\n}\n\n\nThe .bind() pattern:\n\nChild views use .bind(appState:) to receive data from parent\nParent creates child's AppState from its own ViewModel data\nEnables composition without tight coupling\n4. Form Views with Validation\n\nForms use FormFieldView and Validations environment:\n\npublic struct MyFormView: ViewModelView {\n    @Environment(Validations.self) private var validations\n    @Environment(\\.focusState) private var focusField\n    @State private var error: Error?\n\n    private let viewModel: MyFormViewModel\n    private let operations: MyFormViewModelOperations\n\n    public var body: some View {\n        Form {\n            FormFieldView(\n                fieldModel: viewModel.$email,\n                focusField: focusField,\n                fieldValidator: viewModel.validateEmail,\n                validations: validations\n            )\n\n            Button(errorBinding: $error, asyncAction: submit) {\n                Text(viewModel.submitButtonLabel)\n            }\n            .disabled(validations.hasError)\n        }\n        .onAsyncSubmit {\n            await submit()\n        }\n        .alert(\n            errorBinding: $error,\n            title: viewModel.errorTitle,\n            message: viewModel.errorMessage,\n            dismissButtonLabel: viewModel.dismissButtonLabel\n        )\n    }\n}\n\n\nForm patterns:\n\n@Environment(Validations.self) for validation state\nFormFieldView for each input field\nButton(errorBinding:asyncAction:) for async actions\n.disabled(validations.hasError) on submit button\nSeparate handling for validation errors vs general errors\n5. Previews\n\nUse .previewHost() for SwiftUI previews:\n\n#if DEBUG\n#Preview {\n    MyView.previewHost(\n        bundle: MyAppResourceAccess.localizationBundle\n    )\n    .environment(AppState())\n}\n\n#Preview(\"With Data\") {\n    MyView.previewHost(\n        bundle: MyAppResourceAccess.localizationBundle,\n        viewModel: .stub(title: \"Preview Title\")\n    )\n    .environment(AppState())\n}\n#endif\n\nView Categories\nDisplay-Only Views\n\nViews that just render data (no user interactions):\n\npublic struct InfoView: ViewModelView {\n    private let viewModel: InfoViewModel\n\n    public var body: some View {\n        VStack {\n            Text(viewModel.title)\n            Text(viewModel.description)\n\n            if viewModel.isActive {\n                Text(viewModel.activeStatusLabel)\n            }\n        }\n    }\n\n    public init(viewModel: InfoViewModel) {\n        self.viewModel = viewModel\n    }\n}\n\n\nCharacteristics:\n\nNo operations property\nNo repaintToggle or testDataTransporter\nJust renders ViewModel properties\nMay have conditional rendering based on ViewModel state\nInteractive Views\n\nViews with user actions:\n\npublic struct ActionView: ViewModelView {\n    @State private var error: Error?\n\n    private let viewModel: ActionViewModel\n    private let operations: ActionViewModelOperations\n\n    #if DEBUG\n    @State private var repaintToggle = false\n    #endif\n\n    public var body: some View {\n        VStack {\n            Button(action: performAction) {\n                Text(viewModel.actionLabel)\n            }\n\n            Button(role: .cancel, action: cancel) {\n                Text(viewModel.cancelLabel)\n            }\n        }\n        .alert(\n            errorBinding: $error,\n            title: viewModel.errorTitle,\n            message: viewModel.errorMessage,\n            dismissButtonLabel: viewModel.dismissButtonLabel\n        )\n        #if DEBUG\n        .testDataTransporter(viewModelOps: operations, repaintToggle: $repaintToggle)\n        #endif\n    }\n\n    public init(viewModel: ActionViewModel) {\n        self.viewModel = viewModel\n        self.operations = viewModel.operations\n    }\n\n    private func performAction() {\n        operations.performAction()\n        toggleRepaint()\n    }\n\n    private func cancel() {\n        operations.cancel()\n        toggleRepaint()\n    }\n\n    private func toggleRepaint() {\n        #if DEBUG\n        repaintToggle.toggle()\n        #endif\n    }\n}\n\nForm Views\n\nViews with validated input fields:\n\nUse FormFieldView for each input\n@Environment(Validations.self) for validation state\nButton disabled when validations.hasError\nSeparate error handling for validation vs operation errors\nContainer Views\n\nViews that compose child views:\n\npublic struct ContainerView: ViewModelView {\n    @Environment(AppState.self) private var appState\n    private let viewModel: ContainerViewModel\n    private let operations: ContainerViewModelOperations\n\n    public var body: some View {\n        VStack {\n            switch viewModel.state {\n            case .loading:\n                ProgressView()\n\n            case .ready:\n                ChildAView.bind(\n                    appState: .init(id: viewModel.selectedId)\n                )\n\n                ChildBView.bind(\n                    appState: .init(\n                        isActive: viewModel.isActive,\n                        level: viewModel.level\n                    )\n                )\n            }\n        }\n    }\n}\n\nWhen to Use This Skill\nCreating a new SwiftUI view for a FOSMVVM app\nBuilding UI to render a ViewModel\nFollowing an implementation plan that requires new views\nCreating forms with validation\nBuilding container views that compose child views\nWhat This Skill Generates\nFile\tLocation\tPurpose\n{ViewName}View.swift\tSources/{ViewsTarget}/{Feature}/\tThe SwiftUI view\n\nNote: The corresponding ViewModel and ViewModelOperations should already exist (use fosmvvm-viewmodel-generator skill).\n\nProject Structure Configuration\nPlaceholder\tDescription\tExample\n{ViewName}\tView name (without \"View\" suffix)\tTaskList, SignIn\n{ViewsTarget}\tSwiftUI views SPM target\tMyAppViews\n{Feature}\tFeature/module grouping\tTasks, Auth\nPattern Implementation\n\nThis skill references conversation context to determine view structure:\n\nView Type Detection\n\nFrom conversation context, the skill identifies:\n\nViewModel structure (from prior discussion or specifications read by Claude)\nView category: Display-only, interactive, form, or container\nOperations needed: Whether view has user-initiated actions\nChild composition: Whether view binds child views\nComponent Selection\n\nBased on view type:\n\nDisplay-only: ViewModelView protocol, viewModel property only\nInteractive: Add operations, repaintToggle, testDataTransporter, toggleRepaint()\nForm: Add Validations environment, FormFieldView, validation error handling\nContainer: Add child view .bind() calls\nCode Generation\n\nGenerates view file with:\n\nViewModelView protocol conformance\nProperties (viewModel, operations if needed, repaintToggle if interactive)\nBody with rendering logic\nInit storing viewModel and operations\nAction methods (if interactive)\nTest infrastructure (if interactive)\nPreviews for different states\nContext Sources\n\nSkill references information from:\n\nPrior conversation: Requirements discussed with user\nSpecification files: If Claude has read specifications into context\nViewModel definitions: From codebase or discussion\nKey Patterns\nError Handling Pattern\n@State private var error: Error?\n\nvar body: some View {\n    VStack {\n        Button(errorBinding: $error, asyncAction: submit) {\n            Text(viewModel.submitLabel)\n        }\n    }\n    .alert(\n        errorBinding: $error,\n        title: viewModel.errorTitle,\n        message: viewModel.errorMessage,\n        dismissButtonLabel: viewModel.dismissButtonLabel\n    )\n}\n\nprivate func submit() async {\n    do {\n        try await operations.submit()\n    } catch {\n        self.error = error\n    }\n    toggleRepaint()\n}\n\nValidation Error Pattern\n\nFor forms, handle validation errors separately:\n\nprivate func submit() async {\n    let validations = validations\n    do {\n        try await operations.submit(data: viewModel.data)\n    } catch let error as MyRequest.ResponseError {\n        if !error.validationResults.isEmpty {\n            validations.replace(with: error.validationResults)\n        } else {\n            self.error = error\n        }\n    } catch {\n        self.error = error\n    }\n    toggleRepaint()\n}\n\nAsync Task Pattern\nvar body: some View {\n    VStack {\n        if isLoading {\n            ProgressView()\n        } else {\n            contentView\n        }\n    }\n    .task(errorBinding: $error) {\n        try await loadData()\n    }\n}\n\nprivate func loadData() async throws {\n    isLoading = true\n    try await operations.loadData()\n    isLoading = false\n    toggleRepaint()\n}\n\nConditional Rendering Pattern\n\nUse ViewModel state for conditionals:\n\nvar body: some View {\n    VStack {\n        if viewModel.isEmpty {\n            Text(viewModel.emptyStateMessage)\n        } else {\n            ForEach(viewModel.items) { item in\n                ItemRow(item: item)\n            }\n        }\n    }\n}\n\nComputed View Components Pattern\n\nExtract reusable view fragments as computed properties:\n\nprivate var headerView: some View {\n    HStack {\n        Text(viewModel.title)\n        Spacer()\n        Image(systemName: viewModel.iconName)\n    }\n}\n\nvar body: some View {\n    VStack {\n        headerView\n        contentView\n    }\n}\n\nResult/Error Handling Pattern\n\nWhen a view needs to render multiple possible ViewModels (success, various error types), use an enum wrapper:\n\nThe Wrapper ViewModel:\n\n@ViewModel\npublic struct TaskResultViewModel {\n    public enum Result {\n        case success(TaskViewModel)\n        case notFound(NotFoundViewModel)\n        case validationError(ValidationErrorViewModel)\n        case permissionDenied(PermissionDeniedViewModel)\n    }\n\n    public let result: Result\n    public var vmId: ViewModelId = .init(type: Self.self)\n\n    public init(result: Result) {\n        self.result = result\n    }\n}\n\n\nThe View:\n\npublic struct TaskResultView: ViewModelView {\n    private let viewModel: TaskResultViewModel\n\n    public var body: some View {\n        switch viewModel.result {\n        case .success(let vm):\n            TaskView(viewModel: vm)\n        case .notFound(let vm):\n            NotFoundView(viewModel: vm)\n        case .validationError(let vm):\n            ValidationErrorView(viewModel: vm)\n        case .permissionDenied(let vm):\n            PermissionDeniedView(viewModel: vm)\n        }\n    }\n\n    public init(viewModel: TaskResultViewModel) {\n        self.viewModel = viewModel\n    }\n}\n\n\nKey principles:\n\nEach error scenario has its own ViewModel type\nThe wrapper enum associates specific ViewModels with each case\nThe view switches on the enum and renders the appropriate child view\nMaintains type safety (no any ViewModel existentials)\nNo generic error handling - each error type is specific and meaningful\nViewModelId Initialization - CRITICAL\n\nIMPORTANT: ViewModelId controls SwiftUI's view identity system via the .id(vmId) modifier. Incorrect initialization causes SwiftUI to treat different data as the same view, breaking updates.\n\n❌ WRONG - Never use this:\n\npublic var vmId: ViewModelId = .init()  // NO! Generic identity\n\n\n✅ MINIMUM - Use type-based identity:\n\npublic var vmId: ViewModelId = .init(type: Self.self)\n\n\nThis ensures views of the same type get unique identities.\n\n✅ IDEAL - Use data-based identity when available:\n\npublic struct TaskViewModel {\n    public let id: ModelIdType\n    public var vmId: ViewModelId\n\n    public init(id: ModelIdType, /* other params */) {\n        self.id = id\n        self.vmId = .init(id: id)  // Ties view identity to data identity\n        // ...\n    }\n}\n\n\nWhy this matters:\n\nSwiftUI uses .id() modifier to determine when to recreate vs update views\nvmId provides this identity for ViewModelViews\nWrong identity = views don't update when data changes\nData-based identity (.init(id:)) is best because it ties view lifecycle to data lifecycle\nFile Organization\nSources/{ViewsTarget}/\n├── {Feature}/\n│   ├── {Feature}View.swift             # Full page → {Feature}ViewModel\n│   ├── {Entity}CardView.swift          # Child component → {Entity}CardViewModel\n│   ├── {Entity}RowView.swift           # Child component → {Entity}RowViewModel\n│   └── {Modal}View.swift               # Modal → {Modal}ViewModel\n├── Shared/\n│   ├── HeaderView.swift                # Shared components\n│   └── FooterView.swift\n└── Styles/\n    └── ButtonStyles.swift              # Reusable button styles\n\nCommon Mistakes\nComputing Data in Views\n// ❌ BAD - View is transforming data\nvar body: some View {\n    Text(\"\\(viewModel.firstName) \\(viewModel.lastName)\")\n}\n\n// ✅ GOOD - ViewModel provides shaped result\nvar body: some View {\n    Text(viewModel.fullName)  // via @LocalizedCompoundString\n}\n\nForgetting to Call toggleRepaint()\n// ❌ BAD - Test infrastructure won't work\nprivate func submit() {\n    operations.submit()\n    // Missing toggleRepaint()!\n}\n\n// ✅ GOOD - Always call after operations\nprivate func submit() {\n    operations.submit()\n    toggleRepaint()\n}\n\nUsing Computed Properties for Display\n// ❌ BAD - View is computing\nvar body: some View {\n    if !viewModel.items.isEmpty {\n        Text(\"You have \\(viewModel.items.count) items\")\n    }\n}\n\n// ✅ GOOD - ViewModel provides the state\nvar body: some View {\n    if viewModel.hasItems {\n        Text(viewModel.itemCountMessage)\n    }\n}\n\nHardcoding Text\n// ❌ BAD - Not localizable\nButton(action: submit) {\n    Text(\"Submit\")\n}\n\n// ✅ GOOD - ViewModel provides localized text\nButton(action: submit) {\n    Text(viewModel.submitButtonLabel)\n}\n\nMissing Error Binding\n// ❌ BAD - Errors not handled\nButton(action: submit) {\n    Text(viewModel.submitLabel)\n}\n\n// ✅ GOOD - Error binding for async actions\nButton(errorBinding: $error, asyncAction: submit) {\n    Text(viewModel.submitLabel)\n}\n\nStoring Operations in Body Instead of Init\n// ❌ BAD - Recomputed on every render\npublic var body: some View {\n    let operations = viewModel.operations\n    Button(action: { operations.submit() }) {\n        Text(viewModel.submitLabel)\n    }\n}\n\n// ✅ GOOD - Store in init\nprivate let operations: MyOperations\n\npublic init(viewModel: MyViewModel) {\n    self.viewModel = viewModel\n    self.operations = viewModel.operations\n}\n\nMismatched Filenames\n// ❌ BAD - Filename doesn't match ViewModel\nViewModel: TaskListViewModel\nView:      TasksView.swift\n\n// ✅ GOOD - Aligned names\nViewModel: TaskListViewModel\nView:      TaskListView.swift\n\nIncorrect ViewModelId Initialization\n// ❌ BAD - Generic identity, views won't update correctly\npublic var vmId: ViewModelId = .init()\n\n// ✅ MINIMUM - Type-based identity\npublic var vmId: ViewModelId = .init(type: Self.self)\n\n// ✅ IDEAL - Data-based identity (when id available)\npublic init(id: ModelIdType) {\n    self.id = id\n    self.vmId = .init(id: id)\n}\n\nForce-Unwrapping Localizable Strings\n// ❌ BAD - Force-unwrapping to work around missing overload\nimport SwiftUI\n\nText(try! viewModel.title.localizedString)  // Anti-pattern - don't do this!\nLabel(try! viewModel.label.localizedString, systemImage: \"star\")\n\n// ✅ GOOD - Request the proper SwiftUI overload instead\n// The correct solution is to add an init extension like this:\nextension Text {\n    public init(_ localizable: Localizable) {\n        self.init(localizable.localized)\n    }\n}\n\nextension Label where Title == Text, Icon == Image {\n    public init(_ title: Localizable, systemImage: String) {\n        self.init(title.localized, systemImage: systemImage)\n    }\n}\n\n// Then views use it cleanly without force-unwraps:\nText(viewModel.title)\nLabel(viewModel.label, systemImage: \"star\")\n\n\nWhy this matters:\n\nFOSMVVM provides the Localizable protocol for all localized strings and includes SwiftUI init overloads for common elements like Text. However, not every SwiftUI element has a Localizable overload yet.\n\nWhen you encounter a SwiftUI element that doesn't accept Localizable directly:\n\nDON'T work around it with try! localizable.localizedString - this bypasses the type system and spreads force-unwrap calls throughout the view code\nDO request that we add the proper init overload to FOSUtilities for that SwiftUI element\nThe pattern is simple: Extensions that accept Localizable and pass .localized to the standard initializer\n\nThis approach keeps the codebase clean, type-safe, and eliminates force-unwraps from view code entirely.\n\nFile Templates\n\nSee reference.md for complete file templates.\n\nNaming Conventions\nConcept\tConvention\tExample\nView struct\t{Name}View\tTaskListView, SignInView\nViewModel property\tviewModel\tAlways viewModel\nOperations property\toperations\tAlways operations\nError state\terror\tAlways error\nRepaint toggle\trepaintToggle\tAlways repaintToggle\nCommon Modifiers\nFOSMVVM-Specific Modifiers\n// Error alert with ViewModel strings\n.alert(\n    errorBinding: $error,\n    title: viewModel.errorTitle,\n    message: viewModel.errorMessage,\n    dismissButtonLabel: viewModel.dismissButtonLabel\n)\n\n// Async task with error handling\n.task(errorBinding: $error) {\n    try await loadData()\n}\n\n// Async submit handler\n.onAsyncSubmit {\n    await submit()\n}\n\n// Test data transporter (DEBUG only)\n.testDataTransporter(viewModelOps: operations, repaintToggle: $repaintToggle)\n\n// UI testing identifier\n.uiTestingIdentifier(\"submitButton\")\n\nStandard SwiftUI Modifiers\n\nApply standard modifiers as needed for layout, styling, etc.\n\nHow to Use This Skill\n\nInvocation:\n\n/fosmvvm-swiftui-view-generator\n\n\nPrerequisites:\n\nViewModel and its structure are understood from conversation\nOptionally, specification files have been read into context\nView requirements (display-only, interactive, form, container) are clear from discussion\n\nOutput:\n\n{ViewName}View.swift - SwiftUI view conforming to ViewModelView protocol\n\nWorkflow integration: This skill is typically used after discussing requirements or reading specification files. The skill references that context automatically—no file paths or Q&A needed.\n\nSee Also\nArchitecture Patterns - Mental models and patterns\nFOSMVVMArchitecture.md - Full FOSMVVM architecture\nfosmvvm-viewmodel-generator - For creating ViewModels\nfosmvvm-ui-tests-generator - For creating UI tests\nreference.md - Complete file templates\nVersion History\nVersion\tDate\tChanges\n1.0\t2026-01-23\tInitial skill for SwiftUI view generation"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/foscomputerservices/fosmvvm-swiftui-view-generator",
    "publisherUrl": "https://clawhub.ai/foscomputerservices/fosmvvm-swiftui-view-generator",
    "owner": "foscomputerservices",
    "version": "2.0.6",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/fosmvvm-swiftui-view-generator",
    "downloadUrl": "https://openagent3.xyz/downloads/fosmvvm-swiftui-view-generator",
    "agentUrl": "https://openagent3.xyz/skills/fosmvvm-swiftui-view-generator/agent",
    "manifestUrl": "https://openagent3.xyz/skills/fosmvvm-swiftui-view-generator/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/fosmvvm-swiftui-view-generator/agent.md"
  }
}