[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BSW8K6Z805WVG0670SHXY9":3,"skill-same:01M6BSW8K6Z805WVG0670SHXY9":71},{"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":25,"linkOnly":26,"markdownContent":27,"markdownBody":28,"frontMatter":29,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":36,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M6BSW8K6Z805WVG0670SHXY9","uikit-app-modernization",null,"Modernizes UIKit apps for multi-window environments by replacing legacy shared-state APIs with context-appropriate modern alternatives. This includes references to mainScreen, interfaceOrientation, application and scene lifecycle, as well as safe area inset updates.","mikker\u002Fdotfiles","mikker","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2819?v=4","01M6BSPF9WRVEQ89CW9NNJ7JK4","Mikkel Malmberg","01M6BSPFEEZKZSB4B603CZGV9W",116,"MIT","https:\u002F\u002Fgithub.com\u002Fmikker\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fagents.symlink\u002Fskills\u002Fxcode-skills\u002Fuikit-app-modernization\u002FSKILL.md",[],[19,20,21,22,23,24],"modernization","app modernization","uikit app modernization","safe","state","lifecycle","2026-11-10 10:12:30",false,"---\nname: uikit-app-modernization\ndescription: \"Modernizes UIKit apps for multi-window environments by replacing legacy shared-state APIs with context-appropriate modern alternatives. This includes references to mainScreen, interfaceOrientation, application and scene lifecycle, as well as safe area inset updates.\"\n---\n# UIKit App Modernization Skill\n\n## Purpose\n\nModernize UIKit apps to behave correctly on modern iOS by:\n- Eliminating references to legacy shared-state APIs\n- Migrating from application lifecycle to scene lifecycle\n- Supporting dynamic scene sizing and multi-window environments\n\n## Scope\n\nThis skill performs **specific, targeted modernizations** in both **Swift and Objective-C** codebases:\n- Replace legacy shared-state APIs with context-appropriate modern APIs\n- Migrate to scene-based lifecycle\n- Update apps to support a resizable user interface by removing usage of:\n  - main screen (`UIScreen.mainScreen`, `UIScreen.main`)\n  - interface orientation (`interfaceOrientation`)\n  - assumptions of symmetric safe areas (`safeAreaLayoutGuide`, `safeAreaInsets`)\n\n## Core Principles\n\n1. **Closest to consumer** — Prefer information nearest the point of use (e.g., view's trait collection over window's).\n2. **Always apply a replacement when the target API is present.** A TODO alone is a failure. **An empty diff for a file containing the target API is also a failure.** If the file contains the target deprecated API and a concrete replacement is feasible under any pattern in the active task's reference file, apply it. Only skip when the target API appears exclusively inside dead code (`#if 0`\u002F`#endif`). When uncertain between two valid replacements, pick the one that best fits the user's request rather than producing an empty diff. **Never silently skip a file**: if you are unwilling to apply a change, talk to the user about possible options — never produce no output for it. **Do not get stuck weighing edge cases on simple files; when the substitution is obvious, apply it and move on.**\n3. **TODOs must be actionable.** Every TODO you do leave must state (a) **why** the change is needed, (b) **what** the correct replacement would look like, and (c) any **lifecycle or threading concerns**. Place the TODO on its own line above the unchanged code — never inline. A vague TODO (\"fix this later\") is worse than no TODO; it consumes review attention without telling the next reader anything they couldn't infer.\n4. **Don't add a redundant TODO when an existing annotation already covers the migration.** If the call site already has a `#pragma clang diagnostic ignored` paired with a bug-report reference, an existing `\u002F\u002F TODO`, or a deprecation comment that points at the migration, do not add another one. Only add a new TODO when it provides additional migration guidance not present in the existing annotation.\n5. **Ask the user before making a risky code change; fall back to a TODO only when interactive guidance is unavailable.** When a replacement risks breaking callers or changing observable behavior (e.g., changing a method signature in a header that other modules import; substituting `width > height` for orientation when left-vs-right matters), the first move is to ask the user how to proceed. Only when the skill is running non-interactively, or when the user explicitly declines to provide guidance, drop a TODO and move on. This does **not** apply to standard, drop-in safe replacements specified by the active task's reference file — those must be applied per Core Principle 2.\n6. **Honor explicit user instructions; otherwise apply the defaults from the task reference file.** When the user asks for a specific approach — a particular attribute, parameter name, parameter position, trait source, or fallback behavior — use that exactly. Don't silently substitute what you consider the modern equivalent. When the user is general (\"modernize this app\", \"fix `UIScreen.main` usages\"), apply the defaults from the active task's reference file.\n7. **Never replace dynamic values with literals** — Always keep replacements dynamic.\n8. **Preserve control flow** — Prefer drop-in replacements that maintain the original code structure. Only add guard\u002Fearly-return patterns when a direct substitution does not work. **When editing code around control flow (`if`\u002F`else`, `switch`\u002F`case`\u002F`default`, `do`\u002F`catch`), verify that the branching structure is preserved after your edit. Never remove a branch (`} else {`, `default:`, `catch`) unless the user explicitly asks for it. A diff that collapses an `if`\u002F`else` into sequential execution is a critical bug — both branches will execute unconditionally.**\n9. **Stay in scope — no opportunistic cleanup.** Only modify lines containing the target deprecated API for the active task. Do NOT also fix other deprecation that happens to live nearby. Do NOT trim trailing whitespace, reformat blank lines, or \"clean up\" surrounding formatting. Even if you see an obvious modernization opportunity on an adjacent line, leave it alone — each task is independent and out-of-scope edits convert a successful in-scope change into a warning.\n10. **Extract repeated expressions** — When the same replacement value is used multiple times in a scope, extract it into a named local variable.\n11. **Never walk global scene\u002Fwindow state** — Never use `UIApplication.shared`, `UIDevice.current`, `UIScreen.main`, or other shared objects as a replacement. If no local object is available, modify the method to accept a new parameter and deprecate the old method.\n12. **Complete patterns — atomic, never partial** — Every multi-part pattern requires ALL parts applied together as a single atomic unit. Deprecate-and-forward requires deprecation + new overload + forwarding — never just an inline replacement when the pattern calls for method extraction. **When the active task requires both an API replacement AND a reactive update (e.g., trait change observation), these form a single atomic change — never apply one without the other.** **Downgrading the deprecate-and-forward pattern to an inline reference to a shared object is an error** — it silently breaks the migration story by removing the deprecated bridge that callers rely on to find the new API. If you cannot complete all four parts (new overload with the appropriate parameter name\u002Ftype\u002Fposition, old method delegates with shared state (e.g. `UITraitCollection.current`, `UIScreen.main`), old method marked deprecated with the appropriate attribute, deprecated wrapper kept in place), do not apply a partial change — either complete the full pattern or skip with an explicit reason.\n13. **Never remove the old method when adding a new overload.** When applying deprecate-and-forward, the old method **must remain in the file** as the deprecated wrapper that forwards to the new overload via `.current`. Deleting the old method (even if it appears unused in the diff) removes the deprecation signal from the codebase and silently drops the migration bridge. This applies to ObjC methods, Swift methods, Swift initializers, computed properties, and protocol-extension methods. If you find yourself removing a method as part of adding a new overload, STOP — you should be keeping it with a deprecation attribute, not deleting it.\n14. **Preserve unrelated guards and fallbacks.** When removing a `UIScreen.mainScreen` reference, change ONLY that reference. Do not simultaneously delete `respondsToSelector:` checks, nil-screen guards, `if (screen != nil)` defenses, version checks (`#available`, `@available`), or any other defensive logic that wraps the call site — unless the user explicitly asks for it. Each guard exists for an independent reason (selector availability across SDK versions, nil-window safety, feature flags); the modernization touches only the screen-derived value, not the surrounding control flow. \n15. **Apply the deprecation at the lowest method that touches the deprecated API.** When several callers funnel into one helper that actually reads the deprecated shared state, put the deprecate-and-forward on **the helper**, not on every public caller. Forcing every public caller to grow a `traitCollection:` parameter when the helper is the only site that needs it produces over-broad churn and a wider blast radius than the migration requires. Conversely, when the deprecated state is read directly inside each public caller (no helper), the deprecation belongs on the public callers — there is nothing lower to deprecate. **Rule of thumb:** identify which method contains the line you would otherwise need to change; deprecate that method. The deprecation chain should grow only as wide as the actual surface that touches the deprecated API.\n16. **Off-target replacement guard.** Before editing any line, verify two things: (a) the line contains the **target deprecated API** for the **active task**, and (b) you're editing the deprecation the user asked about — not a nearby line that \"looks similar.\"\n\n---\n\n## Workflow\n\n### Phase 0: Fast Path for Simple Cases\n\n**Before reaching for the decision tree, check if the occurrence matches the simple case.** A large fraction of `UIScreen.main`\u002F`UIScreen.mainScreen` occurrences are simple substitutions inside a UIView\u002FUIViewController instance method where the value is consumed fresh. These cases need no analysis — just substitute and move on:\n\n| Original | Replacement |\n|----------|-------------|\n| `UIScreen.main.scale` (Swift) inside a UIView\u002FUIViewController instance method, used inline (not stored) | `self.traitCollection.displayScale` |\n| `[UIScreen mainScreen].scale` (ObjC) inside a UIView\u002FUIViewController instance method, used inline (not stored) | `self.traitCollection.displayScale` |\n| `UIScreen.main.scale` inside `layoutSubviews`, `drawRect:`, `updateConstraints`, or `viewIsAppearing:` | `self.traitCollection.displayScale` (no registration needed — UIKit auto-calls these on trait change) |\n\n**Do not over-think simple substitutions.** If the enclosing class is `UIView`\u002F`UIViewController` and the value isn't being assigned to an ivar, layer property, constraint, or stored image, just substitute. **Empty diffs on simple files are the most common mistake — apply the substitution and move on.** Reach for the decision tree only when the simple case doesn't fit (non-view class, cached value, class\u002Fstatic method, special user instructions).\n\n### Phase 1: Detection\n\nIdentify patterns to modernize using each relevant task file's detection patterns. Run detection for every task in the Task Registry that applies to this codebase, not just one — see [Task Registry](#task-registry) below.\n\n### Phase 2: Analysis\n\nFor each occurrence, read surrounding context to understand:\n- Class hierarchy (UIView\u002FUIViewController subclass vs plain NSObject vs non-view class)\n- Method type (instance, static, free function, cached `dispatch_once` helper)\n- Lifecycle phase (init, viewDidLoad, viewWillAppear, layoutSubviews)\n- Code intent (layout, rendering, display scale, full screen dimensions)\n\nThe active task's reference file may add task-specific bullets to this list.\n\nUse subagents to identify code that needs to be updated to keep your context window small.\n\n### Phase 3: Decision & Validation\n\n| Condition | Action |\n|-----------|--------|\n| Safe 1:1 replacement exists | **Apply it.** No added commentary (no `\u002F\u002F TODO: FIXME`, no `\u002F\u002F TODO`, no `\u002F\u002F FIXME` — just the replacement). Use the replacement specified by the active task's reference file. |\n| Multiple valid approaches or code relocation >10 lines | **Ask the user.** |\n| No safe replacement possible (extremely rare) | **Add todo** with an explicit task outlined for the user. Never produce a silent empty diff. Re-check every pattern with a subagent before concluding nothing applies. |\n\nUse subagents to validate against the active task's Post-file Checklist before any code change.\n\n### Phase 3b: File Processing Completeness\n\n**Process EVERY file that contains the target deprecated API.** Do not stop early, skip files, or silently drop files from the work queue. A file that was identified in Phase 1 but produces no diff and no skip explanation is a processing failure.\n\n**Explicit file tracking:** At the start of processing, write out the complete list of files to be modified using available task \u002F todo tools or a markdown file. As you process each file, mark it done. Before finishing, compare this list against your output — any file without a diff or an explicit skip reason is a failure that must be addressed before completing.\n\n**Context size:** If you are concerned about context size, use subagents to process individual files or tasks.\n\n**Silent-drop prevention:** Before finishing, use subagents to compare the list of files you were given against the list of files you produced output for. If any file is missing from your output, go back and process it. Common causes of silent drops:\n- **File size:** Large files (1000+ lines) are not exempt. Process them with the same approach.\n- **Complexity:** Files with preprocessor macros, complex class hierarchies, or unusual code patterns still need changes.\n- **Project grouping:** Do not skip all files from a specific project or directory. If you notice you've dropped multiple files from the same project, that indicates a systematic issue — investigate and fix.\n- **Ambiguity:** If you're unsure how to fix a file, ask the user — do not silently produce an empty diff.\n\n**Large or complex files:** Files with heavy preprocessor usage (`#if`\u002F`#ifdef` nesting), 1000+ lines, or less common patterns (C++ interop, `dispatch_once` caching, deeply nested macros) are not exempt from processing. If the target API appears in such a file, apply the same decision tree. If the file is too large to edit in one pass, process the deprecated API usages one at a time. Use subagents if helpful. If you genuinely cannot determine a safe replacement due to macro expansion or preprocessor complexity, ask the user — never silently skip it.\n\n**Batch processing discipline:** When processing a list of files, do NOT attempt to analyze all files first and then produce all diffs at once. Instead, process files **one at a time or in small batches (3–5 files)**: read context, decide, produce the diff, then move to the next batch. This prevents the tail end of the file list from being silently dropped due to output limits or context exhaustion. If you notice you have produced output for fewer files than you were given, STOP and process the remaining files before finishing.\n\nIf you find empty diffs for files that should have straightforward replacements, go back and process them — straightforward files are fast to handle and should never be dropped.\n\n### Phase 4: Implementation\n\nApply the active task's implementation gates, rules, and post-file checklist from its reference file. The pattern-specific decision tree, gate questions, and validation rules live alongside the patterns they govern in each task file. Use subagents for verification.\n\n### Phase 5: Final Verification\n\n**File coverage audit:** Use subagents to compare the list of files you were given (or detected in Phase 1) against the files you actually produced diffs for. Every input file must have a non-empty diff. If any file is missing changes, go back and process it now.\n\nThe active task's reference file may add task-specific verification steps.\n\n---\n\n## Task Registry\n\nApply every task in this registry to the codebase unless the developer's request explicitly scopes to a subset. Each task is independent and has its own detection patterns, decision tree, and verification rules in its reference file. Run them in order from top to bottom.\n\n| Task | File | Description |\n|------|------|-------------|\n| UIScreen.main modernization | [uiscreen-task.md](references\u002Fuiscreen-task.md) | Replace `UIScreen.main` with context-appropriate APIs |\n| userInterfaceOrientation modernization | [orientation-task.md](references\u002Forientation-task.md) | Replace layout-related orientation checks with size classes or window bounds |\n| Scene lifecycle migration | [scene-lifecycle-task.md](references\u002Fscene-lifecycle-task.md) | Migrate AppDelegate to SceneDelegate |\n| Safe Area Insets | [safe-area-task.md](references\u002Fsafe-area-task.md) | Replace hard coded values for insets with safe area references and ensure that existing references work with asymetric safe areas |","# UIKit App Modernization Skill\n\n## Purpose\n\nModernize UIKit apps to behave correctly on modern iOS by:\n- Eliminating references to legacy shared-state APIs\n- Migrating from application lifecycle to scene lifecycle\n- Supporting dynamic scene sizing and multi-window environments\n\n## Scope\n\nThis skill performs **specific, targeted modernizations** in both **Swift and Objective-C** codebases:\n- Replace legacy shared-state APIs with context-appropriate modern APIs\n- Migrate to scene-based lifecycle\n- Update apps to support a resizable user interface by removing usage of:\n  - main screen (`UIScreen.mainScreen`, `UIScreen.main`)\n  - interface orientation (`interfaceOrientation`)\n  - assumptions of symmetric safe areas (`safeAreaLayoutGuide`, `safeAreaInsets`)\n\n## Core Principles\n\n1. **Closest to consumer** — Prefer information nearest the point of use (e.g., view's trait collection over window's).\n2. **Always apply a replacement when the target API is present.** A TODO alone is a failure. **An empty diff for a file containing the target API is also a failure.** If the file contains the target deprecated API and a concrete replacement is feasible under any pattern in the active task's reference file, apply it. Only skip when the target API appears exclusively inside dead code (`#if 0`\u002F`#endif`). When uncertain between two valid replacements, pick the one that best fits the user's request rather than producing an empty diff. **Never silently skip a file**: if you are unwilling to apply a change, talk to the user about possible options — never produce no output for it. **Do not get stuck weighing edge cases on simple files; when the substitution is obvious, apply it and move on.**\n3. **TODOs must be actionable.** Every TODO you do leave must state (a) **why** the change is needed, (b) **what** the correct replacement would look like, and (c) any **lifecycle or threading concerns**. Place the TODO on its own line above the unchanged code — never inline. A vague TODO (\"fix this later\") is worse than no TODO; it consumes review attention without telling the next reader anything they couldn't infer.\n4. **Don't add a redundant TODO when an existing annotation already covers the migration.** If the call site already has a `#pragma clang diagnostic ignored` paired with a bug-report reference, an existing `\u002F\u002F TODO`, or a deprecation comment that points at the migration, do not add another one. Only add a new TODO when it provides additional migration guidance not present in the existing annotation.\n5. **Ask the user before making a risky code change; fall back to a TODO only when interactive guidance is unavailable.** When a replacement risks breaking callers or changing observable behavior (e.g., changing a method signature in a header that other modules import; substituting `width > height` for orientation when left-vs-right matters), the first move is to ask the user how to proceed. Only when the skill is running non-interactively, or when the user explicitly declines to provide guidance, drop a TODO and move on. This does **not** apply to standard, drop-in safe replacements specified by the active task's reference file — those must be applied per Core Principle 2.\n6. **Honor explicit user instructions; otherwise apply the defaults from the task reference file.** When the user asks for a specific approach — a particular attribute, parameter name, parameter position, trait source, or fallback behavior — use that exactly. Don't silently substitute what you consider the modern equivalent. When the user is general (\"modernize this app\", \"fix `UIScreen.main` usages\"), apply the defaults from the active task's reference file.\n7. **Never replace dynamic values with literals** — Always keep replacements dynamic.\n8. **Preserve control flow** — Prefer drop-in replacements that maintain the original code structure. Only add guard\u002Fearly-return patterns when a direct substitution does not work. **When editing code around control flow (`if`\u002F`else`, `switch`\u002F`case`\u002F`default`, `do`\u002F`catch`), verify that the branching structure is preserved after your edit. Never remove a branch (`} else {`, `default:`, `catch`) unless the user explicitly asks for it. A diff that collapses an `if`\u002F`else` into sequential execution is a critical bug — both branches will execute unconditionally.**\n9. **Stay in scope — no opportunistic cleanup.** Only modify lines containing the target deprecated API for the active task. Do NOT also fix other deprecation that happens to live nearby. Do NOT trim trailing whitespace, reformat blank lines, or \"clean up\" surrounding formatting. Even if you see an obvious modernization opportunity on an adjacent line, leave it alone — each task is independent and out-of-scope edits convert a successful in-scope change into a warning.\n10. **Extract repeated expressions** — When the same replacement value is used multiple times in a scope, extract it into a named local variable.\n11. **Never walk global scene\u002Fwindow state** — Never use `UIApplication.shared`, `UIDevice.current`, `UIScreen.main`, or other shared objects as a replacement. If no local object is available, modify the method to accept a new parameter and deprecate the old method.\n12. **Complete patterns — atomic, never partial** — Every multi-part pattern requires ALL parts applied together as a single atomic unit. Deprecate-and-forward requires deprecation + new overload + forwarding — never just an inline replacement when the pattern calls for method extraction. **When the active task requires both an API replacement AND a reactive update (e.g., trait change observation), these form a single atomic change — never apply one without the other.** **Downgrading the deprecate-and-forward pattern to an inline reference to a shared object is an error** — it silently breaks the migration story by removing the deprecated bridge that callers rely on to find the new API. If you cannot complete all four parts (new overload with the appropriate parameter name\u002Ftype\u002Fposition, old method delegates with shared state (e.g. `UITraitCollection.current`, `UIScreen.main`), old method marked deprecated with the appropriate attribute, deprecated wrapper kept in place), do not apply a partial change — either complete the full pattern or skip with an explicit reason.\n13. **Never remove the old method when adding a new overload.** When applying deprecate-and-forward, the old method **must remain in the file** as the deprecated wrapper that forwards to the new overload via `.current`. Deleting the old method (even if it appears unused in the diff) removes the deprecation signal from the codebase and silently drops the migration bridge. This applies to ObjC methods, Swift methods, Swift initializers, computed properties, and protocol-extension methods. If you find yourself removing a method as part of adding a new overload, STOP — you should be keeping it with a deprecation attribute, not deleting it.\n14. **Preserve unrelated guards and fallbacks.** When removing a `UIScreen.mainScreen` reference, change ONLY that reference. Do not simultaneously delete `respondsToSelector:` checks, nil-screen guards, `if (screen != nil)` defenses, version checks (`#available`, `@available`), or any other defensive logic that wraps the call site — unless the user explicitly asks for it. Each guard exists for an independent reason (selector availability across SDK versions, nil-window safety, feature flags); the modernization touches only the screen-derived value, not the surrounding control flow. \n15. **Apply the deprecation at the lowest method that touches the deprecated API.** When several callers funnel into one helper that actually reads the deprecated shared state, put the deprecate-and-forward on **the helper**, not on every public caller. Forcing every public caller to grow a `traitCollection:` parameter when the helper is the only site that needs it produces over-broad churn and a wider blast radius than the migration requires. Conversely, when the deprecated state is read directly inside each public caller (no helper), the deprecation belongs on the public callers — there is nothing lower to deprecate. **Rule of thumb:** identify which method contains the line you would otherwise need to change; deprecate that method. The deprecation chain should grow only as wide as the actual surface that touches the deprecated API.\n16. **Off-target replacement guard.** Before editing any line, verify two things: (a) the line contains the **target deprecated API** for the **active task**, and (b) you're editing the deprecation the user asked about — not a nearby line that \"looks similar.\"\n\n---\n\n## Workflow\n\n### Phase 0: Fast Path for Simple Cases\n\n**Before reaching for the decision tree, check if the occurrence matches the simple case.** A large fraction of `UIScreen.main`\u002F`UIScreen.mainScreen` occurrences are simple substitutions inside a UIView\u002FUIViewController instance method where the value is consumed fresh. These cases need no analysis — just substitute and move on:\n\n| Original | Replacement |\n|----------|-------------|\n| `UIScreen.main.scale` (Swift) inside a UIView\u002FUIViewController instance method, used inline (not stored) | `self.traitCollection.displayScale` |\n| `[UIScreen mainScreen].scale` (ObjC) inside a UIView\u002FUIViewController instance method, used inline (not stored) | `self.traitCollection.displayScale` |\n| `UIScreen.main.scale` inside `layoutSubviews`, `drawRect:`, `updateConstraints`, or `viewIsAppearing:` | `self.traitCollection.displayScale` (no registration needed — UIKit auto-calls these on trait change) |\n\n**Do not over-think simple substitutions.** If the enclosing class is `UIView`\u002F`UIViewController` and the value isn't being assigned to an ivar, layer property, constraint, or stored image, just substitute. **Empty diffs on simple files are the most common mistake — apply the substitution and move on.** Reach for the decision tree only when the simple case doesn't fit (non-view class, cached value, class\u002Fstatic method, special user instructions).\n\n### Phase 1: Detection\n\nIdentify patterns to modernize using each relevant task file's detection patterns. Run detection for every task in the Task Registry that applies to this codebase, not just one — see [Task Registry](#task-registry) below.\n\n### Phase 2: Analysis\n\nFor each occurrence, read surrounding context to understand:\n- Class hierarchy (UIView\u002FUIViewController subclass vs plain NSObject vs non-view class)\n- Method type (instance, static, free function, cached `dispatch_once` helper)\n- Lifecycle phase (init, viewDidLoad, viewWillAppear, layoutSubviews)\n- Code intent (layout, rendering, display scale, full screen dimensions)\n\nThe active task's reference file may add task-specific bullets to this list.\n\nUse subagents to identify code that needs to be updated to keep your context window small.\n\n### Phase 3: Decision & Validation\n\n| Condition | Action |\n|-----------|--------|\n| Safe 1:1 replacement exists | **Apply it.** No added commentary (no `\u002F\u002F TODO: FIXME`, no `\u002F\u002F TODO`, no `\u002F\u002F FIXME` — just the replacement). Use the replacement specified by the active task's reference file. |\n| Multiple valid approaches or code relocation >10 lines | **Ask the user.** |\n| No safe replacement possible (extremely rare) | **Add todo** with an explicit task outlined for the user. Never produce a silent empty diff. Re-check every pattern with a subagent before concluding nothing applies. |\n\nUse subagents to validate against the active task's Post-file Checklist before any code change.\n\n### Phase 3b: File Processing Completeness\n\n**Process EVERY file that contains the target deprecated API.** Do not stop early, skip files, or silently drop files from the work queue. A file that was identified in Phase 1 but produces no diff and no skip explanation is a processing failure.\n\n**Explicit file tracking:** At the start of processing, write out the complete list of files to be modified using available task \u002F todo tools or a markdown file. As you process each file, mark it done. Before finishing, compare this list against your output — any file without a diff or an explicit skip reason is a failure that must be addressed before completing.\n\n**Context size:** If you are concerned about context size, use subagents to process individual files or tasks.\n\n**Silent-drop prevention:** Before finishing, use subagents to compare the list of files you were given against the list of files you produced output for. If any file is missing from your output, go back and process it. Common causes of silent drops:\n- **File size:** Large files (1000+ lines) are not exempt. Process them with the same approach.\n- **Complexity:** Files with preprocessor macros, complex class hierarchies, or unusual code patterns still need changes.\n- **Project grouping:** Do not skip all files from a specific project or directory. If you notice you've dropped multiple files from the same project, that indicates a systematic issue — investigate and fix.\n- **Ambiguity:** If you're unsure how to fix a file, ask the user — do not silently produce an empty diff.\n\n**Large or complex files:** Files with heavy preprocessor usage (`#if`\u002F`#ifdef` nesting), 1000+ lines, or less common patterns (C++ interop, `dispatch_once` caching, deeply nested macros) are not exempt from processing. If the target API appears in such a file, apply the same decision tree. If the file is too large to edit in one pass, process the deprecated API usages one at a time. Use subagents if helpful. If you genuinely cannot determine a safe replacement due to macro expansion or preprocessor complexity, ask the user — never silently skip it.\n\n**Batch processing discipline:** When processing a list of files, do NOT attempt to analyze all files first and then produce all diffs at once. Instead, process files **one at a time or in small batches (3–5 files)**: read context, decide, produce the diff, then move to the next batch. This prevents the tail end of the file list from being silently dropped due to output limits or context exhaustion. If you notice you have produced output for fewer files than you were given, STOP and process the remaining files before finishing.\n\nIf you find empty diffs for files that should have straightforward replacements, go back and process them — straightforward files are fast to handle and should never be dropped.\n\n### Phase 4: Implementation\n\nApply the active task's implementation gates, rules, and post-file checklist from its reference file. The pattern-specific decision tree, gate questions, and validation rules live alongside the patterns they govern in each task file. Use subagents for verification.\n\n### Phase 5: Final Verification\n\n**File coverage audit:** Use subagents to compare the list of files you were given (or detected in Phase 1) against the files you actually produced diffs for. Every input file must have a non-empty diff. If any file is missing changes, go back and process it now.\n\nThe active task's reference file may add task-specific verification steps.\n\n---\n\n## Task Registry\n\nApply every task in this registry to the codebase unless the developer's request explicitly scopes to a subset. Each task is independent and has its own detection patterns, decision tree, and verification rules in its reference file. Run them in order from top to bottom.\n\n| Task | File | Description |\n|------|------|-------------|\n| UIScreen.main modernization | [uiscreen-task.md](references\u002Fuiscreen-task.md) | Replace `UIScreen.main` with context-appropriate APIs |\n| userInterfaceOrientation modernization | [orientation-task.md](references\u002Forientation-task.md) | Replace layout-related orientation checks with size classes or window bounds |\n| Scene lifecycle migration | [scene-lifecycle-task.md](references\u002Fscene-lifecycle-task.md) | Migrate AppDelegate to SceneDelegate |\n| Safe Area Insets | [safe-area-task.md](references\u002Fsafe-area-task.md) | Replace hard coded values for insets with safe area references and ensure that existing references work with asymetric safe areas |",{"name":5,"description":7},"master","8d883d350240b10cc23da854de1fb212e889caed","agents.symlink\u002Fskills\u002Fxcode-skills\u002Fuikit-app-modernization",4,"https:\u002F\u002Fgithub.com\u002Fmikker\u002Fdotfiles","https:\u002F\u002Fgithub.com\u002Fmikker","https:\u002F\u002Fmikkelmalmberg.com\u002Fama","Top Highlight – research at @githubnext","2026-11-10 22:09:39",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add mikker\u002Fdotfiles --skill uikit-app-modernization",{"tool":45,"command":46},"bunx","bunx skills add mikker\u002Fdotfiles --skill uikit-app-modernization",{"tool":48,"command":49},"pnpm","pnpm dlx skills add mikker\u002Fdotfiles --skill uikit-app-modernization","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmikker\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fagents.symlink\u002Fskills\u002Fxcode-skills\u002Fuikit-app-modernization\u002FSKILL.md",true,[53,59,63,67],{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Forientation-task.md","REFERENCE","参考文档",4186,"https:\u002F\u002Fgithub.com\u002Fmikker\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fagents.symlink\u002Fskills\u002Fxcode-skills\u002Fuikit-app-modernization\u002Freferences\u002Forientation-task.md",{"path":60,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Fsafe-area-task.md",6601,"https:\u002F\u002Fgithub.com\u002Fmikker\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fagents.symlink\u002Fskills\u002Fxcode-skills\u002Fuikit-app-modernization\u002Freferences\u002Fsafe-area-task.md",{"path":64,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Fscene-lifecycle-task.md",10069,"https:\u002F\u002Fgithub.com\u002Fmikker\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fagents.symlink\u002Fskills\u002Fxcode-skills\u002Fuikit-app-modernization\u002Freferences\u002Fscene-lifecycle-task.md",{"path":68,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Fuiscreen-task.md",59607,"https:\u002F\u002Fgithub.com\u002Fmikker\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fagents.symlink\u002Fskills\u002Fxcode-skills\u002Fuikit-app-modernization\u002Freferences\u002Fuiscreen-task.md",[72,82,109,132,149,164],{"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":25},"01M6WFXRC2WZQA9G5AT4D6PCAY","unslop","Cut AI tells from any writing.","https:\u002F\u002Fgithub.com\u002Fmikker\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fagents.symlink\u002Fskills\u002Funslop\u002FSKILL.md",[],[74,79,80,81],"true","cut","writing",{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":86,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":25},"01M6WFWGJTZWZTVED8A7DHZSCB","stageshow","Build faux product UI that looks like a real product, as a still illustration or an animated demo with a cursor. Browser and app windows, dashboards, phones, notifications, terminals, bento grids and cursor walkthroughs, framed, masked and cropped the way a marketing page, feature card or docs hero needs them. Use whenever someone wants a fake or mocked UI, a product demo or walkthrough animation, a hero or feature-card illustration of an app, a product shot in the style of a polished marketing site, or an animated cursor doing things in an interface, even if they never say \"faux UI\". React and plain CSS.","https:\u002F\u002Fgithub.com\u002Fmikker\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fagents.symlink\u002Fskills\u002Fstageshow\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fmikker\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fagents.symlink\u002Fskills\u002Fstageshow\u002FSKILL.md",[],[84,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108],"browser","notifications","windows","react","css","as","hero","interface","card","framed","app","product","feature","never","marketing","dashboards","walkthrough","Animation","ui",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":25},"01M6WFW0TZQ1H9C9X4HMZBTBYZ","clean-copy","Cut interface copy that shouldn't exist — captions that restate a label, hints that pre-empt a worry the user never had, warnings that are scar tissue from a fixed bug. Use when writing or reviewing any user-facing string (labels, hints, empty states, toasts, confirmations, button text), or when asked to clean up \u002F tighten copy.","https:\u002F\u002Fgithub.com\u002Fmikker\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fagents.symlink\u002Fskills\u002Fclean-copy\u002FSKILL.md",[],[116,117,118,119,120,97,121,122,123,124,80,125,126,103,127,128,129,130,81,131],"clean","copy","clean copy","when","labels","states","restate","STRING","tighten","empty","up","use","user","text","Captions","bug",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":25},"01M6BSWBGGT11ZA2BQ0EJH2ZBN","elyx","Elyx is a design tool with local, AI-friendly `.elyx` files for screens, components, layouts, flows, and design systems. This skill is only available to agents running in external harnesses while using the Elyx CLI. It is unavailable and must not be used when running in the ACP harness inside the Elyx app. In external harnesses, use this skill before reading, reasoning about, or answering any question that touches Elyx or `.elyx` files — authoring, editing, validating, inspecting, reviewing, refactoring, comparing, or recommending changes, including read-only analysis where you produce no edit. Do not reason about `.elyx` from source text alone; imports, instances, overrides, and layout only resolve through the tools.","https:\u002F\u002Fgithub.com\u002Fmikker\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fpi\u002Fskills\u002Felyx\u002FSKILL.md",[],[134,139,140,141,142,143,144,145,146,147,148],"design","Tools","analysis","produce","harness","acp","design systems","reasoning","components","cli",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":25},"01M6BSW5SCT7GQ4QX7CBSB4WF1","swiftui-whats-new-27","New SwiftUI APIs, behaviors, and deprecations in the 2027 OS releases (iOS 27 and aligned macOS\u002FwatchOS\u002FtvOS\u002FvisionOS). Consult when asked what's new in SwiftUI 27, or when working with: - @State compile errors after an SDK update (\"used before being initialized\", \"invalid redeclaration of synthesized property\") or @State becaming a macro - @ViewBuilder\u002F@ContentBuilder ambiguous overloads or type-check regressions; drag-to-reorder in any container (List, stacks, grids, custom layouts) via reorderable()\u002FreorderContainer and its drag-and-drop - AsyncImage caching, reloading on scroll, or a custom URLSession - Swipe actions outside List (ScrollView, LazyVStack, LazyVGrid) via swipeActions()\u002FswipeActionsContainer() - Toolbar overflow, visibility (visibilityPriority, ToolbarOverflowMenu, toolbarMinimizeBehavior), and pinning - Presenting a confirmationDialog or alert from an optional item binding","https:\u002F\u002Fgithub.com\u002Fmikker\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fagents.symlink\u002Fskills\u002Fxcode-skills\u002Fswiftui-whats-new-27\u002FSKILL.md",[],[156,157,158,159,160,23,161,162,163],"swiftui whats new 27","macro","ios","actions","compile","update","sdk","macos",{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":25},"01M6BSW2V73PS5T3CE0Q2VAWM4","swiftui-specialist","Authoritative SwiftUI best practices and performance guidance from Apple; supersedes prior training on these topics. For code generation, consult the relevant references when generating any SwiftUI code related to: - animation (the @Animatable macro vs AnimatableValues vs AnimatablePair, and custom animatableData setter logic) - Environment and @Entry (closure or class-typed defaults, unstable defaults, high-frequency updates) - @Observable best practices and efficient invalidation - ForEach and List row identity and structure (id: \\.self, indices, offsets, AnyView or multi-view rows, inline filter\u002Fsort, cached collections, List fast path) - localization (String vs LocalizedStringResource, the right bundle in packages and frameworks, .textCase, .formatted(.list()), translator comments) - soft-deprecated APIs such as NavigationView and the old onChange, and when to surface them during feature work.","https:\u002F\u002Fgithub.com\u002Fmikker\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fagents.symlink\u002Fskills\u002Fxcode-skills\u002Fswiftui-specialist\u002FSKILL.md",[],[171,107,157,172,173,174,175,176,177,178,179],"swiftui specialist","Code Generation","fast","best practices","code","packages","training","identity","performance"]