Skip to main content
skill CX Codex

focus-engine — Claude Code skill for SwiftUI and UIKit focus

An AI-coding skill for focus handling in SwiftUI and UIKit: keyboard and directional movement, scene values, restoration after presentation changes. Useful when Siri Remote or Tab navigation lands on the wrong control.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add dpearson2699/swift-ios-skills --skill focus-engine -a claude-code
Open on GitHub

What focus-engine does

The skill covers focus in SwiftUI and UIKit apps built for iOS 26+, iPadOS, macOS, tvOS and visionOS with connected input. It walks through @FocusState, .defaultFocus, focused values and scene values, plus .focusable(_:interactions:). Each topic comes with code and a list of common mistakes, and there is a review checklist at the end.

Dedicated parts deal with getting focus back after a sheet, popover or overlay closes, and with UIFocusGuide in UIKit when the layout has gaps and arrows travel off course. tvOS gets geometric focus and Siri Remote navigation, watchOS gets Digital Crown input, macOS gets the key view loop and Full Keyboard Access. Note that focusSection() targets macOS 13+ and tvOS 15+, so older deployment targets matter here.

The boundaries are spelled out. On visionOS, gaze and pointer targeting count as input affordances rather than focus. VoiceOver, Switch Control and accessibility element ordering belong to the ios-accessibility skill. Without that split a prompt easily sends the agent down the wrong path, so decide first which kind of focus you actually need.

What it helps with

  • move focus to the next field after submit
  • fix arrow-key traversal on tvOS
  • bring focus back to a trigger button after a sheet closes
  • route focus across empty space in a UIKit layout
  • debug a focus chain with UIFocusDebugger

Example prompts for the agent

  • After the form submits, focus should jump from email to password — build it with @FocusState.
  • On tvOS the down arrow skips the middle column; wrap each group in focusSection().
  • Focus disappears when the sheet closes — put it back on the button that opened it.

How to install focus-engine

1Skills CLI (Vercel)

npx skills add dpearson2699/swift-ios-skills --skill focus-engine -a claude-code

2Manually: put the files in place

~/.claude/skills/focus-engine/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/focus-engine/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about focus-engine

How do I install focus-engine in Claude Code?

Run npx skills add dpearson2699/swift-ios-skills --skill focus-engine -a claude-code. The skill file lands at ~/.claude/skills/focus-engine/SKILL.md.

What does focus-engine do?

It guides the agent through focus on Apple platforms: @FocusState, .defaultFocus, focused values, focus sections, restoration after presentations, UIFocusGuide in UIKit and UIFocusDebugger for debugging.

How is it different from the accessibility skill?

focus-engine handles keyboard, remote and game-controller focus along with scene-level focus. VoiceOver, Switch Control and accessibility ordering are left to ios-accessibility.

Similar skills

Everything for Mobile →

From the same set86

app-store-optimization Structures App Store Connect metadata to improve organic search ranking and download conversion. It balances keywords across titles, subtitles, and the indexed keyword field. CX Codex +1 2,900installs tabletopkit Guides work on visionOS spatial board games using TabletopKit, including game pieces, turns, participant sync, and RealityKit rendering. CX Codex +1 2,900installs swift-api-design-guidelines Applies Apple's official Swift API Design Guidelines to codebases. It guides argument labels, naming conventions for mutating methods, and structured documentation comments. CX Codex +1 2,800installs core-data A skill for Core Data work in apps that have not moved to SwiftData: stack setup, concurrency, batch operations and migrations. CX Codex +1 2,700installs swift-formatstyle Teaches AI assistants to replace legacy Formatter subclasses with Foundation FormatStyle in Swift and SwiftUI. Useful for locale-safe numbers, dates, and currencies. CX Codex +1 2,700installs swiftlint Sets up SwiftLint for Swift projects, covering rules, suppressions, baselines and CI checks. Use it when adding linting to a build or bringing existing code under review. CX Codex +1 2,700installs ios-ettrace-performance This skill guides a focused iOS ETTrace capture from matching dSYMs to per-thread analysis. Use it when comparing a repeatable launch or runtime flow. CX Codex +1 1,200installs ios-memgraph-analysis A skill for reading iOS .memgraph files: it separates unreachable leaks from reachable heap growth and keeps the raw tool output. CX Codex +1 1,200installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor