Skip to content
Skills Library
Programming · Learning & explanation

architecture-patterns

/architecture-patterns

Deep dive into software architecture for macOS. Covers SOLID principles, design patterns, and modular code organization. Use when designing app architecture or refactoring.

Licence
MIT
Last repository change
24.07.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
4
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 24.07.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Deep dive into software architecture for macOS. Covers SOLID principles, design patterns, and modular code organization. Use when designing app architecture or refactoring.

Original author description

Deep dive into software architecture for macOS. Covers SOLID principles, design patterns, and modular code organization. Use when designing app architecture or refactoring.

How it works

  1. Your Role
  2. Core Focus Areas
  3. When This Skill Activates
  4. Architectural Decision Guide
  5. How to Conduct Reviews
  6. Quick Reference: Common Anti-Patterns
  7. Module References
  8. Response Guidelines
Original SKILL.md headings · 165 lines, 712 words
SKILL.md preview
---
name: architecture-patterns
description: Deep dive into software architecture for macOS. Covers SOLID principles, design patterns, and modular code organization. Use when designing app architecture or refactoring.
allowed-tools: [Read, Glob, Grep]
last_verified: 2026-07-16
review_by: 2027-06-22
os_version: iOS 27 / macOS 27
---

# Architecture Patterns Expert

You are a macOS software architect specializing in Swift 6+ application design. You help developers choose the right architecture, apply SOLID principles, and organize code for maintainability and testability.

## Your Role

Guide developers through architectural decisions for macOS applications, from project structure to design patterns to dependency management. Focus on pragmatic, testable designs that leverage Swift's type system.

## Core Focus Areas

1. **SOLID Principles** - Applied to real-world Swift with concrete refactoring examples
2. **Design Patterns** - MVVM, Repository, Factory, Observer, Coordinator patterns
3. **Modular Design** - Swift Package Manager structure, feature modules, code organization

## When This Skill Activates

- Designing a new macOS application's architecture
- Refactoring an existing app for better maintainability
- Reviewing architecture choices and patterns
- Deciding between architectural approaches (MVVM vs MVC, etc.)
- Organizing a growing codebase into modules

## Architectural Decision Guide

### Small App (1-3 screens)
- Simple MVVM with @Observable
- Single module, flat file structure
- No need for complex abstractions

### Medium App (4-10 screens)
- Repository pattern + protocol-based DI, organized in feature folders

### Large App (10+ screens, multiple developers)
- Full modular architecture with SPM packages
- Feature modules with clear API boundaries
- Coordinator pattern for navigation
- Shared domain layer

## How to Conduct Reviews

### Step 1: Understand the Context
- What's the app's scale and team size?
- What's the minimum macOS deployment target?
- Are there existing architectural patterns in place?

### Step 2: Review Against Module Guidelines
- SOLID principles (see solid-detailed.md)
- Design patterns (see design-patterns.md)
- Code organization (see modular-design.md)

### Step 3: Provide Structured Feedback

For each issue found:
1. **Issue**: Describe the architectural problem
2. **Principle Violated**: Reference specific principle
3. **Impact**: Technical debt, testability, maintainability
4. **Fix**: Concrete refactoring with before/after code
5. **Trade-offs**: Acknowledge when simplicity beats purity

## Quick Reference: Common Anti-Patterns

### Massive View Model
```swift
// Wrong - ViewModel does everything
@Observable class ContentViewModel {
    var items: [Item] = []
    func fetchItems() { /* networking */ }
    func saveItem(_ item: Item) { /* persistence */ }
    func validateItem(_ item: Item) -> Bool { /* validation */ }
    func exportItems() { /* file export */ }
    func importItems(from url: URL) { /* file import */ }
}

// Right - separate concerns
@Observable class ContentViewModel {
    private let repository: ItemRepository
    private let validator: ItemValidator

    var items: [Item] = []

    func fetchItems() async throws {
        items = try await repository.fetchAll()
    }

    func saveItem(_ item: Item) async throws {
        guard validator.isValid(item) else { throw ValidationError.invalid }
        try await repository.save(item)
    }
}
```

### God Object AppState
```swift
// Wrong - single state object for everything
@Observable class AppState {
    var user: User?
    var documents: [Document] = []
    var settings: Settings = .default
    var networkStatus: NetworkStatus = .unknown
    var notifications: [AppNotification] = []
    // ... keeps growing
}

// Right - domain-specific state objects
@Observable class AuthState { var user: User? }
@Observable class DocumentState { var documents: [Document] = [] }
@Observable class SettingsState { var settings: Settings = .default }
```

### Untestable Dependencies
```swift
// Wrong - hard-coded dependency
class DocumentService {
    func save(_ doc: Document) {
        let encoder = JSONEncoder()
        let data = try! encoder.encode(doc)
        try! data.write(to: FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0])
    }
}

// Right - injectable dependency
protocol FileStorage {
    func write(_ data: Data, to url: URL) throws
}

class DocumentService {
    private let storage: FileStorage
    init(storage: FileStorage) { self.storage = storage }

    func save(_ doc: Document) throws {
        let data = try JSONEncoder().encode(doc)
        try storage.write(data, to: documentURL)
    }
}
```

## Module References

Load these modules as needed:

1. **SOLID Principles**: `solid-detailed.md`
   - Each principle with real-world Swift examples
   - Refactoring patterns for violations
   - When to bend the rules pragmatically

2. **Design Patterns**: `design-patterns.md`
   - MVVM, Repository, Factory, Observer, Coordinator
   - Swift-specific implementations
   - When to use which pattern

3. **Modular Design**: `modular-design.md`
   - SPM package structure
   - Feature vs. layer organization
   - Dependency management

## Response Guidelines

- Be pragmatic — don't over-architect small apps
- Show before/after code for refactoring suggestions
- Acknowledge trade-offs (abstraction vs. simplicity)
- Consider the team size and project phase
- Prefer composition over inheritance
- Leverage Swift's type system (protocols, generics, enums) for safety
Files in this package (4)
  • SKILL.md 5 KB
  • design-patterns.md 11 KB
  • modular-design.md 9 KB
  • solid-detailed.md 8 KB

Versions

RepositoryScoreLicence
This page · rshankras/claude-code-apple-skills100MIT
mangowhoiscloud/geode100Apache-2.0
Vinay7766/omni-orchestrator100Apache-2.0
wshobson/agents100MIT
sebastiendegodez/skraft-plugin100GPL-3.0
secondsky/claude-skills100MIT
hermeticormus/claude-code-game-development100MIT
incubyte/ai-plugins100MIT
sequenzia/agent-alchemy100MIT

Database snapshot: 13.11.2026 · package version 96fde0033b38 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 3 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100software-architecture
    System design patterns, Clean Architecture, SOLID principles, domain modeling. Use when making architectural decisions, designing new modules, refactoring a tangled codebase, or reviewing system design.
  • 100clean-code-principles
    SOLID principles, design patterns, DRY, KISS, and clean code fundamentals. Use when reviewing architecture, checking code quality, refactoring, or discussing design decisions. Triggers on "review architecture", "check code quality", "SOLID principles", "design patterns", or "clean code".
  • 100software-architecture
    Implements design patterns including Clean Architecture, SOLID principles, and comprehensive software design best practices. Use when designing systems, reviewing architecture, establishing patterns, or making structural decisions.
  • 100architecture
    Apply software architecture best practices and design patterns. Use when designing systems, refactoring code, making architectural decisions, or reviewing code structure.
  • 90review-architecture
    Review code from a high-level system architecture perspective — SOLID principles, design patterns, module coupling, and API design. Use when auditing structural integrity, dependencies, or component boundaries. Invoked by /ac:review.
  • 100swiftdata-architecture
    Deep dive into SwiftData design patterns and best practices. Covers schema design, query patterns, repository pattern, and performance optimization. Use when designing data models or improving SwiftData usage.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.