[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74XQ3GR2F9FT63GYSGKN2TP":3,"skill-same:01M74XQ3GR2F9FT63GYSGKN2TP":43},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":28,"install":29,"resources":42},"01M74XQ3GR2F9FT63GYSGKN2TP","swiftui-sheet-in-sheet-uikit-present-bridge",null,"UIActivityViewController (or any other UIKit present-based flow like UIDocumentPickerViewController) presented via .sheet(item:) from a SwiftUI view that is itself already presented as a sheet flashes on screen and self-dismisses within a single frame with zero user interaction — confirmed by a user who \"didn't tap anything.\" The same bug class hits UIImagePickerController (camera picker), QLPreviewController (QuickLook preview) and MFMailComposeViewController (mail composer): the flow flashes and dismisses its PARENT sheet, or never appears. Use when triggering a system share sheet, document picker, or any UIKit present(_:animated:) flow from a screen that can itself be presented as a sheet (a very common architecture: Settings-as-sheet, detail-as-sheet).","abhijitbansal\u002Fclaude-skills","abhijitbansal","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F271802621?v=4","01M74XA5M33XYNJ2D2TJDS7W9E","01M74XA5MQ8GMWJW10ZJ4V0NVG",1,"MIT","https:\u002F\u002Fgithub.com\u002Fabhijitbansal\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fios-dev\u002Fskills\u002Fswiftui-sheet-in-sheet-uikit-present-bridge\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: swiftui-sheet-in-sheet-uikit-present-bridge\ndescription: \"UIActivityViewController (or any other UIKit present-based flow like UIDocumentPickerViewController) presented via .sheet(item:) from a SwiftUI view that is itself already presented as a sheet flashes on screen and self-dismisses within a single frame with zero user interaction — confirmed by a user who \\\"didn't tap anything.\\\" The same bug class hits UIImagePickerController (camera picker), QLPreviewController (QuickLook preview) and MFMailComposeViewController (mail composer): the flow flashes and dismisses its PARENT sheet, or never appears. Use when triggering a system share sheet, document picker, or any UIKit present(_:animated:) flow from a screen that can itself be presented as a sheet (a very common architecture: Settings-as-sheet, detail-as-sheet).\"\n---\n\n# SwiftUI Sheet-in-Sheet: UIKit Present Flashes and Self-Dismisses\n\n## Symptom\n\nExport (CSV\u002FJSON), label printing, and share flows all trigger\n`UIActivityViewController` via a SwiftUI `.sheet(item:)` binding from a view\nthat is itself already presented as a sheet (Settings, a tag-editor sheet, a\nlink-existing-item sheet). The share sheet **flashes and tears itself down\nwithin a single frame, with zero user interaction** — confirmed by the user\n(\"I didn't tap anything\"). The bug only reveals itself by tracing the actual\nruntime presentation hierarchy (which root view presents which screen as a\nsheet), not from reading the call site in isolation.\n\n## Root cause\n\nSwiftUI's `.sheet(item:)` driving a UIKit-hosted `UIActivityViewController`\nfrom a **second, nested** sheet layer is fundamentally unreliable — SwiftUI's\nown sheet-presentation state machine fights the second nested presentation.\nThe moment the presenting view is already inside one `.sheet`, adding another\n`.sheet(item:)` on top of it for a UIKit-bridged controller (rather than a\npure-SwiftUI view) races against SwiftUI's internal bookkeeping for the first\nsheet, and the second presentation tears itself down before the user can\ninteract with it.\n\n## Fix\n\nReplace the `.sheet(item:)`-driven share flow with an **imperative present**:\nwalk `UIApplication.shared.connectedScenes` → key window → follow\n`.presentedViewController` to the actual top-most UIKit view controller, and\ncall `present(_:animated:)` on it directly, with iPad popover-source\nanchoring handled explicitly. This sidesteps SwiftUI's declarative sheet\nstack entirely for the share sheet \u002F document picker and every other\nUIKit-presented system flow (see Generalization) that needs guaranteed\ntop-of-hierarchy presentation regardless of how many SwiftUI sheets are\nalready stacked:\n\n```swift\nenum ActivitySharePresenter {\n    static func present(items: [Any], sourceView: UIView? = nil) {\n        guard let windowScene = UIApplication.shared.connectedScenes\n                .first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene,\n              let keyWindow = windowScene.windows.first(where: { $0.isKeyWindow }),\n              var topController = keyWindow.rootViewController\n        else { return }\n\n        \u002F\u002F Walk to the actual top-most presented controller, however deep.\n        while let presented = topController.presentedViewController {\n            topController = presented\n        }\n\n        let activityVC = UIActivityViewController(activityItems: items, applicationActivities: nil)\n        if let popover = activityVC.popoverPresentationController {\n            popover.sourceView = sourceView ?? topController.view\n            popover.sourceRect = sourceView?.bounds ?? CGRect(x: topController.view.bounds.midX,\n                                                                y: topController.view.bounds.midY,\n                                                                width: 0, height: 0)\n        }\n        topController.present(activityVC, animated: true)\n    }\n}\n\n\u002F\u002F Call site — no .sheet(item:) binding needed:\nButton(\"Export\") {\n    ActivitySharePresenter.present(items: [csvURL])\n}\n```\n\n## Evidence\n\nSession 0017: \"The nested sheet flashed and tore itself down within a frame —\nzero user interaction... Fixed by replacing `ShareableFile`\u002F\n`ActivityShareSheet` (`.sheet(item:)`-driven) with\n`ActivitySharePresenter.present(items:)` — an imperative present on the\nactual top-most UIKit view controller, walking\n`UIApplication.shared.connectedScenes` → key window →\n`.presentedViewController` chain, with iPad popover anchoring. 4 call sites\nmigrated.\" Root cause confirmed by tracing the actual runtime presentation\nhierarchy (`RootTabView.swift:42` presents Settings as a sheet), not from the\ncall site in isolation.\n\n## Generalization\n\nThis is a CLASS of bug, not a share-sheet quirk. Four recurrences in one app\n(each initially treated as a new bug): share sheet, QuickLook, camera, mail\ncomposer. The camera case showed as a flash followed by the parent sheet being\ndismissed; an earlier incomplete fix had only removed an imperative dismiss call\nand left the underlying declarative race.\n\n**Rule:** ANY UIKit `present(_:animated:)`-based system flow launched from a\nSwiftUI view that is — or can ever be — inside a `.sheet`\u002F`.fullScreenCover`\nmust go through an imperative top-most-view-controller presenter (walk\nconnectedScenes → key window → `.presentedViewController` chain, as in\n`ActivitySharePresenter` above). Never drive it with a nested `.sheet(item:)`,\n`.fullScreenCover`, or a `UIViewControllerRepresentable` mounted inside the\nsecond sheet layer — SwiftUI's sheet state machine races the nested\npresentation and tears down one side.\n\n**Review heuristic:** when a diff adds a `UIViewControllerRepresentable` or a\n`.sheet`-presented UIKit controller, ask \"can the presenting view itself be a\nsheet anywhere in the app?\" — if yes, flag it; the bug only reproduces from the\nnested context, so the call site looks innocent in isolation and unit tests\ncan't see it.\n\n## Related skills\n\n- `navigationsplitview-single-stack-per-detail-column` and\n  `realityview-fullscreencover-black-defer-mount` are unrelated root causes\n  but share the same debugging shape: a SwiftUI presentation\u002Frender bug that\n  only reveals itself by tracing the actual runtime hierarchy, not by reading\n  the call site in isolation.\n","# SwiftUI Sheet-in-Sheet: UIKit Present Flashes and Self-Dismisses\n\n## Symptom\n\nExport (CSV\u002FJSON), label printing, and share flows all trigger\n`UIActivityViewController` via a SwiftUI `.sheet(item:)` binding from a view\nthat is itself already presented as a sheet (Settings, a tag-editor sheet, a\nlink-existing-item sheet). The share sheet **flashes and tears itself down\nwithin a single frame, with zero user interaction** — confirmed by the user\n(\"I didn't tap anything\"). The bug only reveals itself by tracing the actual\nruntime presentation hierarchy (which root view presents which screen as a\nsheet), not from reading the call site in isolation.\n\n## Root cause\n\nSwiftUI's `.sheet(item:)` driving a UIKit-hosted `UIActivityViewController`\nfrom a **second, nested** sheet layer is fundamentally unreliable — SwiftUI's\nown sheet-presentation state machine fights the second nested presentation.\nThe moment the presenting view is already inside one `.sheet`, adding another\n`.sheet(item:)` on top of it for a UIKit-bridged controller (rather than a\npure-SwiftUI view) races against SwiftUI's internal bookkeeping for the first\nsheet, and the second presentation tears itself down before the user can\ninteract with it.\n\n## Fix\n\nReplace the `.sheet(item:)`-driven share flow with an **imperative present**:\nwalk `UIApplication.shared.connectedScenes` → key window → follow\n`.presentedViewController` to the actual top-most UIKit view controller, and\ncall `present(_:animated:)` on it directly, with iPad popover-source\nanchoring handled explicitly. This sidesteps SwiftUI's declarative sheet\nstack entirely for the share sheet \u002F document picker and every other\nUIKit-presented system flow (see Generalization) that needs guaranteed\ntop-of-hierarchy presentation regardless of how many SwiftUI sheets are\nalready stacked:\n\n```swift\nenum ActivitySharePresenter {\n    static func present(items: [Any], sourceView: UIView? = nil) {\n        guard let windowScene = UIApplication.shared.connectedScenes\n                .first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene,\n              let keyWindow = windowScene.windows.first(where: { $0.isKeyWindow }),\n              var topController = keyWindow.rootViewController\n        else { return }\n\n        \u002F\u002F Walk to the actual top-most presented controller, however deep.\n        while let presented = topController.presentedViewController {\n            topController = presented\n        }\n\n        let activityVC = UIActivityViewController(activityItems: items, applicationActivities: nil)\n        if let popover = activityVC.popoverPresentationController {\n            popover.sourceView = sourceView ?? topController.view\n            popover.sourceRect = sourceView?.bounds ?? CGRect(x: topController.view.bounds.midX,\n                                                                y: topController.view.bounds.midY,\n                                                                width: 0, height: 0)\n        }\n        topController.present(activityVC, animated: true)\n    }\n}\n\n\u002F\u002F Call site — no .sheet(item:) binding needed:\nButton(\"Export\") {\n    ActivitySharePresenter.present(items: [csvURL])\n}\n```\n\n## Evidence\n\nSession 0017: \"The nested sheet flashed and tore itself down within a frame —\nzero user interaction... Fixed by replacing `ShareableFile`\u002F\n`ActivityShareSheet` (`.sheet(item:)`-driven) with\n`ActivitySharePresenter.present(items:)` — an imperative present on the\nactual top-most UIKit view controller, walking\n`UIApplication.shared.connectedScenes` → key window →\n`.presentedViewController` chain, with iPad popover anchoring. 4 call sites\nmigrated.\" Root cause confirmed by tracing the actual runtime presentation\nhierarchy (`RootTabView.swift:42` presents Settings as a sheet), not from the\ncall site in isolation.\n\n## Generalization\n\nThis is a CLASS of bug, not a share-sheet quirk. Four recurrences in one app\n(each initially treated as a new bug): share sheet, QuickLook, camera, mail\ncomposer. The camera case showed as a flash followed by the parent sheet being\ndismissed; an earlier incomplete fix had only removed an imperative dismiss call\nand left the underlying declarative race.\n\n**Rule:** ANY UIKit `present(_:animated:)`-based system flow launched from a\nSwiftUI view that is — or can ever be — inside a `.sheet`\u002F`.fullScreenCover`\nmust go through an imperative top-most-view-controller presenter (walk\nconnectedScenes → key window → `.presentedViewController` chain, as in\n`ActivitySharePresenter` above). Never drive it with a nested `.sheet(item:)`,\n`.fullScreenCover`, or a `UIViewControllerRepresentable` mounted inside the\nsecond sheet layer — SwiftUI's sheet state machine races the nested\npresentation and tears down one side.\n\n**Review heuristic:** when a diff adds a `UIViewControllerRepresentable` or a\n`.sheet`-presented UIKit controller, ask \"can the presenting view itself be a\nsheet anywhere in the app?\" — if yes, flag it; the bug only reproduces from the\nnested context, so the call site looks innocent in isolation and unit tests\ncan't see it.\n\n## Related skills\n\n- `navigationsplitview-single-stack-per-detail-column` and\n  `realityview-fullscreencover-black-defer-mount` are unrelated root causes\n  but share the same debugging shape: a SwiftUI presentation\u002Frender bug that\n  only reveals itself by tracing the actual runtime hierarchy, not by reading\n  the call site in isolation.\n",{"name":5,"description":7},"main","153711dd9432743d97f0b33b080ada5798ea623c","plugins\u002Fios-dev\u002Fskills\u002Fswiftui-sheet-in-sheet-uikit-present-bridge","https:\u002F\u002Fgithub.com\u002Fabhijitbansal\u002Fclaude-skills","https:\u002F\u002Fgithub.com\u002Fabhijitbansal","2026-11-07 12:59:51",{"source":8,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add abhijitbansal\u002Fclaude-skills --skill swiftui-sheet-in-sheet-uikit-present-bridge",{"tool":35,"command":36},"bunx","bunx skills add abhijitbansal\u002Fclaude-skills --skill swiftui-sheet-in-sheet-uikit-present-bridge",{"tool":38,"command":39},"pnpm","pnpm dlx skills add abhijitbansal\u002Fclaude-skills --skill swiftui-sheet-in-sheet-uikit-present-bridge","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fabhijitbansal\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fios-dev\u002Fskills\u002Fswiftui-sheet-in-sheet-uikit-present-bridge\u002FSKILL.md",true,[],[44,51,58,65,72,79],{"skillNo":45,"name":46,"nameZh":6,"description":47,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":48,"categories":49,"keywords":50,"publishedAt":18},"01M74XTV2V7GZM8FDBXQZZ74VX","second-wind","Orchestrate long unattended Claude Code runs across multiple repos with the wind CLI. Use when the user wants to run Claude Code overnight, resume sessions after the 5-hour usage limit, run Claude in many repos at once via tmux, or says \"set up second wind\", \"wind up\", \"overnight run\", \"resume after limit\", \"usage limit orchestrator\".","https:\u002F\u002Fgithub.com\u002Fabhijitbansal\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fsecond-wind\u002Fskills\u002Fsecond-wind\u002FSKILL.md",[],[],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":18},"01M74XTPGN1HDQSKGCZZX0AZPC","structured-output-adaptive-thinking-token-bloat","A Claude API call using output_config.format (json_schema structured outputs) with thinking:{type:\"adaptive\"} burns most of its output budget on thinking (observed ~21k of ~24k tokens) without improving JSON quality, making the run up to ~5x more expensive than the same call with thinking omitted — use when calling the Messages API with a json_schema output format for extraction, ranking, classification, or summarization tasks, or when a schema-constrained call's usage.output_tokens is far larger than the returned JSON.","https:\u002F\u002Fgithub.com\u002Fabhijitbansal\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fprompt-craft\u002Fskills\u002Fstructured-output-adaptive-thinking-token-bloat\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M74XTKTRHAMC2JFHQ1P1E6GR","review","Apply a code-review lens to a diff, branch, or file — find correctness bugs, security issues, and quality problems, ranked by severity, with a concrete fix for each. Use when the user says \"review this\", \"review my diff\", \"check this PR\", \"look this over before I commit\", or \"is this safe\". Skip when the user wants the code written, not reviewed.","https:\u002F\u002Fgithub.com\u002Fabhijitbansal\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fprompt-craft\u002Fskills\u002Freview\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":18},"01M74XTGGCW7GWDDHPEMJQC7Y1","refresh","Rebuild the prompt-craft command registry and usage profile, and print a summary of installed commands and your personalized recommendations. Use when you install or update plugins and want the advisor to pick them up immediately, or say \"refresh prompt-craft\", \"rebuild the command registry\".","https:\u002F\u002Fgithub.com\u002Fabhijitbansal\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fprompt-craft\u002Fskills\u002Frefresh\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M74XTCNGNR4G19P3Z95KTHQJ","refactor","Apply a refactoring lens — restructure code without changing behavior, guarded by tests that pass before and after. Use when the user says \"refactor\", \"clean this up\", \"extract this\", \"simplify this\", \"reduce duplication\", or \"make this readable\" on existing working code. Skip when the change is meant to alter behavior (that's a feature or a fix).","https:\u002F\u002Fgithub.com\u002Fabhijitbansal\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fprompt-craft\u002Fskills\u002Frefactor\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M74XT9FKXN3N106G7Q3X56XR","plan","Decompose a non-trivial task into an explicit, tracked plan with goals and per-step acceptance criteria before writing code. Use when the user says \"plan this\", \"break this down\", \"what's the plan\", or asks for a multi-step feature\u002Frefactor that touches more than one file. Pairs with plan mode. Skip for single-edit changes that need no decomposition.","https:\u002F\u002Fgithub.com\u002Fabhijitbansal\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fprompt-craft\u002Fskills\u002Fplan\u002FSKILL.md",[],[]]