{
  "schemaVersion": "1.0",
  "item": {
    "slug": "swiftui-ui-patterns",
    "name": "Swiftui Ui Patterns",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/Dimillian/swiftui-ui-patterns",
    "canonicalUrl": "https://clawhub.ai/Dimillian/swiftui-ui-patterns",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/swiftui-ui-patterns",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=swiftui-ui-patterns",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "references/app-wiring.md",
      "references/components-index.md",
      "references/controls.md",
      "references/deeplinks.md",
      "references/focus.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/swiftui-ui-patterns"
    },
    "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/swiftui-ui-patterns",
    "agentPageUrl": "https://openagent3.xyz/skills/swiftui-ui-patterns/agent",
    "manifestUrl": "https://openagent3.xyz/skills/swiftui-ui-patterns/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/swiftui-ui-patterns/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": "Quick start",
        "body": "Choose a track based on your goal:"
      },
      {
        "title": "Existing project",
        "body": "Identify the feature or screen and the primary interaction model (list, detail, editor, settings, tabbed).\nFind a nearby example in the repo with rg \"TabView\\(\" or similar, then read the closest SwiftUI view.\nApply local conventions: prefer SwiftUI-native state, keep state local when possible, and use environment injection for shared dependencies.\nChoose the relevant component reference from references/components-index.md and follow its guidance.\nBuild the view with small, focused subviews and SwiftUI-native data flow."
      },
      {
        "title": "New project scaffolding",
        "body": "Start with references/app-scaffolding-wiring.md to wire TabView + NavigationStack + sheets.\nAdd a minimal AppTab and RouterPath based on the provided skeletons.\nChoose the next component reference based on the UI you need first (TabView, NavigationStack, Sheets).\nExpand the route and sheet enums as new screens are added."
      },
      {
        "title": "General rules to follow",
        "body": "Use modern SwiftUI state (@State, @Binding, @Observable, @Environment) and avoid unnecessary view models.\nPrefer composition; keep views small and focused.\nUse async/await with .task and explicit loading/error states.\nMaintain existing legacy patterns only when editing legacy files.\nFollow the project's formatter and style guide.\nSheets: Prefer .sheet(item:) over .sheet(isPresented:) when state represents a selected model. Avoid if let inside a sheet body. Sheets should own their actions and call dismiss() internally instead of forwarding onCancel/onConfirm closures."
      },
      {
        "title": "Workflow for a new SwiftUI view",
        "body": "Define the view's state and its ownership location.\nIdentify dependencies to inject via @Environment.\nSketch the view hierarchy and extract repeated parts into subviews.\nImplement async loading with .task and explicit state enum if needed.\nAdd accessibility labels or identifiers when the UI is interactive.\nValidate with a build and update usage callsites if needed."
      },
      {
        "title": "Component references",
        "body": "Use references/components-index.md as the entry point. Each component reference should include:\n\nIntent and best-fit scenarios.\nMinimal usage pattern with local conventions.\nPitfalls and performance notes.\nPaths to existing examples in the current repo."
      },
      {
        "title": "Item-driven sheet (preferred)",
        "body": "@State private var selectedItem: Item?\n\n.sheet(item: $selectedItem) { item in\n    EditItemSheet(item: item)\n}"
      },
      {
        "title": "Sheet owns its actions",
        "body": "struct EditItemSheet: View {\n    @Environment(\\.dismiss) private var dismiss\n    @Environment(Store.self) private var store\n\n    let item: Item\n    @State private var isSaving = false\n\n    var body: some View {\n        VStack {\n            Button(isSaving ? \"Saving…\" : \"Save\") {\n                Task { await save() }\n            }\n        }\n    }\n\n    private func save() async {\n        isSaving = true\n        await store.save(item)\n        dismiss()\n    }\n}"
      },
      {
        "title": "Adding a new component reference",
        "body": "Create references/<component>.md.\nKeep it short and actionable; link to concrete files in the current repo.\nUpdate references/components-index.md with the new entry."
      }
    ],
    "body": "SwiftUI UI Patterns\nQuick start\n\nChoose a track based on your goal:\n\nExisting project\nIdentify the feature or screen and the primary interaction model (list, detail, editor, settings, tabbed).\nFind a nearby example in the repo with rg \"TabView\\(\" or similar, then read the closest SwiftUI view.\nApply local conventions: prefer SwiftUI-native state, keep state local when possible, and use environment injection for shared dependencies.\nChoose the relevant component reference from references/components-index.md and follow its guidance.\nBuild the view with small, focused subviews and SwiftUI-native data flow.\nNew project scaffolding\nStart with references/app-scaffolding-wiring.md to wire TabView + NavigationStack + sheets.\nAdd a minimal AppTab and RouterPath based on the provided skeletons.\nChoose the next component reference based on the UI you need first (TabView, NavigationStack, Sheets).\nExpand the route and sheet enums as new screens are added.\nGeneral rules to follow\nUse modern SwiftUI state (@State, @Binding, @Observable, @Environment) and avoid unnecessary view models.\nPrefer composition; keep views small and focused.\nUse async/await with .task and explicit loading/error states.\nMaintain existing legacy patterns only when editing legacy files.\nFollow the project's formatter and style guide.\nSheets: Prefer .sheet(item:) over .sheet(isPresented:) when state represents a selected model. Avoid if let inside a sheet body. Sheets should own their actions and call dismiss() internally instead of forwarding onCancel/onConfirm closures.\nWorkflow for a new SwiftUI view\nDefine the view's state and its ownership location.\nIdentify dependencies to inject via @Environment.\nSketch the view hierarchy and extract repeated parts into subviews.\nImplement async loading with .task and explicit state enum if needed.\nAdd accessibility labels or identifiers when the UI is interactive.\nValidate with a build and update usage callsites if needed.\nComponent references\n\nUse references/components-index.md as the entry point. Each component reference should include:\n\nIntent and best-fit scenarios.\nMinimal usage pattern with local conventions.\nPitfalls and performance notes.\nPaths to existing examples in the current repo.\nSheet patterns\nItem-driven sheet (preferred)\n@State private var selectedItem: Item?\n\n.sheet(item: $selectedItem) { item in\n    EditItemSheet(item: item)\n}\n\nSheet owns its actions\nstruct EditItemSheet: View {\n    @Environment(\\.dismiss) private var dismiss\n    @Environment(Store.self) private var store\n\n    let item: Item\n    @State private var isSaving = false\n\n    var body: some View {\n        VStack {\n            Button(isSaving ? \"Saving…\" : \"Save\") {\n                Task { await save() }\n            }\n        }\n    }\n\n    private func save() async {\n        isSaving = true\n        await store.save(item)\n        dismiss()\n    }\n}\n\nAdding a new component reference\nCreate references/<component>.md.\nKeep it short and actionable; link to concrete files in the current repo.\nUpdate references/components-index.md with the new entry."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/Dimillian/swiftui-ui-patterns",
    "publisherUrl": "https://clawhub.ai/Dimillian/swiftui-ui-patterns",
    "owner": "Dimillian",
    "version": "1.0.2",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/swiftui-ui-patterns",
    "downloadUrl": "https://openagent3.xyz/downloads/swiftui-ui-patterns",
    "agentUrl": "https://openagent3.xyz/skills/swiftui-ui-patterns/agent",
    "manifestUrl": "https://openagent3.xyz/skills/swiftui-ui-patterns/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/swiftui-ui-patterns/agent.md"
  }
}