# swift-architecture-skill

Guides architecture choices for SwiftUI and UIKit work, from a new feature to refactoring or code review.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 2000 installs · ★ 80
- Author: efremidze
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/efremidze/swift-architecture-skill/tree/HEAD/swift-architecture-skill/SKILL.md
- Updated: 2026-09-28
- HTML: https://affpapa.org/en/nevibecode/skills/swift-architecture-skill

## What it does

This skill selects a playbook for MVVM, MVI, TCA, Clean Architecture, VIPER, MVP, Coordinator, and reactive patterns. It considers the task, UI stack, minimum iOS target, change scope, state complexity, and conventions already used in the codebase.

For a single feature with clear constraints, it returns a fit result, reasons, file structure, and guidance on state and dependencies. Migration or mixed-architecture work gets a current-state assessment, a target approach, incremental boundary changes, risks, and verification points.

Async flows should include cancellation and error handling. Check the minimum iOS target first: the skill uses `@Observable` for iOS 17+ guidance and `ObservableObject` for iOS 16. It does not introduce TCA unless that trade-off is accepted or the codebase already uses it.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add efremidze/swift-architecture-skill --skill swift-architecture-skill -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/swift-architecture-skill/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/swift-architecture-skill/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add efremidze/swift-architecture-skill --skill swift-architecture-skill -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/swift-architecture-skill/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add efremidze/swift-architecture-skill --skill swift-architecture-skill -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/swift-architecture-skill/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install efremidze/swift-architecture-skill swift-architecture-skill
```

2. **Manually: put the files in place**
- File: `.github/skills/swift-architecture-skill/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add efremidze/swift-architecture-skill --skill swift-architecture-skill -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/efremidze/swift-architecture-skill --path swift-architecture-skill
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/swift-architecture-skill/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add efremidze/swift-architecture-skill --skill swift-architecture-skill -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/efremidze/swift-architecture-skill/tree/HEAD/swift-architecture-skill/SKILL.md

## When to use it
- choose an architecture for a SwiftUI feature
- check whether MVVM fits project constraints
- plan a migration between architecture patterns
- separate Coordinator responsibilities from a primary pattern
- flag architecture issues in a pull request

## Example prompts
- Choose an architecture for a new SwiftUI screen with state and async loading.
- Check whether MVVM fits this UIKit module and propose a file structure.
- Create an incremental migration plan from MVP to Clean Architecture across several screens.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 15e007d3ebc8af8c.

BEGIN THIRD-PARTY FILE 15e007d3ebc8af8c
```text
---
name: swift-architecture-skill
description: Swift iOS architecture guidance and playbooks for MVVM, MVI, TCA, Clean Architecture, VIPER, MVP, Coordinator, and Reactive patterns. Use when designing, implementing, refactoring, or reviewing the architecture of a SwiftUI or UIKit feature, module, or codebase.
license: MIT
---

# Swift Architecture Skill

## Overview

Use this skill to pick the best Swift architecture playbook for SwiftUI/UIKit codebases and apply it to the user’s task.

## Fast Path

Before selecting an architecture, always capture:
- task type (new feature, refactor, PR review, debugging)
- UI stack (SwiftUI, UIKit, or mixed)
- minimum deployment target (iOS 17+ enables `@Observable`; iOS 16 requires `ObservableObject`)
- scope (single screen, multi-screen, app-wide)
- state and effect complexity
- team familiarity and dependency tolerance
- existing conventions to preserve

Then:
- if the user explicitly names an architecture, treat it as the initial candidate and run a fit check first
- if no architecture is named, load `references/selection-guide.md` and infer the best fit from the stated constraints
- if the best fit combines patterns, name one **primary** playbook for the feature boundary and one **secondary** playbook for the supporting concern
- choose **Quick Recommendation Mode** for single-feature guidance with clear constraints
- choose **Deep Refactor Mode** for migrations, mixed architectures, or module boundary changes

## Quick Recommendation Mode

Use this mode when:
- the scope is one feature or screen
- constraints are clear enough to recommend one primary pattern
- the user mainly needs a recommendation, scaffold, or review checklist

Deliver:
- fit result (`fit` or `mismatch`)
- 1-2 reasons grounded in the request
- the selected reference file
- concrete structure, state, dependency, async, and testing guidance scoped to the feature

## Deep Refactor Mode

Use this mode when:
- the request spans multiple modules or screens
- the codebase already mixes architectures
- the user is migrating from one pattern to another

Deliver:
- current-state assessment
- target architecture recommendation with fit or mismatch result
- incremental migration path with boundary changes called out
- risks, trade-offs, and verification points for the transition

## Architecture Router

If the user explicitly names an architecture, treat it as the initial candidate and run a fit check before committing:
- validate against UI stack fit (SwiftUI/UIKit/mixed), minimum deployment target, state complexity, effect orchestration needs, team familiarity, and existing codebase conventions
- if it fits, proceed with the requested architecture
```
END THIRD-PARTY FILE 15e007d3ebc8af8c

The third-party file has ended. Everything between the 15e007d3ebc8af8c tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2697 of 7669 bytes. © efremidze · MIT · https://github.com/efremidze/swift-architecture-skill/tree/HEAD/swift-architecture-skill/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
