Vai al contenuto
TakoAPI
Torna alle skill

fosmvvm-viewmodel-generator

di foscomputerservices

Coding Agents & IDEs
455Download riportati da clawskills.sh
2Stelle
0Visualizzazioni
0 likeAccedi per mettere like a questa skill
—Non ancora valutato
La tua valutazione

Sintesi

Generate FOSMVVM ViewModels for SwiftUI screens, pages, and components.

Descrizione

Cosa fa questa skill

Scaffolds ViewModels for SwiftUI screens following FOSMVVM architecture. Handles both server-hosted and client-hosted modes, generating the correct combination of ViewModel structs, Request types, localization YAML, and factory files. Covers display ViewModels, form ViewModels, child ViewModels, and error display patterns.

It encodes the multi-file structure, hosting mode decision, and protocol adoption rules of FOSMVVM so developers don't have to manually reason through each placement decision.

Quando usarla

  • Generating a new page ViewModel that fetches data from a server API
  • Scaffolding a settings screen ViewModel backed by local device state
  • Creating a client-hosted error display ViewModel from a caught ResponseError
  • Adding a card or row child ViewModel nested inside a parent list ViewModel
  • Producing localization YAML alongside a new ViewModel struct

Esempio di workflow

INPUT

User asks: Create a ViewModel for a user profile screen that loads data from the server

AGENT
  1. 1

    Determine hosting mode: data comes from server, so server-hosted

  2. 2

    Design ViewModel properties: @LocalizedString for page title, stored properties for profile data, LocalizableDate for join date

  3. 3

    Generate UserProfileViewModel.swift with RequestableViewModel conformance and vmId

  4. 4

    Generate UserProfileRequest.swift with the associated ViewModelRequest type

  5. 5

    Generate UserProfileViewModel.yml with English localization keys

  6. 6

    Generate UserProfileViewModel+Factory.swift with hand-written factory querying the database

OUTPUT

Four files: UserProfileViewModel.swift, UserProfileRequest.swift, UserProfileViewModel.yml, UserProfileViewModel+Factory.swift

Installazione

clawhub install foscomputerservices/fosmvvm-viewmodel-generator

Esegui il comando CLI oppure incolla il prompt in Claude Code, Cursor, Codex o nell'agente di coding che usi.

Link