Neo swift ui
Use this skill when building, debugging, refactoring, or reviewing SwiftUI apps or views for iOS 16+ and related Apple platforms. Trigger for NavigationStack, Observation/state flow, view composition, previews, performance, accessibility, and SwiftUI architecture.From its SKILL.md
npx -y skills add Benknightdark/neo-skills --skill neo-swift-uiAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 7 stars7 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.4 KB, 899 tokens by cl100k_base, as published. Nobody here has run it
Modern SwiftUI (iOS 16+) Expert Skill
Trigger On
- The user asks to write, debug, refactor, or review SwiftUI code.
- The target project version is iOS 16 or higher (utilizing features like
NavigationStack,Grid, etc.). - Development involves state management (
@State,@Observable), custom layouts, or animations.
Workflow
- Perceive (Version and Environment Awareness):
- Confirm if the deployment target is iOS 16+.
- Identify the current state management paradigm (traditional
ObservableObjectvs. modern@Observable). - Assess the usage of navigation components (check if deprecated
NavigationViewis still in use).
- Reason (Planning Phase):
- Plan the view hierarchy to maximize reusability and minimize redundant
bodycomputations. - Enforce the use of
NavigationStackorNavigationSplitViewfor navigation needs. - Select the correct data flow tools based on data lifecycle (
State,Binding,Environment).
- Plan the view hierarchy to maximize reusability and minimize redundant
- Act (Execution Phase):
- Follow SwiftUI core principles to write concise, declarative Swift code.
- Use
Grid,ViewThatFits, or customLayoutprotocols to implement complex layouts. - Leverage modern modifiers (e.g.,
.sheetwithdetents).
- Validate (Standard Validation):
- Check for "God Views" (views with excessive logic or
bodycontent) and suggest splitting them. - Ensure
@Stateand@Bindingare used correctly to avoid unnecessary view refreshes. - Verify that the UI remains fluid and adheres to Apple's Human Interface Guidelines (HIG).
- Check for "God Views" (views with excessive logic or
Feature Roadmap (SwiftUI Evolution)
iOS 13.0 - 15.0 (Foundation Era)
- Declarative Syntax: Core
Viewprotocol andbodyproperty. - State Management:
@State,@Binding,@ObservedObject,@EnvironmentObject. - Basic Containers:
VStack,HStack,ZStack,List. - Legacy Navigation:
NavigationViewandNavigationLink.
iOS 16.0 - 17.0 (Modern Era)
- NavigationStack: Decoupled and data-driven navigation pattern.
- Observation Framework:
@Observablemacro (Swift 5.9+) replacingObservableObject. - Advanced Layouts:
Grid,ViewThatFits, andLayoutprotocol. - Swift Charts: Native data visualization framework.
iOS 18.0+ (Latest Features)
- SwiftUI Animations: New phase-based and keyframe-based animation APIs.
- Interaction Enhancements: Improved Scroll View controls and gesture handling.
Coding Standards
- Declarative Style: Keep the view tree structure clear and avoid writing complex logic within
body. - Modularity: Split subviews into independent
structsinstead of computed properties. - Preview Guidelines: Use the
#Previewmacro for rapid development, testing across multiple environment settings (Dark Mode, different locales). - Type Safety: Prefer strongly typed navigation paths and environment keys.
Deliver
- Version-Optimized Code: Provide code utilizing iOS 16+ features (e.g.,
NavigationStack,presentationDetents). - Modular View Components: Deconstruct large views into single-responsibility, reusable components.
- Modern State Management: Prioritize the
@Observablepattern for projects supporting Swift 5.9+.
Validate
- Ensure code compiles without warnings and uses the best available APIs for the target version.
- Validate view
bodyexecution efficiency, ensuring no side effects are included. - Confirm that data flow follows the unidirectional flow principle whenever possible.
Documentation
Official References
Internal References
What ships with it: 3 files
6.1 KB alongside SKILL.md
reference/
- anti-patterns.md2.0 KB
- coding-style.md1.7 KB
- patterns.md2.3 KB