[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79F5ASFY6AZR4XY3T22A3G2":3,"skill-same:01M79F5ASFY6AZR4XY3T22A3G2":55},{"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":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M79F5ASFY6AZR4XY3T22A3G2","swiftui-view-refactor",null,"Refactor and review SwiftUI view files for consistent structure, dependency injection, and Observation usage. Use when asked to clean up a SwiftUI view’s layout\u002Fordering, handle view models safely (non-optional when possible), or standardize how dependencies and @Observable state are initialized and passed.","BumpyClock\u002Fagent-templates","BumpyClock","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1883824?v=4","01M79EW0FDP9MFXH1FKH800S7T","Aditya Sharma","01M79EW0G27TTKZWTFQ8W5HVB4",2,"MIT","https:\u002F\u002Fgithub.com\u002FBumpyClock\u002Fagent-templates\u002Fblob\u002Fmain\u002Fskills_archive\u002Fapple-platform-skills\u002Fswiftui-view-refactor\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: swiftui-view-refactor\ndescription: Refactor and review SwiftUI view files for consistent structure, dependency injection, and Observation usage. Use when asked to clean up a SwiftUI view’s layout\u002Fordering, handle view models safely (non-optional when possible), or standardize how dependencies and @Observable state are initialized and passed.\n---\n\n# SwiftUI View Refactor\n\n_Attribution: copied from @Dimillian’s `Dimillian\u002FSkills` (2025-12-31)._\n\n## Overview\nApply a consistent structure and dependency pattern to SwiftUI views, with a focus on ordering, Model-View (MV) patterns, careful view model handling, and correct Observation usage.\n\n## Core Guidelines\n\n### 1) View ordering (top → bottom)\n- Environment\n- `private`\u002F`public` `let`\n- `@State` \u002F other stored properties\n- computed `var` (non-view)\n- `init`\n- `body`\n- computed view builders \u002F other view helpers\n- helper \u002F async functions\n\n### 2) Prefer MV (Model-View) patterns\n- Default to MV: Views are lightweight state expressions; models\u002Fservices own business logic.\n- Favor `@State`, `@Environment`, `@Query`, and `task`\u002F`onChange` for orchestration.\n- Inject services and shared models via `@Environment`; keep views small and composable.\n- Split large views into subviews rather than introducing a view model.\n\n### 3) Split large bodies and view properties\n- If `body` grows beyond a screen or has multiple logical sections, split it into smaller subviews.\n- Extract large computed view properties (`var header: some View { ... }`) into dedicated `View` types when they carry state or complex branching.\n- It's fine to keep related subviews as computed view properties in the same file; extract to a standalone `View` struct only when it structurally makes sense or when reuse is intended.\n- Prefer passing small inputs (data, bindings, callbacks) over reusing the entire parent view state.\n\nExample (extracting a section):\n\n```swift\nvar body: some View {\n    VStack(alignment: .leading, spacing: 16) {\n        HeaderSection(title: title, isPinned: isPinned)\n        DetailsSection(details: details)\n        ActionsSection(onSave: onSave, onCancel: onCancel)\n    }\n}\n```\n\nExample (long body → shorter body + computed views in the same file):\n\n```swift\nvar body: some View {\n    List {\n        header\n        filters\n        results\n        footer\n    }\n}\n\nprivate var header: some View {\n    VStack(alignment: .leading, spacing: 6) {\n        Text(title).font(.title2)\n        Text(subtitle).font(.subheadline)\n    }\n}\n\nprivate var filters: some View {\n    ScrollView(.horizontal, showsIndicators: false) {\n        HStack {\n            ForEach(filterOptions, id: \\.self) { option in\n                FilterChip(option: option, isSelected: option == selectedFilter)\n                    .onTapGesture { selectedFilter = option }\n            }\n        }\n    }\n}\n```\n\nExample (extracting a complex computed view):\n\n```swift\nprivate var header: some View {\n    HeaderSection(title: title, subtitle: subtitle, status: status)\n}\n\nprivate struct HeaderSection: View {\n    let title: String\n    let subtitle: String?\n    let status: Status\n\n    var body: some View {\n        VStack(alignment: .leading, spacing: 4) {\n            Text(title).font(.headline)\n            if let subtitle { Text(subtitle).font(.subheadline) }\n            StatusBadge(status: status)\n        }\n    }\n}\n```\n\n### 4) View model handling (only if already present)\n- Do not introduce a view model unless the request or existing code clearly calls for one.\n- If a view model exists, make it non-optional when possible.\n- Pass dependencies to the view via `init`, then pass them into the view model in the view's `init`.\n- Avoid `bootstrapIfNeeded` patterns.\n\nExample (Observation-based):\n\n```swift\n@State private var viewModel: SomeViewModel\n\ninit(dependency: Dependency) {\n    _viewModel = State(initialValue: SomeViewModel(dependency: dependency))\n}\n```\n\n### 5) Observation usage\n- For `@Observable` reference types, store them as `@State` in the root view.\n- Pass observables down explicitly as needed; avoid optional state unless required.\n\n## Workflow\n\n1) Reorder the view to match the ordering rules.\n2) Favor MV: move lightweight orchestration into the view using `@State`, `@Environment`, `@Query`, `task`, and `onChange`.\n3) If a view model exists, replace optional view models with a non-optional `@State` view model initialized in `init` by passing dependencies from the view.\n4) Confirm Observation usage: `@State` for root `@Observable` view models, no redundant wrappers.\n5) Keep behavior intact: do not change layout or business logic unless requested.\n\n## Notes\n\n- Prefer small, explicit helpers over large conditional blocks.\n- Keep computed view builders below `body` and non-view computed vars above `init`.\n- For MV-first guidance and rationale, see `references\u002Fmv-patterns.md`.\n","# SwiftUI View Refactor\n\n_Attribution: copied from @Dimillian’s `Dimillian\u002FSkills` (2025-12-31)._\n\n## Overview\nApply a consistent structure and dependency pattern to SwiftUI views, with a focus on ordering, Model-View (MV) patterns, careful view model handling, and correct Observation usage.\n\n## Core Guidelines\n\n### 1) View ordering (top → bottom)\n- Environment\n- `private`\u002F`public` `let`\n- `@State` \u002F other stored properties\n- computed `var` (non-view)\n- `init`\n- `body`\n- computed view builders \u002F other view helpers\n- helper \u002F async functions\n\n### 2) Prefer MV (Model-View) patterns\n- Default to MV: Views are lightweight state expressions; models\u002Fservices own business logic.\n- Favor `@State`, `@Environment`, `@Query`, and `task`\u002F`onChange` for orchestration.\n- Inject services and shared models via `@Environment`; keep views small and composable.\n- Split large views into subviews rather than introducing a view model.\n\n### 3) Split large bodies and view properties\n- If `body` grows beyond a screen or has multiple logical sections, split it into smaller subviews.\n- Extract large computed view properties (`var header: some View { ... }`) into dedicated `View` types when they carry state or complex branching.\n- It's fine to keep related subviews as computed view properties in the same file; extract to a standalone `View` struct only when it structurally makes sense or when reuse is intended.\n- Prefer passing small inputs (data, bindings, callbacks) over reusing the entire parent view state.\n\nExample (extracting a section):\n\n```swift\nvar body: some View {\n    VStack(alignment: .leading, spacing: 16) {\n        HeaderSection(title: title, isPinned: isPinned)\n        DetailsSection(details: details)\n        ActionsSection(onSave: onSave, onCancel: onCancel)\n    }\n}\n```\n\nExample (long body → shorter body + computed views in the same file):\n\n```swift\nvar body: some View {\n    List {\n        header\n        filters\n        results\n        footer\n    }\n}\n\nprivate var header: some View {\n    VStack(alignment: .leading, spacing: 6) {\n        Text(title).font(.title2)\n        Text(subtitle).font(.subheadline)\n    }\n}\n\nprivate var filters: some View {\n    ScrollView(.horizontal, showsIndicators: false) {\n        HStack {\n            ForEach(filterOptions, id: \\.self) { option in\n                FilterChip(option: option, isSelected: option == selectedFilter)\n                    .onTapGesture { selectedFilter = option }\n            }\n        }\n    }\n}\n```\n\nExample (extracting a complex computed view):\n\n```swift\nprivate var header: some View {\n    HeaderSection(title: title, subtitle: subtitle, status: status)\n}\n\nprivate struct HeaderSection: View {\n    let title: String\n    let subtitle: String?\n    let status: Status\n\n    var body: some View {\n        VStack(alignment: .leading, spacing: 4) {\n            Text(title).font(.headline)\n            if let subtitle { Text(subtitle).font(.subheadline) }\n            StatusBadge(status: status)\n        }\n    }\n}\n```\n\n### 4) View model handling (only if already present)\n- Do not introduce a view model unless the request or existing code clearly calls for one.\n- If a view model exists, make it non-optional when possible.\n- Pass dependencies to the view via `init`, then pass them into the view model in the view's `init`.\n- Avoid `bootstrapIfNeeded` patterns.\n\nExample (Observation-based):\n\n```swift\n@State private var viewModel: SomeViewModel\n\ninit(dependency: Dependency) {\n    _viewModel = State(initialValue: SomeViewModel(dependency: dependency))\n}\n```\n\n### 5) Observation usage\n- For `@Observable` reference types, store them as `@State` in the root view.\n- Pass observables down explicitly as needed; avoid optional state unless required.\n\n## Workflow\n\n1) Reorder the view to match the ordering rules.\n2) Favor MV: move lightweight orchestration into the view using `@State`, `@Environment`, `@Query`, `task`, and `onChange`.\n3) If a view model exists, replace optional view models with a non-optional `@State` view model initialized in `init` by passing dependencies from the view.\n4) Confirm Observation usage: `@State` for root `@Observable` view models, no redundant wrappers.\n5) Keep behavior intact: do not change layout or business logic unless requested.\n\n## Notes\n\n- Prefer small, explicit helpers over large conditional blocks.\n- Keep computed view builders below `body` and non-view computed vars above `init`.\n- For MV-first guidance and rationale, see `references\u002Fmv-patterns.md`.\n",{"name":5,"description":7},"main","e24b64bdac040ad169ed16b14853eff1b20cd726","skills_archive\u002Fapple-platform-skills\u002Fswiftui-view-refactor",0,"https:\u002F\u002Fgithub.com\u002FBumpyClock\u002Fagent-templates","https:\u002F\u002Fgithub.com\u002FBumpyClock","2026-11-14 03:12:06",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add BumpyClock\u002Fagent-templates --skill swiftui-view-refactor",{"tool":37,"command":38},"bunx","bunx skills add BumpyClock\u002Fagent-templates --skill swiftui-view-refactor",{"tool":40,"command":41},"pnpm","pnpm dlx skills add BumpyClock\u002Fagent-templates --skill swiftui-view-refactor","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FBumpyClock\u002Fagent-templates\u002Fblob\u002Fmain\u002Fskills_archive\u002Fapple-platform-skills\u002Fswiftui-view-refactor\u002FSKILL.md",true,[45,51],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"agents\u002Fopenai.yaml","REFERENCE","参考文档",201,"https:\u002F\u002Fgithub.com\u002FBumpyClock\u002Fagent-templates\u002Fblob\u002Fmain\u002Fskills_archive\u002Fapple-platform-skills\u002Fswiftui-view-refactor\u002Fagents\u002Fopenai.yaml",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002Fmv-patterns.md",7961,"https:\u002F\u002Fgithub.com\u002FBumpyClock\u002Fagent-templates\u002Fblob\u002Fmain\u002Fskills_archive\u002Fapple-platform-skills\u002Fswiftui-view-refactor\u002Freferences\u002Fmv-patterns.md",[56,63,70,77,84,91],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M79FEE6E257MWVEBY43X0NVN","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002FBumpyClock\u002Fagent-templates\u002Fblob\u002Fmain\u002Fskills_archive\u002Fwriting-plans\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M79FEB8GTJC6ZHDK67T40R20","workflow-from-chats","Extract preferences from agent chats → skills, rules, workflow docs. For learning preferences, mining feedback, personalizing workflows.","https:\u002F\u002Fgithub.com\u002FBumpyClock\u002Fagent-templates\u002Fblob\u002Fmain\u002Fskills_archive\u002Fworkflow-from-chats\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M79FE7TMNGVZZ0M8NV4N0X6N","winui3-csharp-app","WinUI 3 \u002F Windows App SDK desktop apps in C#\u002FXAML. MVVM, bindings, navigation, Mica\u002FAcrylic, windowing, packaging, performance.","https:\u002F\u002Fgithub.com\u002FBumpyClock\u002Fagent-templates\u002Fblob\u002Fmain\u002Fskills_archive\u002Fwinui3-csharp-app\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M79FE31HY46BHN67CQGB7MVJ","why","Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.","https:\u002F\u002Fgithub.com\u002FBumpyClock\u002Fagent-templates\u002Fblob\u002Fmain\u002Fskills_archive\u002Fwhy\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M79FE0N7MGWDG8SCD60FWTV5","what-did-i-get-done","Summarize authored commits over a user-specified time period into a concise status update.","https:\u002F\u002Fgithub.com\u002FBumpyClock\u002Fagent-templates\u002Fblob\u002Fmain\u002Fskills_archive\u002Fwhat-did-i-get-done\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M79FDYBJG9QNCQC0MMVBDT80","weekly-review","Produce a short weekly synthesis of authored commits with highlights by bugfix, tech debt, and net-new work.","https:\u002F\u002Fgithub.com\u002FBumpyClock\u002Fagent-templates\u002Fblob\u002Fmain\u002Fskills_archive\u002Fweekly-review\u002FSKILL.md",[],[]]