swift-swiftui

Standards for State Management, View Lifecycle, and Property Wrappers. Use when managing SwiftUI state, view lifecycle, or property wrappers like @State and @Binding. (triggers: **/*.swift, @State, @Binding, @ObservedObject, View, body)

25 stars

Best use case

swift-swiftui is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Standards for State Management, View Lifecycle, and Property Wrappers. Use when managing SwiftUI state, view lifecycle, or property wrappers like @State and @Binding. (triggers: **/*.swift, @State, @Binding, @ObservedObject, View, body)

Teams using swift-swiftui should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/swift-swiftui/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/HoangNguyen0403/agent-skills-standard/swift-swiftui/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/swift-swiftui/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How swift-swiftui Compares

Feature / Agentswift-swiftuiStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Standards for State Management, View Lifecycle, and Property Wrappers. Use when managing SwiftUI state, view lifecycle, or property wrappers like @State and @Binding. (triggers: **/*.swift, @State, @Binding, @ObservedObject, View, body)

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# SwiftUI Standards

## **Priority: P0**

## Implementation Guidelines

### State Management

- **@State**: @State for data owned by the view (e.g., toggle, text input). Private to the view.
- **@Binding**: @Binding for data passed down from a parent to a child. Two-way connection.
- **@ObservedObject**: @ObservedObject when receiving an instance from an external source.
- **@StateObject**: @StateObject when the view is creating the object instance. View owns lifecycle.
- **@EnvironmentObject**: inject data into the view's hierarchy via `.environmentObject()`. Shared across view hierarchy.

### View Composition

- **Extract Subviews**: Keep views small (<200 lines). Extract reusable components.
- **View Modifiers**: Chain modifiers for styling (`.font()`, `.padding()`).
- **Custom Modifiers**: Create `ViewModifier` for reusable styles.

### Performance

- **Avoid Heavy Computation**: Use `@State` + `.task()` for async work.
- **Equatable**: Conform views to `Equatable` to prevent unnecessary re-renders.
- **LazyStacks**: Use `LazyVStack`/`LazyHStack` when displaying a large number of views in a scrolling container to load them only as they appear.

## Anti-Patterns

- **No @ObservedObject for owned objects**: Use @StateObject.
- **No logic in body**: Move to computed properties or methods.
- **No ! in View**: Use if-let or nil coalescing.

## References

- [State & Binding](references/implementation.md)

Related Skills

swift-mcp-server-generator

25
from ComeOnOliver/skillshub

Generate a complete Model Context Protocol server project in Swift using the official MCP Swift SDK package.

Expo UI SwiftUI

25
from ComeOnOliver/skillshub

`@expo/ui/swift-ui` package lets you use SwiftUI Views and modifiers in your app.

swift-development

25
from ComeOnOliver/skillshub

Comprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.

swiftui-view-refactor

25
from ComeOnOliver/skillshub

Refactor and review SwiftUI view files for consistent structure, dependency injection, and Observation usage. Use when asked to clean up a SwiftUI view’s layout/ordering, handle view models safely (non-optional when possible), or standardize how dependencies and @Observable state are initialized and passed.

swiftui-ui-patterns

25
from ComeOnOliver/skillshub

Best practices and example-driven guidance for building SwiftUI views and components. Use when creating or refactoring SwiftUI UI, designing tab architecture with TabView, composing screens, or needing component-specific patterns and examples.

swiftui-performance-audit

25
from ComeOnOliver/skillshub

Audit and improve SwiftUI runtime performance from code review and architecture. Use for requests to diagnose slow rendering, janky scrolling, high CPU/memory usage, excessive view updates, or layout thrash in SwiftUI apps, and to provide guidance for user-run Instruments profiling when code review alone is insufficient.

swiftui-liquid-glass

25
from ComeOnOliver/skillshub

Implement, review, or improve SwiftUI features using the iOS 26+ Liquid Glass API. Use when asked to adopt Liquid Glass in new SwiftUI UI, refactor an existing feature to Liquid Glass, or review Liquid Glass usage for correctness, performance, and design alignment.

swift-concurrency-expert

25
from ComeOnOliver/skillshub

Swift Concurrency review and remediation for Swift 6.2+. Use when asked to review Swift Concurrency usage, improve concurrency compliance, or fix Swift concurrency compiler errors in a feature or file.

swiftui-patterns

25
from ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

swift-protocol-di-testing

25
from ComeOnOliver/skillshub

Protocol-based dependency injection for testable Swift code — mock file system, network, and external APIs using focused protocols and Swift Testing.

swift-concurrency-6-2

25
from ComeOnOliver/skillshub

Swift 6.2 Approachable Concurrency — single-threaded by default, @concurrent for explicit background offloading, isolated conformances for main actor types.

swift-actor-persistence

25
from ComeOnOliver/skillshub

Thread-safe data persistence in Swift using actors — in-memory cache with file-backed storage, eliminating data races by design.