[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75GFTWC85K35VXN1PCXJSCW":3,"skill-same:01M75GFTWC85K35VXN1PCXJSCW":53},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":36,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M75GFTWC85K35VXN1PCXJSCW","fosmvvm-ui-tests-generator",null,"Generate UI tests for FOSMVVM SwiftUI views using XCTest and FOSTestingUI. Covers accessibility identifiers, ViewModelOperations, and test data transport.","javimosch\u002Fopen-claw-skills","javimosch","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F12900508?v=4","01M6D3F2AS6PV75ET9PZ1QGP8J","Javier Leandro Arancibia","01M75B8NCTAJG9WH5YNZH7C3D8",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Ffoscomputerservices\u002Ffosmvvm-ui-tests-generator\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: fosmvvm-ui-tests-generator\ndescription: Generate UI tests for FOSMVVM SwiftUI views using XCTest and FOSTestingUI. Covers accessibility identifiers, ViewModelOperations, and test data transport.\nhomepage: https:\u002F\u002Fgithub.com\u002Ffoscomputerservices\u002FFOSUtilities\nmetadata: {\"clawdbot\": {\"emoji\": \"🖥️\", \"os\": [\"darwin\"]}}\n---\n\n# FOSMVVM UI Tests Generator\n\nGenerate comprehensive UI tests for ViewModelViews in FOSMVVM applications.\n\n## Conceptual Foundation\n\n> For full architecture context, see [FOSMVVMArchitecture.md](..\u002F..\u002Fdocs\u002FFOSMVVMArchitecture.md) | [OpenClaw reference]({baseDir}\u002Freferences\u002FFOSMVVMArchitecture.md)\n\nUI testing in FOSMVVM follows a specific pattern that leverages:\n- **FOSTestingUI** framework for test infrastructure\n- **ViewModelOperations** for verifying business logic was invoked\n- **Accessibility identifiers** for finding UI elements\n- **Test data transporter** for passing operation stubs to the app\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                    UI Test Architecture                      │\n├─────────────────────────────────────────────────────────────┤\n│                                                              │\n│  Test File (XCTest)                 App Under Test          │\n│  ┌──────────────────┐              ┌──────────────────┐     │\n│  │ MyViewUITests    │              │ MyView           │     │\n│  │                  │              │                  │     │\n│  │ presentView() ───┼─────────────►│ Show view with   │     │\n│  │   with stub VM   │              │   stubbed data   │     │\n│  │                  │              │                  │     │\n│  │ Interact via ────┼─────────────►│ UI elements with │     │\n│  │   identifiers    │              │   .uiTestingId   │     │\n│  │                  │              │                  │     │\n│  │ Assert on UI     │              │ .testData────────┼──┐  │\n│  │   state          │              │   Transporter    │  │  │\n│  │                  │              └──────────────────┘  │  │\n│  │ viewModelOps() ◄─┼─────────────────────────────────────┘  │\n│  │   verify calls   │              Stub Operations          │\n│  └──────────────────┘                                        │\n│                                                              │\n└─────────────────────────────────────────────────────────────┘\n```\n\n## Core Components\n\n### 1. Base Test Case Class\n\nEvery project should have a base test case that inherits from `ViewModelViewTestCase`:\n\n```swift\nclass MyAppViewModelViewTestCase\u003CVM: ViewModel, VMO: ViewModelOperations>:\n    ViewModelViewTestCase\u003CVM, VMO>, @unchecked Sendable {\n\n    @MainActor func presentView(\n        configuration: TestConfiguration,\n        viewModel: VM = .stub(),\n        timeout: TimeInterval = 3\n    ) throws -> XCUIApplication {\n        try presentView(\n            testConfiguration: configuration.toJSON(),\n            viewModel: viewModel,\n            timeout: timeout\n        )\n    }\n\n    override func setUp() async throws {\n        try await super.setUp(\n            bundle: Bundle.main,\n            resourceDirectoryName: \"\",\n            appBundleIdentifier: \"com.example.MyApp\"\n        )\n\n        continueAfterFailure = false\n    }\n}\n```\n\n**Key points:**\n- Generic over `ViewModel` and `ViewModelOperations`\n- Wraps FOSTestingUI's `presentView()` with project-specific configuration\n- Sets up bundle and app bundle identifier\n- `continueAfterFailure = false` stops tests immediately on failure\n\n### 2. Individual UI Test Files\n\nEach ViewModelView gets a corresponding UI test file.\n\n**For views WITH operations:**\n\n```swift\nfinal class MyViewUITests: MyAppViewModelViewTestCase\u003CMyViewModel, MyViewOps> {\n    \u002F\u002F UI Tests - verify UI state\n    func testButtonEnabled() async throws {\n        let app = try presentView(viewModel: .stub(enabled: true))\n        XCTAssertTrue(app.myButton.isEnabled)\n    }\n\n    \u002F\u002F Operation Tests - verify operations were called\n    func testButtonTap() async throws {\n        let app = try presentView(configuration: .requireSomeState())\n        app.myButton.tap()\n\n        let stubOps = try viewModelOperations()\n        XCTAssertTrue(stubOps.myOperationCalled)\n    }\n}\n\nprivate extension XCUIApplication {\n    var myButton: XCUIElement {\n        buttons.element(matching: .button, identifier: \"myButtonIdentifier\")\n    }\n}\n```\n\n**For views WITHOUT operations** (display-only):\n\nUse an empty stub operations protocol:\n\n```swift\n\u002F\u002F In your test file\nprotocol MyViewStubOps: ViewModelOperations {}\nstruct MyViewStubOpsImpl: MyViewStubOps {}\n\nfinal class MyViewUITests: MyAppViewModelViewTestCase\u003CMyViewModel, MyViewStubOpsImpl> {\n    \u002F\u002F UI Tests only - no operation verification\n    func testDisplaysCorrectly() async throws {\n        let app = try presentView(viewModel: .stub(title: \"Test\"))\n        XCTAssertTrue(app.titleLabel.exists)\n    }\n}\n```\n\n**When to use each:**\n- **With operations**: Interactive views that perform actions (forms, buttons that call APIs, etc.)\n- **Without operations**: Display-only views (cards, detail views, static content)\n\n### 3. XCUIElement Helper Extensions\n\nCommon helpers for interacting with UI elements:\n\n```swift\nextension XCUIElement {\n    var text: String? {\n        value as? String\n    }\n\n    func typeTextAndWait(_ string: String, timeout: TimeInterval = 2) {\n        typeText(string)\n        _ = wait(for: \\.text, toEqual: string, timeout: timeout)\n    }\n\n    func tapMenu() {\n        if isHittable {\n            tap()\n        } else {\n            coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()\n        }\n    }\n}\n```\n\n### 4. View Requirements\n\n**For views WITH operations:**\n\n```swift\npublic struct MyView: ViewModelView {\n    #if DEBUG\n    @State private var repaintToggle = false\n    #endif\n\n    private let viewModel: MyViewModel\n    private let operations: MyViewModelOperations\n\n    public var body: some View {\n        Button(action: doSomething) {\n            Text(viewModel.buttonLabel)\n        }\n        .uiTestingIdentifier(\"myButtonIdentifier\")\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 doSomething() {\n        operations.doSomething()\n        toggleRepaint()\n    }\n\n    private func toggleRepaint() {\n        #if DEBUG\n        repaintToggle.toggle()\n        #endif\n    }\n}\n```\n\n**For views WITHOUT operations** (display-only):\n\n```swift\npublic struct MyView: ViewModelView {\n    private let viewModel: MyViewModel\n\n    public var body: some View {\n        VStack {\n            Text(viewModel.title)\n            Text(viewModel.description)\n        }\n        .uiTestingIdentifier(\"mainContent\")\n    }\n\n    public init(viewModel: MyViewModel) {\n        self.viewModel = viewModel\n    }\n}\n```\n\n**Critical patterns (for views WITH operations):**\n- `@State private var repaintToggle = false` for triggering test data transport\n- `.testDataTransporter(viewModelOps:repaintToggle:)` modifier in DEBUG\n- `toggleRepaint()` called after every operation invocation\n- `operations` stored as property from `viewModel.operations`\n\n**Display-only views:**\n- No `repaintToggle` needed\n- No `.testDataTransporter()` modifier needed\n- Just add `.uiTestingIdentifier()` to elements you want to test\n\n## ViewModelOperations: Optional\n\nNot all views need ViewModelOperations:\n\n**Views that NEED operations:**\n- Forms with submit\u002Fcancel actions\n- Views that call business logic or APIs\n- Interactive views that trigger app state changes\n- Views with user-initiated async operations\n\n**Views that DON'T NEED operations:**\n- Display-only cards or detail views\n- Static content views\n- Pure navigation containers\n- Server-hosted views that just render data\n\n**For views without operations:**\n\nCreate an empty operations file alongside your ViewModel:\n\n```swift\n\u002F\u002F MyDisplayViewModelOperations.swift\nimport FOSMVVM\nimport Foundation\n\npublic protocol MyDisplayViewModelOperations: ViewModelOperations {}\n\n#if canImport(SwiftUI)\npublic final class MyDisplayViewStubOps: MyDisplayViewModelOperations, @unchecked Sendable {\n    public init() {}\n}\n#endif\n```\n\nThen use it in tests:\n\n```swift\nfinal class MyDisplayViewUITests: MyAppViewModelViewTestCase\u003C\n    MyDisplayViewModel,\n    MyDisplayViewStubOps\n> {\n    \u002F\u002F Only test UI state, no operation verification\n}\n```\n\nThe view itself doesn't need:\n- `repaintToggle` state\n- `.testDataTransporter()` modifier\n- `operations` property\n- `toggleRepaint()` function\n\nJust add `.uiTestingIdentifier()` to elements you want to verify.\n\n## Test Categories\n\n### UI State Tests\n\nVerify that the UI displays correctly based on ViewModel state:\n\n```swift\nfunc testButtonDisabledWhenNotReady() async throws {\n    let app = try presentView(viewModel: .stub(ready: false))\n    XCTAssertFalse(app.submitButton.isEnabled)\n}\n\nfunc testButtonEnabledWhenReady() async throws {\n    let app = try presentView(viewModel: .stub(ready: true))\n    XCTAssertTrue(app.submitButton.isEnabled)\n}\n```\n\n### Operation Tests\n\nVerify that user interactions invoke the correct operations:\n\n```swift\nfunc testSubmitButtonInvokesOperation() async throws {\n    let app = try presentView(configuration: .requireAuth())\n    app.submitButton.tap()\n\n    let stubOps = try viewModelOperations()\n    XCTAssertTrue(stubOps.submitCalled)\n    XCTAssertFalse(stubOps.cancelCalled)\n}\n```\n\n### Navigation Tests\n\nVerify navigation flows work correctly:\n\n```swift\nfunc testNavigationToDetailView() async throws {\n    let app = try presentView()\n    app.itemRow.tap()\n\n    XCTAssertTrue(app.detailView.exists)\n}\n```\n\n## When to Use This Skill\n\n- Adding UI tests for a new ViewModelView\n- Setting up UI test infrastructure for a FOSMVVM project\n- Following an implementation plan that requires test coverage\n- Validating user interaction flows\n\n## What This Skill Generates\n\n### Initial Setup (once per project)\n\n| File | Location | Purpose |\n|------|----------|---------|\n| `{ProjectName}ViewModelViewTestCase.swift` | `Tests\u002FUITests\u002FSupport\u002F` | Base test case for all UI tests |\n| `XCUIElement.swift` | `Tests\u002FUITests\u002FSupport\u002F` | Helper extensions for XCUIElement |\n\n### Per ViewModelView\n\n| File | Location | Purpose |\n|------|----------|---------|\n| `{ViewName}ViewModelOperations.swift` | `Sources\u002F{ViewModelsTarget}\u002F{Feature}\u002F` | Operations protocol and stub (if view has interactions) |\n| `{ViewName}UITests.swift` | `Tests\u002FUITests\u002FViews\u002F{Feature}\u002F` | UI tests for the view |\n\n**Note:** Views without user interactions use an empty operations file with just the protocol and minimal stub.\n\n## Project Structure Configuration\n\n| Placeholder | Description | Example |\n|-------------|-------------|---------|\n| `{ProjectName}` | Your project\u002Fapp name | `MyApp`, `TaskManager` |\n| `{ViewName}` | The ViewModelView name (without \"View\" suffix) | `TaskList`, `Dashboard` |\n| `{Feature}` | Feature\u002Fmodule grouping | `Tasks`, `Settings` |\n\n## How to Use This Skill\n\n**Invocation:**\n\u002Ffosmvvm-ui-tests-generator\n\n**Prerequisites:**\n- View and ViewModel structure understood from conversation context\n- ViewModelOperations type identified (or confirmed as display-only)\n- Interactive elements and user flows discussed\n\n**Workflow integration:**\nThis skill is typically used after implementing ViewModelViews. The skill references conversation context automatically—no file paths or Q&A needed. Often follows fosmvvm-swiftui-view-generator or fosmvvm-react-view-generator.\n\n## Pattern Implementation\n\nThis skill references conversation context to determine test structure:\n\n### Test Type Detection\n\nFrom conversation context, the skill identifies:\n- **First test vs additional test** (whether base test infrastructure exists)\n- **ViewModel type** (from prior discussion or View implementation)\n- **ViewModelOperations type** (from View implementation or context)\n- **Interactive vs display-only** (whether operations need verification)\n\n### View Analysis\n\nFrom requirements already in context:\n- **Interactive elements** (buttons, fields, controls requiring test coverage)\n- **User flows** (navigation paths, form submission, drag-and-drop)\n- **State variations** (enabled\u002Fdisabled, visible\u002Fhidden, error states)\n- **Operation triggers** (which UI actions invoke which operations)\n\n### Infrastructure Planning\n\nBased on project state:\n- **Base test case** (create if first test, reuse if exists)\n- **XCUIElement extensions** (helper methods for common interactions)\n- **App bundle identifier** (for launching test host)\n\n### Test File Generation\n\nFor the specific view:\n1. Test class inheriting from base test case\n2. UI state tests (verify display based on ViewModel)\n3. Operation tests (verify user interactions invoke operations)\n4. XCUIApplication extension with element accessors\n\n### View Requirements\n\nEnsure test identifiers and data transport:\n1. `.uiTestingIdentifier()` on all interactive elements\n2. `@State private var repaintToggle` (if has operations)\n3. `.testDataTransporter()` modifier (if has operations)\n4. `toggleRepaint()` calls after operations (if has operations)\n\n### Context Sources\n\nSkill references information from:\n- **Prior conversation**: View requirements, user flows discussed\n- **View implementation**: If Claude has read View code into context\n- **ViewModelOperations**: From codebase or discussion\n\n## Key Patterns\n\n### Test Configuration Pattern\n\nUse `TestConfiguration` for tests that need specific app state:\n\n```swift\nfunc testWithSpecificState() async throws {\n    let app = try presentView(\n        configuration: .requireAuth(userId: \"123\")\n    )\n    \u002F\u002F Test with authenticated state\n}\n```\n\n### Element Accessor Pattern\n\nDefine element accessors in a private extension:\n\n```swift\nprivate extension XCUIApplication {\n    var submitButton: XCUIElement {\n        buttons.element(matching: .button, identifier: \"submitButton\")\n    }\n\n    var cancelButton: XCUIElement {\n        buttons.element(matching: .button, identifier: \"cancelButton\")\n    }\n\n    var firstItem: XCUIElement {\n        buttons.element(matching: .button, identifier: \"itemButton\").firstMatch\n    }\n}\n```\n\n### Operation Verification Pattern\n\nAfter user interactions, verify operations were called:\n\n```swift\nfunc testDecrementButton() async throws {\n    let app = try presentView(configuration: .requireDevice())\n    app.decrementButton.tap()\n\n    let stubOps = try viewModelOperations()\n    XCTAssertTrue(stubOps.decrementCalled)\n    XCTAssertFalse(stubOps.incrementCalled)\n}\n```\n\n### Orientation Setup Pattern\n\nSet device orientation in `setUp()` if needed:\n\n```swift\noverride func setUp() async throws {\n    try await super.setUp()\n\n    #if os(iOS)\n    XCUIDevice.shared.orientation = .portrait\n    #endif\n}\n```\n\n## View Testing Checklist\n\n**All views:**\n- [ ] `.uiTestingIdentifier()` on all elements you want to test\n\n**Views WITH operations (interactive views):**\n- [ ] `@State private var repaintToggle = false` property\n- [ ] `.testDataTransporter(viewModelOps:repaintToggle:)` modifier\n- [ ] `toggleRepaint()` helper function\n- [ ] `toggleRepaint()` called after every operation invocation\n- [ ] `operations` stored from `viewModel.operations` in init\n\n**Views WITHOUT operations (display-only):**\n- [ ] No `repaintToggle` needed\n- [ ] No `.testDataTransporter()` needed\n- [ ] No `operations` property needed\n- [ ] `operations` stored from `viewModel.operations` in init\n\n## Common Test Patterns\n\n### Testing Async Operations\n\n```swift\nfunc testAsyncOperation() async throws {\n    let app = try presentView()\n    app.loadButton.tap()\n\n    \u002F\u002F Wait for UI to update\n    _ = app.waitForExistence(timeout: 3)\n\n    let stubOps = try viewModelOperations()\n    XCTAssertTrue(stubOps.loadCalled)\n}\n```\n\n### Testing Form Input\n\n```swift\nfunc testFormInput() async throws {\n    let app = try presentView()\n\n    let emailField = app.emailTextField\n    emailField.tap()\n    emailField.typeTextAndWait(\"user@example.com\")\n\n    app.submitButton.tap()\n\n    let stubOps = try viewModelOperations()\n    XCTAssertTrue(stubOps.submitCalled)\n}\n```\n\n### Testing Error States\n\n```swift\nfunc testErrorDisplay() async throws {\n    let app = try presentView(viewModel: .stub(hasError: true))\n\n    XCTAssertTrue(app.errorAlert.exists)\n    XCTAssertEqual(app.errorMessage.text, \"An error occurred\")\n}\n```\n\n## File Templates\n\nSee [reference.md](reference.md) for complete file templates.\n\n## Naming Conventions\n\n| Concept | Convention | Example |\n|---------|------------|---------|\n| Base test case | `{ProjectName}ViewModelViewTestCase` | `MyAppViewModelViewTestCase` |\n| UI test file | `{ViewName}UITests` | `TaskListViewUITests` |\n| Test method (UI state) | `test{Condition}` | `testButtonEnabled` |\n| Test method (operation) | `test{Action}` | `testSubmitButton` |\n| Element accessor | `{elementName}` | `submitButton`, `emailTextField` |\n| UI testing identifier | `{elementName}Identifier` or `{elementName}` | `\"submitButton\"`, `\"emailTextField\"` |\n\n## See Also\n\n- [Architecture Patterns](..\u002Fshared\u002Farchitecture-patterns.md) - Mental models and patterns\n- [FOSMVVMArchitecture.md](..\u002F..\u002Fdocs\u002FFOSMVVMArchitecture.md) - Full FOSMVVM architecture\n- [fosmvvm-viewmodel-generator](..\u002Ffosmvvm-viewmodel-generator\u002FSKILL.md) - For creating ViewModels\n- [fosmvvm-swiftui-app-setup](..\u002Ffosmvvm-swiftui-app-setup\u002FSKILL.md) - For app test host setup\n- [reference.md](reference.md) - Complete file templates\n\n## Version History\n\n| Version | Date | Changes |\n|---------|------|---------|\n| 1.0 | 2026-01-23 | Initial skill for UI tests |\n| 1.1 | 2026-01-24 | Update to context-aware approach (remove file-parsing\u002FQ&A). Skill references conversation context instead of asking questions or accepting file paths. |\n","# FOSMVVM UI Tests Generator\n\nGenerate comprehensive UI tests for ViewModelViews in FOSMVVM applications.\n\n## Conceptual Foundation\n\n> For full architecture context, see [FOSMVVMArchitecture.md](..\u002F..\u002Fdocs\u002FFOSMVVMArchitecture.md) | [OpenClaw reference]({baseDir}\u002Freferences\u002FFOSMVVMArchitecture.md)\n\nUI testing in FOSMVVM follows a specific pattern that leverages:\n- **FOSTestingUI** framework for test infrastructure\n- **ViewModelOperations** for verifying business logic was invoked\n- **Accessibility identifiers** for finding UI elements\n- **Test data transporter** for passing operation stubs to the app\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                    UI Test Architecture                      │\n├─────────────────────────────────────────────────────────────┤\n│                                                              │\n│  Test File (XCTest)                 App Under Test          │\n│  ┌──────────────────┐              ┌──────────────────┐     │\n│  │ MyViewUITests    │              │ MyView           │     │\n│  │                  │              │                  │     │\n│  │ presentView() ───┼─────────────►│ Show view with   │     │\n│  │   with stub VM   │              │   stubbed data   │     │\n│  │                  │              │                  │     │\n│  │ Interact via ────┼─────────────►│ UI elements with │     │\n│  │   identifiers    │              │   .uiTestingId   │     │\n│  │                  │              │                  │     │\n│  │ Assert on UI     │              │ .testData────────┼──┐  │\n│  │   state          │              │   Transporter    │  │  │\n│  │                  │              └──────────────────┘  │  │\n│  │ viewModelOps() ◄─┼─────────────────────────────────────┘  │\n│  │   verify calls   │              Stub Operations          │\n│  └──────────────────┘                                        │\n│                                                              │\n└─────────────────────────────────────────────────────────────┘\n```\n\n## Core Components\n\n### 1. Base Test Case Class\n\nEvery project should have a base test case that inherits from `ViewModelViewTestCase`:\n\n```swift\nclass MyAppViewModelViewTestCase\u003CVM: ViewModel, VMO: ViewModelOperations>:\n    ViewModelViewTestCase\u003CVM, VMO>, @unchecked Sendable {\n\n    @MainActor func presentView(\n        configuration: TestConfiguration,\n        viewModel: VM = .stub(),\n        timeout: TimeInterval = 3\n    ) throws -> XCUIApplication {\n        try presentView(\n            testConfiguration: configuration.toJSON(),\n            viewModel: viewModel,\n            timeout: timeout\n        )\n    }\n\n    override func setUp() async throws {\n        try await super.setUp(\n            bundle: Bundle.main,\n            resourceDirectoryName: \"\",\n            appBundleIdentifier: \"com.example.MyApp\"\n        )\n\n        continueAfterFailure = false\n    }\n}\n```\n\n**Key points:**\n- Generic over `ViewModel` and `ViewModelOperations`\n- Wraps FOSTestingUI's `presentView()` with project-specific configuration\n- Sets up bundle and app bundle identifier\n- `continueAfterFailure = false` stops tests immediately on failure\n\n### 2. Individual UI Test Files\n\nEach ViewModelView gets a corresponding UI test file.\n\n**For views WITH operations:**\n\n```swift\nfinal class MyViewUITests: MyAppViewModelViewTestCase\u003CMyViewModel, MyViewOps> {\n    \u002F\u002F UI Tests - verify UI state\n    func testButtonEnabled() async throws {\n        let app = try presentView(viewModel: .stub(enabled: true))\n        XCTAssertTrue(app.myButton.isEnabled)\n    }\n\n    \u002F\u002F Operation Tests - verify operations were called\n    func testButtonTap() async throws {\n        let app = try presentView(configuration: .requireSomeState())\n        app.myButton.tap()\n\n        let stubOps = try viewModelOperations()\n        XCTAssertTrue(stubOps.myOperationCalled)\n    }\n}\n\nprivate extension XCUIApplication {\n    var myButton: XCUIElement {\n        buttons.element(matching: .button, identifier: \"myButtonIdentifier\")\n    }\n}\n```\n\n**For views WITHOUT operations** (display-only):\n\nUse an empty stub operations protocol:\n\n```swift\n\u002F\u002F In your test file\nprotocol MyViewStubOps: ViewModelOperations {}\nstruct MyViewStubOpsImpl: MyViewStubOps {}\n\nfinal class MyViewUITests: MyAppViewModelViewTestCase\u003CMyViewModel, MyViewStubOpsImpl> {\n    \u002F\u002F UI Tests only - no operation verification\n    func testDisplaysCorrectly() async throws {\n        let app = try presentView(viewModel: .stub(title: \"Test\"))\n        XCTAssertTrue(app.titleLabel.exists)\n    }\n}\n```\n\n**When to use each:**\n- **With operations**: Interactive views that perform actions (forms, buttons that call APIs, etc.)\n- **Without operations**: Display-only views (cards, detail views, static content)\n\n### 3. XCUIElement Helper Extensions\n\nCommon helpers for interacting with UI elements:\n\n```swift\nextension XCUIElement {\n    var text: String? {\n        value as? String\n    }\n\n    func typeTextAndWait(_ string: String, timeout: TimeInterval = 2) {\n        typeText(string)\n        _ = wait(for: \\.text, toEqual: string, timeout: timeout)\n    }\n\n    func tapMenu() {\n        if isHittable {\n            tap()\n        } else {\n            coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()\n        }\n    }\n}\n```\n\n### 4. View Requirements\n\n**For views WITH operations:**\n\n```swift\npublic struct MyView: ViewModelView {\n    #if DEBUG\n    @State private var repaintToggle = false\n    #endif\n\n    private let viewModel: MyViewModel\n    private let operations: MyViewModelOperations\n\n    public var body: some View {\n        Button(action: doSomething) {\n            Text(viewModel.buttonLabel)\n        }\n        .uiTestingIdentifier(\"myButtonIdentifier\")\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 doSomething() {\n        operations.doSomething()\n        toggleRepaint()\n    }\n\n    private func toggleRepaint() {\n        #if DEBUG\n        repaintToggle.toggle()\n        #endif\n    }\n}\n```\n\n**For views WITHOUT operations** (display-only):\n\n```swift\npublic struct MyView: ViewModelView {\n    private let viewModel: MyViewModel\n\n    public var body: some View {\n        VStack {\n            Text(viewModel.title)\n            Text(viewModel.description)\n        }\n        .uiTestingIdentifier(\"mainContent\")\n    }\n\n    public init(viewModel: MyViewModel) {\n        self.viewModel = viewModel\n    }\n}\n```\n\n**Critical patterns (for views WITH operations):**\n- `@State private var repaintToggle = false` for triggering test data transport\n- `.testDataTransporter(viewModelOps:repaintToggle:)` modifier in DEBUG\n- `toggleRepaint()` called after every operation invocation\n- `operations` stored as property from `viewModel.operations`\n\n**Display-only views:**\n- No `repaintToggle` needed\n- No `.testDataTransporter()` modifier needed\n- Just add `.uiTestingIdentifier()` to elements you want to test\n\n## ViewModelOperations: Optional\n\nNot all views need ViewModelOperations:\n\n**Views that NEED operations:**\n- Forms with submit\u002Fcancel actions\n- Views that call business logic or APIs\n- Interactive views that trigger app state changes\n- Views with user-initiated async operations\n\n**Views that DON'T NEED operations:**\n- Display-only cards or detail views\n- Static content views\n- Pure navigation containers\n- Server-hosted views that just render data\n\n**For views without operations:**\n\nCreate an empty operations file alongside your ViewModel:\n\n```swift\n\u002F\u002F MyDisplayViewModelOperations.swift\nimport FOSMVVM\nimport Foundation\n\npublic protocol MyDisplayViewModelOperations: ViewModelOperations {}\n\n#if canImport(SwiftUI)\npublic final class MyDisplayViewStubOps: MyDisplayViewModelOperations, @unchecked Sendable {\n    public init() {}\n}\n#endif\n```\n\nThen use it in tests:\n\n```swift\nfinal class MyDisplayViewUITests: MyAppViewModelViewTestCase\u003C\n    MyDisplayViewModel,\n    MyDisplayViewStubOps\n> {\n    \u002F\u002F Only test UI state, no operation verification\n}\n```\n\nThe view itself doesn't need:\n- `repaintToggle` state\n- `.testDataTransporter()` modifier\n- `operations` property\n- `toggleRepaint()` function\n\nJust add `.uiTestingIdentifier()` to elements you want to verify.\n\n## Test Categories\n\n### UI State Tests\n\nVerify that the UI displays correctly based on ViewModel state:\n\n```swift\nfunc testButtonDisabledWhenNotReady() async throws {\n    let app = try presentView(viewModel: .stub(ready: false))\n    XCTAssertFalse(app.submitButton.isEnabled)\n}\n\nfunc testButtonEnabledWhenReady() async throws {\n    let app = try presentView(viewModel: .stub(ready: true))\n    XCTAssertTrue(app.submitButton.isEnabled)\n}\n```\n\n### Operation Tests\n\nVerify that user interactions invoke the correct operations:\n\n```swift\nfunc testSubmitButtonInvokesOperation() async throws {\n    let app = try presentView(configuration: .requireAuth())\n    app.submitButton.tap()\n\n    let stubOps = try viewModelOperations()\n    XCTAssertTrue(stubOps.submitCalled)\n    XCTAssertFalse(stubOps.cancelCalled)\n}\n```\n\n### Navigation Tests\n\nVerify navigation flows work correctly:\n\n```swift\nfunc testNavigationToDetailView() async throws {\n    let app = try presentView()\n    app.itemRow.tap()\n\n    XCTAssertTrue(app.detailView.exists)\n}\n```\n\n## When to Use This Skill\n\n- Adding UI tests for a new ViewModelView\n- Setting up UI test infrastructure for a FOSMVVM project\n- Following an implementation plan that requires test coverage\n- Validating user interaction flows\n\n## What This Skill Generates\n\n### Initial Setup (once per project)\n\n| File | Location | Purpose |\n|------|----------|---------|\n| `{ProjectName}ViewModelViewTestCase.swift` | `Tests\u002FUITests\u002FSupport\u002F` | Base test case for all UI tests |\n| `XCUIElement.swift` | `Tests\u002FUITests\u002FSupport\u002F` | Helper extensions for XCUIElement |\n\n### Per ViewModelView\n\n| File | Location | Purpose |\n|------|----------|---------|\n| `{ViewName}ViewModelOperations.swift` | `Sources\u002F{ViewModelsTarget}\u002F{Feature}\u002F` | Operations protocol and stub (if view has interactions) |\n| `{ViewName}UITests.swift` | `Tests\u002FUITests\u002FViews\u002F{Feature}\u002F` | UI tests for the view |\n\n**Note:** Views without user interactions use an empty operations file with just the protocol and minimal stub.\n\n## Project Structure Configuration\n\n| Placeholder | Description | Example |\n|-------------|-------------|---------|\n| `{ProjectName}` | Your project\u002Fapp name | `MyApp`, `TaskManager` |\n| `{ViewName}` | The ViewModelView name (without \"View\" suffix) | `TaskList`, `Dashboard` |\n| `{Feature}` | Feature\u002Fmodule grouping | `Tasks`, `Settings` |\n\n## How to Use This Skill\n\n**Invocation:**\n\u002Ffosmvvm-ui-tests-generator\n\n**Prerequisites:**\n- View and ViewModel structure understood from conversation context\n- ViewModelOperations type identified (or confirmed as display-only)\n- Interactive elements and user flows discussed\n\n**Workflow integration:**\nThis skill is typically used after implementing ViewModelViews. The skill references conversation context automatically—no file paths or Q&A needed. Often follows fosmvvm-swiftui-view-generator or fosmvvm-react-view-generator.\n\n## Pattern Implementation\n\nThis skill references conversation context to determine test structure:\n\n### Test Type Detection\n\nFrom conversation context, the skill identifies:\n- **First test vs additional test** (whether base test infrastructure exists)\n- **ViewModel type** (from prior discussion or View implementation)\n- **ViewModelOperations type** (from View implementation or context)\n- **Interactive vs display-only** (whether operations need verification)\n\n### View Analysis\n\nFrom requirements already in context:\n- **Interactive elements** (buttons, fields, controls requiring test coverage)\n- **User flows** (navigation paths, form submission, drag-and-drop)\n- **State variations** (enabled\u002Fdisabled, visible\u002Fhidden, error states)\n- **Operation triggers** (which UI actions invoke which operations)\n\n### Infrastructure Planning\n\nBased on project state:\n- **Base test case** (create if first test, reuse if exists)\n- **XCUIElement extensions** (helper methods for common interactions)\n- **App bundle identifier** (for launching test host)\n\n### Test File Generation\n\nFor the specific view:\n1. Test class inheriting from base test case\n2. UI state tests (verify display based on ViewModel)\n3. Operation tests (verify user interactions invoke operations)\n4. XCUIApplication extension with element accessors\n\n### View Requirements\n\nEnsure test identifiers and data transport:\n1. `.uiTestingIdentifier()` on all interactive elements\n2. `@State private var repaintToggle` (if has operations)\n3. `.testDataTransporter()` modifier (if has operations)\n4. `toggleRepaint()` calls after operations (if has operations)\n\n### Context Sources\n\nSkill references information from:\n- **Prior conversation**: View requirements, user flows discussed\n- **View implementation**: If Claude has read View code into context\n- **ViewModelOperations**: From codebase or discussion\n\n## Key Patterns\n\n### Test Configuration Pattern\n\nUse `TestConfiguration` for tests that need specific app state:\n\n```swift\nfunc testWithSpecificState() async throws {\n    let app = try presentView(\n        configuration: .requireAuth(userId: \"123\")\n    )\n    \u002F\u002F Test with authenticated state\n}\n```\n\n### Element Accessor Pattern\n\nDefine element accessors in a private extension:\n\n```swift\nprivate extension XCUIApplication {\n    var submitButton: XCUIElement {\n        buttons.element(matching: .button, identifier: \"submitButton\")\n    }\n\n    var cancelButton: XCUIElement {\n        buttons.element(matching: .button, identifier: \"cancelButton\")\n    }\n\n    var firstItem: XCUIElement {\n        buttons.element(matching: .button, identifier: \"itemButton\").firstMatch\n    }\n}\n```\n\n### Operation Verification Pattern\n\nAfter user interactions, verify operations were called:\n\n```swift\nfunc testDecrementButton() async throws {\n    let app = try presentView(configuration: .requireDevice())\n    app.decrementButton.tap()\n\n    let stubOps = try viewModelOperations()\n    XCTAssertTrue(stubOps.decrementCalled)\n    XCTAssertFalse(stubOps.incrementCalled)\n}\n```\n\n### Orientation Setup Pattern\n\nSet device orientation in `setUp()` if needed:\n\n```swift\noverride func setUp() async throws {\n    try await super.setUp()\n\n    #if os(iOS)\n    XCUIDevice.shared.orientation = .portrait\n    #endif\n}\n```\n\n## View Testing Checklist\n\n**All views:**\n- [ ] `.uiTestingIdentifier()` on all elements you want to test\n\n**Views WITH operations (interactive views):**\n- [ ] `@State private var repaintToggle = false` property\n- [ ] `.testDataTransporter(viewModelOps:repaintToggle:)` modifier\n- [ ] `toggleRepaint()` helper function\n- [ ] `toggleRepaint()` called after every operation invocation\n- [ ] `operations` stored from `viewModel.operations` in init\n\n**Views WITHOUT operations (display-only):**\n- [ ] No `repaintToggle` needed\n- [ ] No `.testDataTransporter()` needed\n- [ ] No `operations` property needed\n- [ ] `operations` stored from `viewModel.operations` in init\n\n## Common Test Patterns\n\n### Testing Async Operations\n\n```swift\nfunc testAsyncOperation() async throws {\n    let app = try presentView()\n    app.loadButton.tap()\n\n    \u002F\u002F Wait for UI to update\n    _ = app.waitForExistence(timeout: 3)\n\n    let stubOps = try viewModelOperations()\n    XCTAssertTrue(stubOps.loadCalled)\n}\n```\n\n### Testing Form Input\n\n```swift\nfunc testFormInput() async throws {\n    let app = try presentView()\n\n    let emailField = app.emailTextField\n    emailField.tap()\n    emailField.typeTextAndWait(\"user@example.com\")\n\n    app.submitButton.tap()\n\n    let stubOps = try viewModelOperations()\n    XCTAssertTrue(stubOps.submitCalled)\n}\n```\n\n### Testing Error States\n\n```swift\nfunc testErrorDisplay() async throws {\n    let app = try presentView(viewModel: .stub(hasError: true))\n\n    XCTAssertTrue(app.errorAlert.exists)\n    XCTAssertEqual(app.errorMessage.text, \"An error occurred\")\n}\n```\n\n## File Templates\n\nSee [reference.md](reference.md) for complete file templates.\n\n## Naming Conventions\n\n| Concept | Convention | Example |\n|---------|------------|---------|\n| Base test case | `{ProjectName}ViewModelViewTestCase` | `MyAppViewModelViewTestCase` |\n| UI test file | `{ViewName}UITests` | `TaskListViewUITests` |\n| Test method (UI state) | `test{Condition}` | `testButtonEnabled` |\n| Test method (operation) | `test{Action}` | `testSubmitButton` |\n| Element accessor | `{elementName}` | `submitButton`, `emailTextField` |\n| UI testing identifier | `{elementName}Identifier` or `{elementName}` | `\"submitButton\"`, `\"emailTextField\"` |\n\n## See Also\n\n- [Architecture Patterns](..\u002Fshared\u002Farchitecture-patterns.md) - Mental models and patterns\n- [FOSMVVMArchitecture.md](..\u002F..\u002Fdocs\u002FFOSMVVMArchitecture.md) - Full FOSMVVM architecture\n- [fosmvvm-viewmodel-generator](..\u002Ffosmvvm-viewmodel-generator\u002FSKILL.md) - For creating ViewModels\n- [fosmvvm-swiftui-app-setup](..\u002Ffosmvvm-swiftui-app-setup\u002FSKILL.md) - For app test host setup\n- [reference.md](reference.md) - Complete file templates\n\n## Version History\n\n| Version | Date | Changes |\n|---------|------|---------|\n| 1.0 | 2026-01-23 | Initial skill for UI tests |\n| 1.1 | 2026-01-24 | Update to context-aware approach (remove file-parsing\u002FQ&A). Skill references conversation context instead of asking questions or accepting file paths. |\n",{"name":5,"homepage":24,"metadata":25,"description":7},"https:\u002F\u002Fgithub.com\u002Ffoscomputerservices\u002FFOSUtilities",{"clawdbot":26},{"os":27,"emoji":29},[28],"darwin","🖥️","main","f9d3fe7cf9ac8f1ea63a0d96e98e1f510a3814db","skills\u002Ffoscomputerservices\u002Ffosmvvm-ui-tests-generator",1,"https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills","https:\u002F\u002Fgithub.com\u002Fjavimosch","intrane.fr","Building robust, open-source infrastructure for the commons. AI-leveraged, self-hosted, built to last.","2026-06-07 03:34:58",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add javimosch\u002Fopen-claw-skills --skill fosmvvm-ui-tests-generator",{"tool":45,"command":46},"bunx","bunx skills add javimosch\u002Fopen-claw-skills --skill fosmvvm-ui-tests-generator",{"tool":48,"command":49},"pnpm","pnpm dlx skills add javimosch\u002Fopen-claw-skills --skill fosmvvm-ui-tests-generator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Ffoscomputerservices\u002Ffosmvvm-ui-tests-generator\u002FSKILL.md",true,[],[54,62,69,76,83,90],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":61},"01M778GGXG2VQ0YF31W2MKGMQZ","crowd-prompting","A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzzadrian\u002Fcrowd-prompting\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":61},"01M778G7BH8SBJ9FJ6C3G7CB1K","ceaser","Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir\u002FUltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":61},"01M778FYCJQZWFKKX5FYMK3S47","ceaser-send","Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir\u002FUltraHonk zero-knowledge proofs.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser-send\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":61},"01M778FQQNSEYA3HJKZBPQ4M9Z","dilemm-ai","Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyori\u002Fdilemm-ai\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":61},"01M778FGVZX7QA2TF9BFMM37FY","moldium","Post and manage content on the Moldium blog platform. Triggered by \"post to Moldium\", \"write a blog post\", \"publish an article\", etc.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyom45\u002Fmoldium\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":61},"01M778F88D8PQ9MQ0KNW2TJ8ZH","arxiv-paper-reviews","Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date\u002Fcategory\u002Finterest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http:\u002F\u002Fweakaccept.top:8000\u002F.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Farxiv-paper-reviews\u002FSKILL.md",[],[]]