swiftui-architecture

Generate SwiftUI MVVM project skeletons with actor-based services and App Intents.

1|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/piemonte/skills --skill swiftui-architecture-piemonte
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: swiftui-architecture
Source: https://github.com/piemonte/skills/tree/main/swiftui-architecture
Command: npx skills add https://github.com/piemonte/skills --skill swiftui-architecture-piemonte

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many SwiftUI projects lack a consistent architecture, leading to scattered business logic, hard‑to‑maintain code, and unpredictable UI behavior.

Core Features & Use Cases

  • MVVM guidelines: Enforces ViewModels for state, Views for UI only, and Service actors for data.
  • State management patterns: Uses @Published in ViewModels, @State in Views, and clear data flow.
  • Service layer templates: Provides actor‑based networking services and @MainActor shared state services.
  • File organization blueprint: Ready‑to‑use folder layout for Apps, Experiences, Interface, Services, Models, Extensions, and Resources.
  • iOS 26 App Intents: Example patterns for IntentValueQuery and OpenIntent.

Quick Start

Ask the assistant to generate a SwiftUI MVVM project skeleton based on the swiftui-architecture skill.

Frequently Asked Questions about swiftui-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a SwiftUI app with MVVM?▼

Structure a SwiftUI MVVM app by separating code into ViewModels for state, Views for UI, and actor-based Services for data. Enforce @MainActor on ViewModels and use @Published for reactive state management across iOS, iPadOS, and macOS.

What is the best way to manage state in SwiftUI across async services?▼

Manage async state in SwiftUI by using actor-based services for networking and @MainActor ViewModels for thread-safe state. This ensures clear data flow and prevents scattered business logic in your iOS applications.

Does this MVVM architecture work with iOS App Intents?▼

Yes, the architecture supports iOS App Intents by providing example patterns for IntentValueQuery and OpenIntent. This integrates seamlessly with the MVVM service and ViewModel layers.

How do I organize files in a scalable SwiftUI project?▼

Organize SwiftUI files using a blueprint with folders for Apps, Experiences, Interface, Services, Models, Extensions, and Resources. This layout enforces separation of concerns and creates scalable codebases.

Why use @MainActor on ViewModels in SwiftUI?▼

Use @MainActor on ViewModels to ensure thread-safe state management and predictable UI behavior. It isolates state mutations on the main thread while actor-based services handle background async data fetching.

Can I apply this SwiftUI architecture to macOS and iPadOS apps?▼

Yes, the MVVM architecture applies directly to iOS, iPadOS, and macOS projects. The state management patterns and service layer templates work consistently across all Apple platforms.