[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M720JZ50DGTR71PSSES1YKJA":3,"skill-same:01M720JZ50DGTR71PSSES1YKJA":64},{"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":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M720JZ50DGTR71PSSES1YKJA","swiftui-performance-audit",null,"SwiftUI performance: render, scroll, CPU\u002Fmemory, updates, layout, Instruments.","BramVR\u002Fmac-agent-scripts","BramVR","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F30230797?v=4","01M720C63442005A69G8VB2XS8","Bram Van Rompuy","01M720C63TQABCP40HMH3FCGFC",0,"MIT","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fswiftui-performance-audit\u002FSKILL.md",[],[],"2026-11-10 18:39:20",false,"---\nname: swiftui-performance-audit\ndescription: \"SwiftUI performance: render, scroll, CPU\u002Fmemory, updates, layout, Instruments.\"\n---\n\n# SwiftUI Performance Audit\n\n_Attribution: copied from @Dimillian’s `Dimillian\u002FSkills` (2025-12-31)._\n\n## Overview\n\nAudit SwiftUI view performance end-to-end, from instrumentation and baselining to root-cause analysis and concrete remediation steps.\n\n## Workflow Decision Tree\n\n- If the user provides code, start with \"Code-First Review.\"\n- If the user only describes symptoms, ask for minimal code\u002Fcontext, then do \"Code-First Review.\"\n- If code review is inconclusive, go to \"Guide the User to Profile\" and ask for a trace or screenshots.\n\n## 1. Code-First Review\n\nCollect:\n- Target view\u002Ffeature code.\n- Data flow: state, environment, observable models.\n- Symptoms and reproduction steps.\n\nFocus on:\n- View invalidation storms from broad state changes.\n- Unstable identity in lists (`id` churn, `UUID()` per render).\n- Heavy work in `body` (formatting, sorting, image decoding).\n- Layout thrash (deep stacks, `GeometryReader`, preference chains).\n- Large images without downsampling or resizing.\n- Over-animated hierarchies (implicit animations on large trees).\n\nProvide:\n- Likely root causes with code references.\n- Suggested fixes and refactors.\n- If needed, a minimal repro or instrumentation suggestion.\n\n## 2. Guide the User to Profile\n\nExplain how to collect data with Instruments:\n- Use the SwiftUI template in Instruments (Release build).\n- Reproduce the exact interaction (scroll, navigation, animation).\n- Capture SwiftUI timeline and Time Profiler.\n- Export or screenshot the relevant lanes and the call tree.\n\nAsk for:\n- Trace export or screenshots of SwiftUI lanes + Time Profiler call tree.\n- Device\u002FOS\u002Fbuild configuration.\n\n## 3. Analyze and Diagnose\n\nPrioritize likely SwiftUI culprits:\n- View invalidation storms from broad state changes.\n- Unstable identity in lists (`id` churn, `UUID()` per render).\n- Heavy work in `body` (formatting, sorting, image decoding).\n- Layout thrash (deep stacks, `GeometryReader`, preference chains).\n- Large images without downsampling or resizing.\n- Over-animated hierarchies (implicit animations on large trees).\n\nSummarize findings with evidence from traces\u002Flogs.\n\n## 4. Remediate\n\nApply targeted fixes:\n- Narrow state scope (`@State`\u002F`@Observable` closer to leaf views).\n- Stabilize identities for `ForEach` and lists.\n- Move heavy work out of `body` (precompute, cache, `@State`).\n- Use `equatable()` or value wrappers for expensive subtrees.\n- Downsample images before rendering.\n- Reduce layout complexity or use fixed sizing where possible.\n\n## Common Code Smells (and Fixes)\n\nLook for these patterns during code review.\n\n### Expensive formatters in `body`\n\n```swift\nvar body: some View {\n    let number = NumberFormatter() \u002F\u002F slow allocation\n    let measure = MeasurementFormatter() \u002F\u002F slow allocation\n    Text(measure.string(from: .init(value: meters, unit: .meters)))\n}\n```\n\nPrefer cached formatters in a model or a dedicated helper:\n\n```swift\nfinal class DistanceFormatter {\n    static let shared = DistanceFormatter()\n    let number = NumberFormatter()\n    let measure = MeasurementFormatter()\n}\n```\n\n### Computed properties that do heavy work\n\n```swift\nvar filtered: [Item] {\n    items.filter { $0.isEnabled } \u002F\u002F runs on every body eval\n}\n```\n\nPrefer precompute or cache on change:\n\n```swift\n@State private var filtered: [Item] = []\n\u002F\u002F update filtered when inputs change\n```\n\n### Sorting\u002Ffiltering in `body` or `ForEach`\n\n```swift\nList {\n    ForEach(items.sorted(by: sortRule)) { item in\n        Row(item)\n    }\n}\n```\n\nPrefer sort once before view updates:\n\n```swift\nlet sortedItems = items.sorted(by: sortRule)\n```\n\n### Inline filtering in `ForEach`\n\n```swift\nForEach(items.filter { $0.isEnabled }) { item in\n    Row(item)\n}\n```\n\nPrefer a prefiltered collection with stable identity.\n\n### Unstable identity\n\n```swift\nForEach(items, id: \\.self) { item in\n    Row(item)\n}\n```\n\nAvoid `id: \\.self` for non-stable values; use a stable ID.\n\n### Image decoding on the main thread\n\n```swift\nImage(uiImage: UIImage(data: data)!)\n```\n\nPrefer decode\u002Fdownsample off the main thread and store the result.\n\n### Broad dependencies in observable models\n\n```swift\n@Observable class Model {\n    var items: [Item] = []\n}\n\nvar body: some View {\n    Row(isFavorite: model.items.contains(item))\n}\n```\n\nPrefer granular view models or per-item state to reduce update fan-out.\n\n## 5. Verify\n\nAsk the user to re-run the same capture and compare with baseline metrics.\nSummarize the delta (CPU, frame drops, memory peak) if provided.\n\n## Outputs\n\nProvide:\n- A short metrics table (before\u002Fafter if available).\n- Top issues (ordered by impact).\n- Proposed fixes with estimated effort.\n\n## References\n\nAdd Apple documentation and WWDC resources under `references\u002F` as they are supplied by the user.\n- Optimizing SwiftUI performance with Instruments: `references\u002Foptimizing-swiftui-performance-instruments.md`\n- Understanding and improving SwiftUI performance: `references\u002Funderstanding-improving-swiftui-performance.md`\n- Understanding hangs in your app: `references\u002Funderstanding-hangs-in-your-app.md`\n- Demystify SwiftUI performance (WWDC23): `references\u002Fdemystify-swiftui-performance-wwdc23.md`\n","# SwiftUI Performance Audit\n\n_Attribution: copied from @Dimillian’s `Dimillian\u002FSkills` (2025-12-31)._\n\n## Overview\n\nAudit SwiftUI view performance end-to-end, from instrumentation and baselining to root-cause analysis and concrete remediation steps.\n\n## Workflow Decision Tree\n\n- If the user provides code, start with \"Code-First Review.\"\n- If the user only describes symptoms, ask for minimal code\u002Fcontext, then do \"Code-First Review.\"\n- If code review is inconclusive, go to \"Guide the User to Profile\" and ask for a trace or screenshots.\n\n## 1. Code-First Review\n\nCollect:\n- Target view\u002Ffeature code.\n- Data flow: state, environment, observable models.\n- Symptoms and reproduction steps.\n\nFocus on:\n- View invalidation storms from broad state changes.\n- Unstable identity in lists (`id` churn, `UUID()` per render).\n- Heavy work in `body` (formatting, sorting, image decoding).\n- Layout thrash (deep stacks, `GeometryReader`, preference chains).\n- Large images without downsampling or resizing.\n- Over-animated hierarchies (implicit animations on large trees).\n\nProvide:\n- Likely root causes with code references.\n- Suggested fixes and refactors.\n- If needed, a minimal repro or instrumentation suggestion.\n\n## 2. Guide the User to Profile\n\nExplain how to collect data with Instruments:\n- Use the SwiftUI template in Instruments (Release build).\n- Reproduce the exact interaction (scroll, navigation, animation).\n- Capture SwiftUI timeline and Time Profiler.\n- Export or screenshot the relevant lanes and the call tree.\n\nAsk for:\n- Trace export or screenshots of SwiftUI lanes + Time Profiler call tree.\n- Device\u002FOS\u002Fbuild configuration.\n\n## 3. Analyze and Diagnose\n\nPrioritize likely SwiftUI culprits:\n- View invalidation storms from broad state changes.\n- Unstable identity in lists (`id` churn, `UUID()` per render).\n- Heavy work in `body` (formatting, sorting, image decoding).\n- Layout thrash (deep stacks, `GeometryReader`, preference chains).\n- Large images without downsampling or resizing.\n- Over-animated hierarchies (implicit animations on large trees).\n\nSummarize findings with evidence from traces\u002Flogs.\n\n## 4. Remediate\n\nApply targeted fixes:\n- Narrow state scope (`@State`\u002F`@Observable` closer to leaf views).\n- Stabilize identities for `ForEach` and lists.\n- Move heavy work out of `body` (precompute, cache, `@State`).\n- Use `equatable()` or value wrappers for expensive subtrees.\n- Downsample images before rendering.\n- Reduce layout complexity or use fixed sizing where possible.\n\n## Common Code Smells (and Fixes)\n\nLook for these patterns during code review.\n\n### Expensive formatters in `body`\n\n```swift\nvar body: some View {\n    let number = NumberFormatter() \u002F\u002F slow allocation\n    let measure = MeasurementFormatter() \u002F\u002F slow allocation\n    Text(measure.string(from: .init(value: meters, unit: .meters)))\n}\n```\n\nPrefer cached formatters in a model or a dedicated helper:\n\n```swift\nfinal class DistanceFormatter {\n    static let shared = DistanceFormatter()\n    let number = NumberFormatter()\n    let measure = MeasurementFormatter()\n}\n```\n\n### Computed properties that do heavy work\n\n```swift\nvar filtered: [Item] {\n    items.filter { $0.isEnabled } \u002F\u002F runs on every body eval\n}\n```\n\nPrefer precompute or cache on change:\n\n```swift\n@State private var filtered: [Item] = []\n\u002F\u002F update filtered when inputs change\n```\n\n### Sorting\u002Ffiltering in `body` or `ForEach`\n\n```swift\nList {\n    ForEach(items.sorted(by: sortRule)) { item in\n        Row(item)\n    }\n}\n```\n\nPrefer sort once before view updates:\n\n```swift\nlet sortedItems = items.sorted(by: sortRule)\n```\n\n### Inline filtering in `ForEach`\n\n```swift\nForEach(items.filter { $0.isEnabled }) { item in\n    Row(item)\n}\n```\n\nPrefer a prefiltered collection with stable identity.\n\n### Unstable identity\n\n```swift\nForEach(items, id: \\.self) { item in\n    Row(item)\n}\n```\n\nAvoid `id: \\.self` for non-stable values; use a stable ID.\n\n### Image decoding on the main thread\n\n```swift\nImage(uiImage: UIImage(data: data)!)\n```\n\nPrefer decode\u002Fdownsample off the main thread and store the result.\n\n### Broad dependencies in observable models\n\n```swift\n@Observable class Model {\n    var items: [Item] = []\n}\n\nvar body: some View {\n    Row(isFavorite: model.items.contains(item))\n}\n```\n\nPrefer granular view models or per-item state to reduce update fan-out.\n\n## 5. Verify\n\nAsk the user to re-run the same capture and compare with baseline metrics.\nSummarize the delta (CPU, frame drops, memory peak) if provided.\n\n## Outputs\n\nProvide:\n- A short metrics table (before\u002Fafter if available).\n- Top issues (ordered by impact).\n- Proposed fixes with estimated effort.\n\n## References\n\nAdd Apple documentation and WWDC resources under `references\u002F` as they are supplied by the user.\n- Optimizing SwiftUI performance with Instruments: `references\u002Foptimizing-swiftui-performance-instruments.md`\n- Understanding and improving SwiftUI performance: `references\u002Funderstanding-improving-swiftui-performance.md`\n- Understanding hangs in your app: `references\u002Funderstanding-hangs-in-your-app.md`\n- Demystify SwiftUI performance (WWDC23): `references\u002Fdemystify-swiftui-performance-wwdc23.md`\n",{"name":5,"description":7},"main","9943359ac3d8fc05cc503d1b1ce23281450400fe","skills\u002Fswiftui-performance-audit","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts","https:\u002F\u002Fgithub.com\u002FBramVR","https:\u002F\u002Fbramvanrompuy.be","Senior AI & Python engineer turning fragile AI prototypes into reliable production systems. Freelance · Belgium · EU\u002Fremote.","2026-11-10 22:43:17",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add BramVR\u002Fmac-agent-scripts --skill swiftui-performance-audit",{"tool":38,"command":39},"bunx","bunx skills add BramVR\u002Fmac-agent-scripts --skill swiftui-performance-audit",{"tool":41,"command":42},"pnpm","pnpm dlx skills add BramVR\u002Fmac-agent-scripts --skill swiftui-performance-audit","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fswiftui-performance-audit\u002FSKILL.md",true,[46,52,56,60],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fdemystify-swiftui-performance-wwdc23.md","REFERENCE","参考文档",1813,"https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fswiftui-performance-audit\u002Freferences\u002Fdemystify-swiftui-performance-wwdc23.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Foptimizing-swiftui-performance-instruments.md",1837,"https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fswiftui-performance-audit\u002Freferences\u002Foptimizing-swiftui-performance-instruments.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Funderstanding-hangs-in-your-app.md",1267,"https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fswiftui-performance-audit\u002Freferences\u002Funderstanding-hangs-in-your-app.md",{"path":61,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Funderstanding-improving-swiftui-performance.md",2262,"https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fswiftui-performance-audit\u002Freferences\u002Funderstanding-improving-swiftui-performance.md",[65,72,79,86,93,101],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M720KXN6XE37GD67K403G7M3","youtube-to-vault","YouTube video into a vault Source note: transcript, claim extraction, verified quotes, Markdown.","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-to-vault\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M720KVSRQ8KRV7AZXCEWEDJQ","xurl","xurl X API CLI: install, auth, app choice, shortcuts, raw endpoints.","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M720KRRGENBWNTDV7PYSZNNB","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\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fwhy\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M720KPRZ4YY1F3R4HB21W4K0","whatsapp","WhatsApp router: history\u002Fsearch\u002Fread\u002Fsend decisions; wacrawl read, wacli live.","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fwhatsapp\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":97,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M720KN646WP0JRXTR6HDX9T0","what-did-i-get-done","Summarize authored commits over a user-specified time period into a concise update. Use for \"what did I get done\", \"summarize my week\", or a standup update.","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fwhat-did-i-get-done\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fwhat-did-i-get-done\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M720KK4495758N0EFWDF1W7A","wacli","WhatsApp linked-device CLI: auth, sync, search, send, live state.","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fwacli\u002FSKILL.md",[],[]]