Agent skill
iOS Architecture
Standards for MVVM, Coordinators, and Clean Architecture (VIP/VIPER).
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/architecture-hoangnguyen0403-agent-skills-standar
Metadata
Additional technical details for this skill
- labels
-
ios architecture mvvm coordinator vips
- triggers
-
{ "files": [ "**/*ViewModel.swift", "**/*Coordinator.swift", "**/*ViewController.swift" ], "keywords": [ "MVVM", "Coordinator", "ViewState", "Output", "Input" ] }
SKILL.md
iOS Architecture Standards
Priority: P0
Implementation Guidelines
MVVM (Model-View-ViewModel)
- ViewModel Responsibility: Handle business logic, formatting, and state. No UIKit imports (except for platform types like
UIImageif strictly necessary). - ViewState: Use a single state object or discrete
@Publishedproperties for UI updates. - Inputs/Outputs: Define explicit protocols or nested types for inputs (events from View) and outputs (state for View).
Coordinator Pattern
- Navigation Logic: Decouple ViewControllers from navigation logic. The Coordinator handles instantiation and push/present.
- Dependency Injection: Pass dependencies (Services, Repositories) through the Coordinator into the ViewModels.
- Child Coordinators: Maintain a hierarchy; remove child coordinators when their flow is finished.
Clean Architecture (VIP/VIPER)
- VIP (Clean Swift): Use Interactor for logic, Presenter for UI formatting, and ViewController for display.
- Unidirectional Flow: Data flows: View -> Interactor -> Presenter -> View.
Anti-Patterns
- Massive View Controller:
**No Logic in VC**: Move business logic to ViewModel/Interactor. - Violating Encapsulation:
**No Public ViewModel State**: Keep state private(set) or using publishers. - Direct Navigation:
**No self.navigationController?.push(...)**: Use a Coordinator.
References
- MVVM-C & VIP Implementation
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?