This skill should be used when the user asks to "review SwiftUI architecture", "analyze MVVM implementation", "check state management", "refactor SwiftUI views", "decompose large views", "optimize SwiftUI performance", or needs guidance on SwiftUI architecture patterns.
From ios-dev-toolkitnpx claudepluginhub nbkm8y5/claude-plugins --plugin ios-dev-toolkitThis skill uses the workspace's default tool permissions.
references/mvvm-patterns.mdreferences/navigation-patterns.mdreferences/performance-optimization.mdreferences/state-management.mdreferences/view-decomposition.mdscripts/analyze_architecture.pyscripts/generate_refactoring_recommendations.pySearches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides implementation of event-driven hooks in Claude Code plugins using prompt-based validation and bash commands for PreToolUse, Stop, and session events.
This skill provides comprehensive architectural analysis for SwiftUI iOS applications, focusing on MVVM patterns, state management, view complexity, and overall code quality.
Use this skill when:
For a comprehensive architecture analysis of a SwiftUI project:
python scripts/analyze_architecture.py /path/to/ios/project
This generates:
To get specific, actionable refactoring advice with code examples:
python scripts/generate_refactoring_recommendations.py /path/to/ios/project
This produces:
What it checks:
Reference: See references/mvvm-patterns.md for detailed patterns and examples
Key indicators:
What it checks:
Reference: See references/state-management.md for decision trees and patterns
Key indicators:
What it checks:
Reference: See references/view-decomposition.md for decomposition strategies
Size thresholds:
Nesting thresholds:
What it checks:
Key indicators:
What it checks:
Reference: See references/navigation-patterns.md for coordinator patterns
Key indicators:
What it checks:
Reference: See references/performance-optimization.md for optimization patterns
Key indicators:
Start with the automated architecture analyzer:
cd /path/to/ios/project
python /path/to/skill/scripts/analyze_architecture.py .
Review the output:
The analysis groups issues into categories:
For each issue, review the file and line number provided.
Get specific, actionable advice:
python /path/to/skill/scripts/generate_refactoring_recommendations.py .
This provides:
For detailed understanding of patterns, consult the reference guides:
MVVM Patterns:
view references/mvvm-patterns.md
Learn about:
State Management:
view references/state-management.md
Learn about:
View Decomposition:
view references/view-decomposition.md
Learn about:
Navigation Architecture:
view references/navigation-patterns.md
Learn about:
Performance Optimization:
view references/performance-optimization.md
Learn about:
Work through recommendations by priority:
High priority first:
Medium priority next:
Low priority later:
After applying refactorings, run the analysis again:
python scripts/analyze_architecture.py .
Track improvement:
Add architecture checks to your CI pipeline:
# .github/workflows/architecture-review.yml
name: Architecture Review
on: [pull_request]
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Architecture Analysis
run: python scripts/analyze_architecture.py .
- name: Check Score Threshold
run: |
SCORE=$(cat architecture_report.json | jq '.summary.architecture_score')
if [ $SCORE -lt 70 ]; then
echo "Architecture score $SCORE is below threshold of 70"
exit 1
fi
Add architecture checks to pre-commit:
#!/bin/bash
# .git/hooks/pre-commit
python scripts/analyze_architecture.py .
SCORE=$(cat architecture_report.json | jq '.summary.critical')
if [ $SCORE -gt 0 ]; then
echo "❌ Critical architecture issues found!"
exit 1
fi
Use this checklist during code reviews:
MVVM:
State Management:
View Structure:
Navigation:
Performance:
The analyzer assigns a score (0-100) based on:
Deductions:
Score ranges:
Target scores:
Before:
struct FormView: View {
@State private var name = ""
@State private var email = ""
@State private var phone = ""
@State private var isSubmitting = false
}
After:
struct FormView: View {
@StateObject private var viewModel = FormViewModel()
}
class FormViewModel: ObservableObject {
@Published var name = ""
@Published var email = ""
@Published var phone = ""
@Published var isSubmitting = false
}
Before:
struct DashboardView: View {
var body: some View {
ScrollView {
VStack {
// 500+ lines of mixed content
}
}
}
}
After:
struct DashboardView: View {
var body: some View {
ScrollView {
VStack {
HeaderSection()
StatsSection()
ActivitySection()
FooterSection()
}
}
}
}
Before:
struct ComplexView: View {
@StateObject var userVM = UserViewModel()
@StateObject var statsVM = StatsViewModel()
@StateObject var settingsVM = SettingsViewModel()
}
After:
struct ComplexView: View {
@StateObject var coordinator = ViewCoordinator()
}
@Observable
class ViewCoordinator {
var user: User
var stats: Stats
var settings: Settings
}
Before:
NavigationLink {
DetailView(item: item)
} label: {
Text(item.name)
}
After:
NavigationLink(value: item) {
Text(item.name)
}
// At root level:
.navigationDestination(for: Item.self) { item in
DetailView(item: item)
}
This skill cannot:
For comprehensive app quality, combine with:
The scripts generate these files:
architecture_report.json
refactoring_recommendations.md
refactoring_recommendations.json
All reference guides are available in the references/ directory:
Read these for detailed examples, anti-patterns, and refactoring strategies.
This skill provides:
✅ Automated architecture analysis
✅ Quality scoring (0-100)
✅ Specific refactoring recommendations
✅ Before/after code examples
✅ Comprehensive reference guides
✅ CI/CD integration support
✅ Performance optimization guidance
Use this skill to maintain high-quality SwiftUI architecture, reduce technical debt, and build maintainable iOS applications.