swift-architecture-skill
Skill7 starsChanged 17 days agoMITView on GitHub
Use when designing, implementing, refactoring, or reviewing the architecture of a SwiftUI or UIKit feature, module, or codebase. Swift iOS architecture guidance and playbooks for MVVM, MVI, TCA, Clean Architecture, VIPER, MVP, Coordinator, and Reactive patterns.
5 other projects use a version of this, 4 of them edited.
Adopted by
Most recently taken up by
- molayab/swift-cli-manageredited, first seen Nov 1, 2026
- VelimirMueller/ai-development-skillsword for word, first seen Nov 1, 2026
- ozgurakkaya90/claude-skillsedited, first seen Aug 2, 2026
- efremidze/swift-architecture-skilledited, first seen Jul 5, 2026
- molayab/swift-ai-provider-kitedited, first seen Mar 17, 2026
Other versions5 projects use a version of this.
Word for word · 1
- VelimirMueller/ai-development-skills★ 7100% same
Edited · 4
- efremidze/swift-architecture-skill★ 7099% same
- molayab/swift-cli-manager★ 370% same
- molayab/swift-ai-provider-kit★ 170% same
- ozgurakkaya90/claude-skills★ 086% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository156 other files it gives its agents.
- skills/swift/swiftui-design-principles/AGENTS.mdAGENTS.md
- skills/swift/ios-code-audit/CLAUDE.mdCLAUDE.md
- skills/swift/swift-focusengine-pro/llms.txtllms.txt
- build-llm-seamSkill
- build-mcp-serverSkill
- build-rag-pipelineSkill
- secure-llm-featuresSkill
- set-up-llm-evalsSkill
- build-nextjs-backendSkill
- build-supabase-edge-functionSkill
- configure-backend-testsSkill
- design-http-apiSkill
- harden-backendSkill
- scaffold-fastapi-serviceSkill
- scaffold-go-serviceSkill
- scaffold-hono-serviceSkill
- secure-supabase-rlsSkill
- set-up-backend-authSkill
- set-up-background-jobsSkill
- set-up-databaseSkill
- set-up-nextjs-supabase-authSkill
- set-up-observabilitySkill
- set-up-supabaseSkill
- build-cliSkill
- release-cliSkill
- set-up-dev-toolchainSkill
- audit-securitySkill
- audit-toolchainSkill
- extend-skillsetSkill
- promote-releaseSkill
- set-up-stack-profileSkill
- write-commit-messagesSkill
- write-pull-requestsSkill
- analyze-complexitySkill
- apply-algorithmsSkill
- apply-design-patternsSkill
- apply-design-principlesSkill
- apply-solidSkill
- choose-data-structureSkill
- debug-systematicallySkill
- enforce-dependency-ruleSkill
- refactor-safelySkill
- slice-and-estimateSkill
- write-clean-testsSkill
- write-readable-codeSkill
- clean-frontend-scaffoldingSkill
- configure-accessibilitySkill
- configure-analyticsSkill
- configure-ciSkill
- configure-error-trackingSkill
- configure-lintingSkill
- configure-test-stackSkill
- configure-typescriptSkill
- create-moduleSkill
- optimize-performanceSkill
- scaffold-frontend-projectSkill
- set-up-authSkill
- set-up-design-systemSkill
- set-up-document-headSkill
- set-up-error-boundariesSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
25 rules. 14 are common, 8 are distinctive, and 3 are very specific to this project.
14
Common
Most of the 4 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 11
Use this skill to pick the best Swift architecture playbook for SwiftUI/UIKit codebases and apply it to the user’s task.
- Common: line 15
Before selecting an architecture, always capture:
- Common: line 25
if the user explicitly names an architecture, treat it as the initial candidate and run a fit check first
- Very specific: line 26
if no architecture is named, load references/selection-guide.md and infer the best fit from the stated constraints
- Distinctive: line 27
if the best fit combines patterns, name one primary playbook for the feature boundary and one secondary playbook for the supporting concern
- Distinctive: line 33
Use this mode when:
- Common: line 59
If the user explicitly names an architecture, treat it as the initial candidate and run a fit check before committing:
- Common: line 61
if it fits, proceed with the requested architecture
- Very specific: line 62
if it mismatches key constraints, explicitly explain the mismatch and recommend the closest-fit alternative from …
- Common: line 63
if the user still insists on a mismatched architecture, proceed with a risk-mitigated plan and state the risks up front
- Very specific: line 79
When the best fit combines patterns, follow Combining Architectures in references/selection-guide.md, read both playbooks, and state which …
- Common: line 83
When code already exists:
- Distinctive: line 90
Do not force an architecture switch for a small feature when the current local pattern is still a reasonable fit.
- Distinctive: line 92
Do not introduce new framework dependencies such as TCA unless the user explicitly accepts that trade-off or the codebase already uses them.
- Distinctive: line 93
Prefer the smallest architecture change that solves the request cleanly.
- Distinctive: line 94
Keep guidance architecture-specific.
- Common: line 99
Read the selected architecture reference and convert its guidance into deliverables tailored to the user's request:
- Common: line 110
Keep recommendations scoped to the requested feature or review task.
- Common: line 111
Prefer protocol-based dependency injection and explicit state modeling.
- Common: line 116
When writing code, include only the patterns relevant to the task — do not dump entire playbooks.
- Common: line 117
Treat reference snippets as illustrative by default.
- Common: line 118
Ask only minimum blocking questions.
- Common: line 119
When reviewing PRs, use the architecture-specific checklist and call out specific violations with line-level fixes.
- Distinctive: line 127
call out migration risk explicitly when recommending an architecture change
- Distinctive: line 132
When updating references, validate:
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 requiresObservableObject) - 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.mdand 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 (
fitormismatch) - 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
- if it mismatches key constraints, explicitly explain the mismatch and recommend the closest-fit alternative from
references/selection-guide.md - if the user still insists on a mismatched architecture, proceed with a risk-mitigated plan and state the risks up front
Architecture reference mapping:
- MVVM (screen-level state with lightweight binding) →
references/mvvm.md - MVI (reducer-style state machines without a framework dependency) →
references/mvi.md - TCA (composable features with strict effect orchestration) →
references/tca.md - Clean Architecture (strict layers and replaceable infrastructure) →
references/clean-architecture.md - VIPER (large UIKit modules with explicit role separation) →
references/viper.md - Reactive (Combine/RxSwift stream-heavy features) →
references/reactive.md - MVP (UIKit passive views with presenter-driven rendering) →
references/mvp.md - Coordinator (navigation flows and deep linking) →
references/coordinator.md
Shared references (load alongside the selected playbook when relevant):
references/concurrency.md: cancellation, stale-response guards, and theuserMessage(for:)error-mapping convention used by playbook snippets; load when writing or reviewing async codereferences/observation.md:@ObservablevsObservableObjectby deployment target; load when wiring SwiftUI state
When the best fit combines patterns, follow Combining Architectures in references/selection-guide.md, read both playbooks, and state which pattern owns each boundary before giving file structure or code.
Analyze Existing Codebase (When Applicable)
When code already exists:
- detect current architecture and DI style
- note concurrency model (async/await, Combine, GCD, mixed)
- align recommendations to local conventions
Guardrails
- Do not force an architecture switch for a small feature when the current local pattern is still a reasonable fit.
- Preserve existing conventions unless the mismatch is severe enough to justify change.
- Do not introduce new framework dependencies such as TCA unless the user explicitly accepts that trade-off or the codebase already uses them.
- Prefer the smallest architecture change that solves the request cleanly.
- Keep guidance architecture-specific; do not blend playbooks unless the boundary between patterns is explicit.
- For combined patterns, avoid merging responsibilities: identify the primary boundary first, then apply the secondary playbook only to its concern.
Produce Concrete Deliverables
Read the selected architecture reference and convert its guidance into deliverables tailored to the user's request:
- File and module structure: directory layout with file names specific to the feature
- State and dependency boundaries: concrete types, protocols, and injection points
- Async strategy: cancellation, actor isolation, and error paths
- Testing strategy: what to test, how to stub dependencies, and example test structure
- Migration path (for refactors): incremental steps to move from current to target architecture
- UI stack adaptation: where SwiftUI and UIKit guidance should differ for the chosen architecture
Output Requirements
- Keep recommendations scoped to the requested feature or review task.
- Prefer protocol-based dependency injection and explicit state modeling.
- Flag anti-patterns found in existing code and provide direct fixes.
- Include cancellation and error handling in all async flows.
- For explicit architecture requests, include a short fit result (
fitormismatch) with 1-2 reasons. - For mismatch cases, include one closest-fit alternative, why it better matches the stated constraints, and one trade-off.
- When writing code, include only the patterns relevant to the task — do not dump entire playbooks.
- Treat reference snippets as illustrative by default; add full compile scaffolding only if the user asks for runnable code.
- Ask only minimum blocking questions; otherwise proceed with explicit assumptions stated up front.
- When reviewing PRs, use the architecture-specific checklist and call out specific violations with line-level fixes.
Verification Checklist
Before finalizing:
- confirm the selected pattern matches the user’s constraints and stack
- confirm dependency injection, state ownership, effects, and testing strategy are covered
- call out migration risk explicitly when recommending an architecture change
- end with the selected architecture’s PR review checklist adapted to the user’s feature
Documentation QA Checklist
When updating references, validate:
- section structure remains consistent (default path, advanced variants, migration notes, testing section with a minimum bar, PR review checklist)
- snippets are internally consistent and compile-plausible
- cross-playbook links point to the correct reference files
- terminology is consistent across selection guide and playbooks
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

