Agent skill · software engineering · dpearson2699
focus-engine
Implements keyboard, directional, and scene-level focus behavior across SwiftUI and UIKit. Use when managing @FocusState, defaultFocus, focused values, focusable interactions, focus sections, tvOS geometric focus and Siri Remote navigation, watchOS Digital Crown input, visionOS connected-device focus versus gaze hover/input targets, macOS key view loop and Full Keyboard Access, focus restoration after presentation changes, custom focus routing with UIFocusGuide, or debugging focus with UIFocusDebugger.
Why this skill is useful
Provides specific implementation patterns and best practices for managing focus behavior in SwiftUI and UIKit that the AI wouldn't reliably generate on its own.
What it needs
About 5k tokens when loaded. Last updated 2026-07-31. 973 stars on the source repository.
What this skill does
Focus Engine Focus behavior for SwiftUI and UIKit apps targeting iOS 26+, iPadOS, macOS, tvOS, and visionOS connected-input paths. Covers keyboard focus, directional focus, scene-focused values, focus restoration, and UIKit focus guides. focusSection() guidance in this skill applies to macOS and tvOS. visionOS gaze-driven hover is an input affordance, not focus. Accessibility-specific focus for VoiceOver and Switch Control lives in the ios-accessibility skill. When a request mixes focus with accessibility or spatial input, keep the boundary explicit: Use this skill for keyboard, remote, game-controller, and scene focus behavior. For visionOS, describe gaze, direct touch, and pointer targeting as hover/input affordances, not focus. For VoiceOver, Switch Control, Voice Control, or accessibility element ordering, give only a brief handoff to ios-accessibility. Contents SwiftUI FocusState Default Focus Focused Values and Scene Values Focusable Interactions Focus Sections Focus Restoration UIKit Focus Guides Common Mistakes Review Checklist References SwiftUI FocusState Use @FocusState to read and write focus placement inside a scene. Use Bool for a single target or an optional Hashable enum for multiple targets. Keep focus state local to the view that owns the focusable controls. Default Focus Use .defaultFocus to set the preferred initial focus region or control when a view appears or when focus is reassigned automatically. Prefer one clear default destination per screen or focus region. Focused Values and Scene Values Use focused values to expose state from the currently focused view. Use scene-focused values when commands or scene-wide UI should keep access to the value even after focus moves within that scene. Use this pattern for menus, commands, and toolbars that need to act on the focused scene's current content. Focusable Interactions Use .focusable(:interactions:) on custom SwiftUI views that should participate in keyboard or directional focus. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills dpearson2699/focus-engine