AgentSkillsCN

viewmodel-scaffold

为 Swift 模块搭建 MVVM ViewModel,并引入 Swift Concurrency 支持。

SKILL.md
--- frontmatter
name: viewmodel-scaffold
description: Scaffold an MVVM ViewModel with Swift Concurrency.
disable-model-invocation: true

ViewModel Scaffold

Create a view model with typed state and async actions.

When to Use

  • When a view needs business logic or async data.

Inputs

  • ViewModel name
  • State shape
  • Dependencies and async actions

Instructions

  1. Define state model and public API.
  2. Implement async actions using async/await.
  3. Add unit tests for state transitions.

Output

  • ViewModel file and XCTest coverage.