swift-patterns
Review, refactor, or build SwiftUI features with correct state management, modern API usage, optimal view composition, navigation patterns, performance optimization, and testing best practices.
Why use this skill?
Master SwiftUI development with the swift-patterns skill. Get expert reviews, refactor code for performance, and follow best practices for state management and view composition.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/efremidze/swift-patternsWhat This Skill Does
The swift-patterns skill is a comprehensive toolkit designed to elevate your SwiftUI development experience by enforcing Apple-recommended architectural practices and modern coding standards. It acts as an expert pair programmer that specializes in state management, view composition, and performance optimization. Rather than dictating a rigid architecture, it provides actionable guidance based on Apple's latest documentation and industry best practices for the SwiftUI framework. Whether you are performing a technical audit of an existing codebase, refactoring legacy View structs, or starting a new feature, this skill ensures your code remains modular, testable, and performant.
Installation
To install this skill, use the following command in your terminal within the OpenClaw environment:
clawhub install openclaw/skills/skills/efremidze/swift-patterns
Use Cases
- Code Review: Analyze large SwiftUI view hierarchies for potential performance bottlenecks, such as unnecessary state invalidation or improper use of @ObservedObject vs @StateObject.
- Refactoring: Convert legacy UIKit-heavy views to modern SwiftUI interfaces using current patterns like
NavigationStackandObservationframework components. - Performance Tuning: Audit list and grid implementations to ensure proper view identity and lifecycle management, preventing common issues like excessive view recreation during scrolling.
- Architectural Guidance: Receive expert recommendations on how to distribute state between views, how to handle asynchronous data fetching via the
.taskmodifier, and how to maintain decoupled navigation flows.
Example Prompts
- "I have a List that stutters when scrolling. Can you review this file and check if my list identity and view composition are causing unnecessary re-renders?"
- "Refactor this view to move the data fetching logic into an Observable model. It currently does too much in the .onAppear modifier."
- "What is the recommended approach for deep-linking navigation in a complex SwiftUI app using the latest NavigationStack patterns?"
Tips & Limitations
- Be Specific: Provide the context of the view or model you are working on. Snippets work well, but providing the file structure helps the agent understand state ownership.
- Intent Matters: The agent is trained to ask if you want a review or a refactor. Stating your intent clearly in the initial prompt saves time and focuses the output.
- Independence: While the skill promotes best practices, it does not enforce a specific design pattern like MVVM or TCA. It aims to work within whatever architecture you have already established, focusing on SwiftUI-specific idiomatic improvements.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-efremidze-swift-patterns": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read, file-write