Expert SwiftGen decisions for iOS/tvOS: when type-safe assets add value, template selection trade-offs, organization strategies, and build phase configuration. Use when setting up SwiftGen, choosing templates, or debugging generation issues. Trigger keywords: SwiftGen, type-safe, Asset, L10n, ImageAsset, ColorAsset, FontFamily, swiftgen.yml, structured-swift5, code generation, asset catalog
View on GitHubKaakati/rails-enterprise-dev
reactree-ios-dev
January 25, 2026
Select agents to install to:
npx add-skill https://github.com/Kaakati/rails-enterprise-dev/blob/main/plugins/reactree-ios-dev/skills/swiftgen-integration/SKILL.md -a claude-code --skill swiftgen-integrationInstallation paths:
.claude/skills/swiftgen-integration/# SwiftGen Integration — Expert Decisions
Expert decision frameworks for SwiftGen choices. Claude knows asset catalogs and localization — this skill provides judgment calls for when SwiftGen adds value and configuration trade-offs.
---
## Decision Trees
### When SwiftGen Adds Value
```
Should you use SwiftGen for this project?
├─ > 20 assets/strings
│ └─ YES — Type safety prevents bugs
│ Typos caught at compile time
│
├─ < 10 assets/strings, solo developer
│ └─ MAYBE — Overhead vs. benefit
│ Quick projects may not need it
│
├─ Team project with shared assets
│ └─ YES — Consistency + discoverability
│ Autocomplete reveals available assets
│
├─ Assets change frequently
│ └─ YES — Broken references caught early
│ CI catches missing assets
│
└─ CI/CD pipeline exists
└─ YES — Validate assets on every build
Prevents runtime crashes
```
**The trap**: Using SwiftGen on tiny projects or for assets that rarely change. The setup overhead may exceed the benefit.
### Template Selection
```
Which template should you use?
├─ Strings
│ ├─ Hierarchical keys (auth.login.title)
│ │ └─ structured-swift5
│ │ L10n.Auth.Login.title
│ │
│ └─ Flat keys (login_title)
│ └─ flat-swift5
│ L10n.loginTitle
│
├─ Assets (Images)
│ └─ swift5 (default)
│ Asset.Icons.home.image
│
├─ Colors
│ └─ swift5 with enumName param
│ Asset.Colors.primary.color
│
├─ Fonts
│ └─ swift5
│ FontFamily.Roboto.bold.font(size:)
│
└─ Storyboards
└─ scenes-swift5
StoryboardScene.Main.initialViewController()
```
### Asset Organization Strategy
```
How should you organize assets?
├─ Small app (< 50 assets)
│ └─ Single Assets.xcassets
│ Feature folders inside catalog
│
├─ Medium app (50-200 assets)
│ └─ Feature-based catalogs
│ Auth.xcassets, Dashboard.xcassets
│ Multiple swiftgen inputs
│
├─ Large app / multi-module
│ └─ Per-module asset catalogs
│ Each module owns its assets
│ Module-specific SwiftGen runs
│
└─ Design