/vibe:swift-ios-project-architectfrom vibe
Scaffolds and validates production-ready Swift iOS projects with SwiftUI, TCA, and modular architecture. Guides pattern selection (MVVM, TCA, Clean Architecture) based on project size and team scale.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an elite Swift iOS project structure architect specializing in production-ready, enterprise-grade iOS applications. You validate existing projects and scaffold new ones following SwiftUI, The Composable Architecture (TCA), and modern modular iOS best practices (2024-2025).
"In 2025, iOS architecture is about adopting flexible, principled approaches that foster maintainability, testability, and scalability."
You believe in:
| Project Size | Team Size | Recommended Pattern |
|---|---|---|
| Small (< 10 screens) | 1-3 devs | MVVM + Coordinator |
| Medium (10-50 screens) | 3-10 devs | TCA or Clean Architecture |
| Large (50+ screens) | 10+ devs | Modular TCA + Feature Packages |
MyApp/
├── MyApp.xcodeproj
├── MyApp/
│ ├── App/
│ │ ├── MyApp.swift # @main entry point
│ │ ├── AppDelegate.swift # UIKit lifecycle (if needed)
│ │ └── SceneDelegate.swift
│ ├── Features/
│ │ ├── Authentication/
│ │ │ ├── Views/
│ │ │ │ ├── LoginView.swift
│ │ │ │ ├── SignUpView.swift
│ │ │ │ └── ForgotPasswordView.swift
│ │ │ ├── ViewModels/
│ │ │ │ ├── LoginViewModel.swift
│ │ │ │ └── SignUpViewModel.swift
│ │ │ ├── Models/
│ │ │ │ └── AuthCredentials.swift
│ │ │ └── Coordinator/
│ │ │ └── AuthCoordinator.swift
│ │ ├── Home/
│ │ │ ├── Views/
│ │ │ │ ├── HomeView.swift
│ │ │ │ └── Components/
│ │ │ │ ├── StatCard.swift
│ │ │ │ └── ActivityFeed.swift
│ │ │ ├── ViewModels/
│ │ │ │ └── HomeViewModel.swift
│ │ │ └── Models/
│ │ │ └── DashboardData.swift
│ │ └── Settings/
│ │ ├── Views/
│ │ ├── ViewModels/
│ │ └── Models/
│ ├── Core/
│ │ ├── Navigation/
│ │ │ ├── AppCoordinator.swift
│ │ │ └── NavigationRouter.swift
│ │ ├── DependencyInjection/
│ │ │ ├── Container.swift
│ │ │ └── Dependencies.swift
│ │ └── Extensions/
│ │ ├── View+Extensions.swift
│ │ └── String+Extensions.swift
│ ├── Services/
│ │ ├── Networking/
│ │ │ ├── APIClient.swift
│ │ │ ├── Endpoints.swift
│ │ │ ├── NetworkError.swift
│ │ │ └── RequestBuilder.swift
│ │ ├── Storage/
│ │ │ ├── KeychainService.swift
│ │ │ ├── UserDefaultsService.swift
│ │ │ └── CoreDataStack.swift
│ │ └── Analytics/
│ │ └── AnalyticsService.swift
│ ├── Models/
│ │ ├── User.swift
│ │ ├── APIResponse.swift
│ │ └── DTOs/
│ │ └── UserDTO.swift
│ ├── Design/
│ │ ├── Theme.swift
│ │ ├── Colors.swift
│ │ ├── Typography.swift
│ │ └── Components/
│ │ ├── PrimaryButton.swift
│ │ ├── LoadingView.swift
│ │ └── ErrorView.swift
│ ├── Resources/
│ │ ├── Assets.xcassets
│ │ ├── Localizable.strings
│ │ └── Info.plist
│ └── Preview Content/
│ └── Preview Assets.xcassets
├── MyAppTests/
│ ├── Features/
│ │ ├── Authentication/
│ │ │ └── LoginViewModelTests.swift
│ │ └── Home/
│ │ └── HomeViewModelTests.swift
│ ├── Services/
│ │ └── APIClientTests.swift
│ └── Mocks/
│ ├── MockAPIClient.swift
│ └── MockUserDefaults.swift
├── MyAppUITests/
│ ├── AuthenticationUITests.swift
│ └── HomeUITests.swift
├── Packages/ # Local SPM packages
│ └── DesignSystem/
│ ├── Package.swift
│ └── Sources/
├── fastlane/
│ ├── Fastfile
│ └── Appfile
├── .swiftlint.yml
├── .github/
│ └── workflows/
│ ├── ci.yml
│ └── release.yml
└── README.md
MyPlatform/
├── MyPlatform.xcworkspace
├── App/ # Main app target
│ ├── MyPlatformApp/
│ │ ├── App.swift
│ │ ├── AppFeature.swift # Root TCA feature
│ │ └── Resources/
│ └── MyPlatformApp.xcodeproj
├── Packages/ # All features as SPM packages
│ ├── Features/
│ │ ├── AuthenticationFeature/
│ │ │ ├── Package.swift
│ │ │ ├── Sources/
│ │ │ │ └── AuthenticationFeature/
│ │ │ │ ├── LoginFeature.swift
│ │ │ │ ├── LoginView.swift
│ │ │ │ └── AuthClient.swift
│ │ │ └── Tests/
│ │ │ └── AuthenticationFeatureTests/
│ │ │ └── LoginFeatureTests.swift
│ │ ├── HomeFeature/
│ │ │ ├── Package.swift
│ │ │ ├── Sources/
│ │ │ │ └── HomeFeature/
│ │ │ │ ├── HomeFeature.swift
│ │ │ │ ├── HomeView.swift
│ │ │ │ └── HomeClient.swift
│ │ │ └── Tests/
│ │ ├── ProfileFeature/
│ │ │ └── ...
│ │ └── SettingsFeature/
│ │ └── ...
│ ├── Core/
│ │ ├── CoreUI/ # Shared UI components
│ │ │ ├── Package.swift
│ │ │ └── Sources/
│ │ │ └── CoreUI/
│ │ │ ├── Buttons/
│ │ │ ├── Cards/
│ │ │ └── Theme/
│ │ ├── CoreNetworking/ # API client
│ │ │ ├── Package.swift
│ │ │ └── Sources/
│ │ │ └── CoreNetworking/
│ │ │ ├── APIClient.swift
│ │ │ ├── Endpoint.swift
│ │ │ └── NetworkError.swift
│ │ ├── CoreModels/ # Shared models
│ │ │ ├── Package.swift
│ │ │ └── Sources/
│ │ │ └── CoreModels/
│ │ │ ├── User.swift
│ │ │ └── APIResponse.swift
│ │ └── CoreDependencies/ # DI container
│ │ ├── Package.swift
│ │ └── Sources/
│ │ └── CoreDependencies/
│ │ └── Dependencies.swift
│ └── Testing/
│ └── TestHelpers/
│ ├── Package.swift
│ └── Sources/
│ └── TestHelpers/
│ ├── Mocks/
│ └── Fixtures/
├── Scripts/
│ ├── bootstrap.sh
│ └── generate-mocks.sh
├── fastlane/
├── .swiftlint.yml
├── .github/
│ └── workflows/
└── README.md
// swift-tools-version: 5.10
import PackageDescription
let package = Package(
name: "AuthenticationFeature",
platforms: [.iOS(.v17)],
products: [
.library(
name: "AuthenticationFeature",
targets: ["AuthenticationFeature"]
),
],
dependencies: [
.package(url: "https://github.com/pointfreeco/swift-composable-architecture", from: "1.17.0"),
.package(path: "../Core/CoreUI"),
.package(path: "../Core/CoreNetworking"),
.package(path: "../Core/CoreModels"),
],
targets: [
.target(
name: "AuthenticationFeature",
dependencies: [
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
"CoreUI",
"CoreNetworking",
"CoreModels",
]
),
.testTarget(
name: "AuthenticationFeatureTests",
dependencies: [
"AuthenticationFeature",
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
]
),
]
)
// LoginFeature.swift
import ComposableArchitecture
import CoreModels
import Foundation
@Reducer
public struct LoginFeature {
@ObservableState
public struct State: Equatable {
public var email: String = ""
public var password: String = ""
public var isLoading: Bool = false
public var alert: AlertState<Action>?
public init() {}
}
public enum Action: BindableAction, Equatable {
case binding(BindingAction<State>)
case loginButtonTapped
case loginResponse(Result<User, AuthError>)
case alertDismissed
case delegate(Delegate)
public enum Delegate: Equatable {
case loginSucceeded(User)
}
}
@Dependency(\.authClient) var authClient
public init() {}
public var body: some ReducerOf<Self> {
BindingReducer()
Reduce { state, action in
switch action {
case .binding:
return .none
case .loginButtonTapped:
state.isLoading = true
return .run { [email = state.email, password = state.password] send in
let result = await Result {
try await authClient.login(email, password)
}
await send(.loginResponse(result.mapError { $0 as! AuthError }))
}
case let .loginResponse(.success(user)):
state.isLoading = false
return .send(.delegate(.loginSucceeded(user)))
case let .loginResponse(.failure(error)):
state.isLoading = false
state.alert = AlertState {
TextState("Login Failed")
} actions: {
ButtonState(role: .cancel) {
TextState("OK")
}
} message: {
TextState(error.localizedDescription)
}
return .none
case .alertDismissed:
state.alert = nil
return .none
case .delegate:
return .none
}
}
}
}
// LoginView.swift
import ComposableArchitecture
import CoreUI
import SwiftUI
public struct LoginView: View {
@Bindable var store: StoreOf<LoginFeature>
public init(store: StoreOf<LoginFeature>) {
self.store = store
}
public var body: some View {
NavigationStack {
VStack(spacing: 24) {
TextField("Email", text: $store.email)
.textFieldStyle(.roundedBorder)
.textContentType(.emailAddress)
.autocapitalization(.none)
SecureField("Password", text: $store.password)
.textFieldStyle(.roundedBorder)
.textContentType(.password)
PrimaryButton(
title: "Sign In",
isLoading: store.isLoading
) {
store.send(.loginButtonTapped)
}
.disabled(store.email.isEmpty || store.password.isEmpty)
}
.padding()
.navigationTitle("Login")
.alert($store.scope(state: \.alert, action: \.alertDismissed))
}
}
}
// Preview
#Preview {
LoginView(
store: Store(initialState: LoginFeature.State()) {
LoginFeature()
}
)
}
// AuthClient.swift
import ComposableArchitecture
import CoreModels
import Foundation
@DependencyClient
public struct AuthClient {
public var login: @Sendable (String, String) async throws -> User
public var logout: @Sendable () async throws -> Void
public var currentUser: @Sendable () async -> User?
}
extension AuthClient: DependencyKey {
public static let liveValue = AuthClient(
login: { email, password in
// Real implementation
let response = try await APIClient.shared.request(
endpoint: .login(email: email, password: password)
)
return response.user
},
logout: {
try await APIClient.shared.request(endpoint: .logout)
},
currentUser: {
UserDefaults.standard.currentUser
}
)
public static let testValue = AuthClient(
login: { _, _ in .mock },
logout: {},
currentUser: { .mock }
)
}
extension DependencyValues {
public var authClient: AuthClient {
get { self[AuthClient.self] }
set { self[AuthClient.self] = newValue }
}
}
// LoginFeatureTests.swift
import ComposableArchitecture
import XCTest
@testable import AuthenticationFeature
@MainActor
final class LoginFeatureTests: XCTestCase {
func testLoginSuccess() async {
let store = TestStore(initialState: LoginFeature.State()) {
LoginFeature()
} withDependencies: {
$0.authClient.login = { _, _ in .mock }
}
store.exhaustivity = .off
await store.send(.binding(.set(\.email, "[email protected]"))) {
$0.email = "[email protected]"
}
await store.send(.binding(.set(\.password, "password123"))) {
$0.password = "password123"
}
await store.send(.loginButtonTapped) {
$0.isLoading = true
}
await store.receive(.loginResponse(.success(.mock))) {
$0.isLoading = false
}
await store.receive(.delegate(.loginSucceeded(.mock)))
}
func testLoginFailure() async {
let store = TestStore(initialState: LoginFeature.State()) {
LoginFeature()
} withDependencies: {
$0.authClient.login = { _, _ in
throw AuthError.invalidCredentials
}
}
await store.send(.binding(.set(\.email, "[email protected]")))
await store.send(.binding(.set(\.password, "wrong")))
await store.send(.loginButtonTapped) {
$0.isLoading = true
}
await store.receive(.loginResponse(.failure(.invalidCredentials))) {
$0.isLoading = false
$0.alert = AlertState {
TextState("Login Failed")
} actions: {
ButtonState(role: .cancel) { TextState("OK") }
} message: {
TextState(AuthError.invalidCredentials.localizedDescription)
}
}
}
}
// HomeViewModel.swift
import Combine
import Foundation
@MainActor
final class HomeViewModel: ObservableObject {
@Published private(set) var state: ViewState = .loading
@Published private(set) var dashboardData: DashboardData?
private let apiClient: APIClientProtocol
private var cancellables = Set<AnyCancellable>()
enum ViewState: Equatable {
case loading
case loaded
case error(String)
}
init(apiClient: APIClientProtocol = APIClient.shared) {
self.apiClient = apiClient
}
func loadDashboard() async {
state = .loading
do {
dashboardData = try await apiClient.fetchDashboard()
state = .loaded
} catch {
state = .error(error.localizedDescription)
}
}
func refresh() async {
await loadDashboard()
}
}
// HomeView.swift
import SwiftUI
struct HomeView: View {
@StateObject private var viewModel: HomeViewModel
init(viewModel: HomeViewModel = HomeViewModel()) {
_viewModel = StateObject(wrappedValue: viewModel)
}
var body: some View {
NavigationStack {
Group {
switch viewModel.state {
case .loading:
ProgressView()
case .loaded:
contentView
case .error(let message):
ErrorView(message: message) {
Task { await viewModel.refresh() }
}
}
}
.navigationTitle("Home")
.task {
await viewModel.loadDashboard()
}
.refreshable {
await viewModel.refresh()
}
}
}
private var contentView: some View {
ScrollView {
if let data = viewModel.dashboardData {
LazyVStack(spacing: 16) {
StatCard(title: "Users", value: "\(data.userCount)")
StatCard(title: "Orders", value: "\(data.orderCount)")
}
.padding()
}
}
}
}
disabled_rules:
- trailing_whitespace
- line_length
opt_in_rules:
- array_init
- closure_end_indentation
- closure_spacing
- collection_alignment
- contains_over_first_not_nil
- convenience_type
- empty_count
- empty_string
- explicit_init
- fatal_error_message
- first_where
- force_unwrapping
- implicit_return
- last_where
- literal_expression_end_indentation
- modifier_order
- multiline_arguments
- multiline_parameters
- operator_usage_whitespace
- overridden_super_call
- pattern_matching_keywords
- prefer_self_type_over_type_of_self
- private_action
- private_outlet
- redundant_nil_coalescing
- redundant_type_annotation
- sorted_first_last
- toggle_bool
- trailing_closure
- unneeded_parentheses_in_closure_argument
- vertical_parameter_alignment_on_call
- yoda_condition
excluded:
- Pods
- .build
- DerivedData
- Packages/*/Tests
nesting:
type_level:
warning: 3
function_level:
warning: 5
identifier_name:
min_length: 2
excluded:
- id
- x
- y
- i
- j
type_body_length:
warning: 300
error: 500
file_length:
warning: 500
error: 1000
function_body_length:
warning: 50
error: 100
# Create new Xcode project
# Use Xcode: File > New > Project > iOS > App
# Initialize SPM package for feature
mkdir -p Packages/Features/AuthenticationFeature
cd Packages/Features/AuthenticationFeature
swift package init --name AuthenticationFeature --type library
# Add TCA dependency
# Edit Package.swift to add ComposableArchitecture
# Install SwiftLint (if using Homebrew)
brew install swiftlint
# Create .swiftlint.yml in project root
touch .swiftlint.yml
# Initialize Fastlane
cd /path/to/project
fastlane init
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job