ios-swift
Expertise in developing and maintaining the Swift/SwiftUI iOS application.
SKILL.mdtemplates/antigravity/swift/.agents/skills/ios_swift/SKILL.md
GitHubiOS (Swift/SwiftUI) Development Skill
Main Instructions
When working on the iOS app (apps/ios/), you MUST follow these instructions:
1. Before Writing Any Code
- Understand the project structure:
Core/— Shared infrastructure (DI, Network, Extensions, Domain Entities, UI Components).Features/— Feature modules, each with its ownData/,Domain/,Presentation/layers.App/— App entry point and root configuration.
- Identify which feature and layer the change belongs to.
2. Feature Module Structure (ALWAYS Follow)
Every feature in Features/ MUST use this 3-layer convention:
Features/MyFeature/
├── Data/ # Repositories, API data sources
├── Domain/ # Entities, domain models
└── Presentation/ # ViewModels, SwiftUI Views
3. When Adding a New Feature
- Create a new subfolder in
Features/following the 3-layer structure above. - Define domain models in
Domain/. - Create the repository in
Data/(implementAPIClientProtocolfor networking). - Implement the ViewModel in
Presentation/. - Build SwiftUI Views in
Presentation/. - Register any new services/repositories in
Core/DI/DependencyContainer. - Run
make ios-syncto sync the new files into the Xcode project.
4. When Modifying Existing Code
- Check which feature and layer the change belongs to.
- Keep changes within the correct layer boundaries.
- If modifying shared components, update in
Core/UI/Components/. - If modifying networking logic, update in
Core/Network/.
5. Coding Standards
- Use SwiftUI for all UI development.
- Use modern Swift Concurrency (async/await) for all asynchronous operations.
- Follow the Swift API Design Guidelines.
- Use the
DependencyContainer(Core/DI/) for all dependency injection. - Use
APIClientProtocol(Core/Network/) for all network requests. - Ensure all UI components have accessibility labels and support dynamic text sizes.
6. Building & Running
- Open the project:
make ios-open(from root). - Sync new files into Xcode:
make ios-sync. - Connect to the backend using the Mac's LAN IP address (not
localhost) for simulator testing.
Reference Examples
- examples/feature_reference.md: Full end-to-end guide for adding a new feature module (Entity → Protocol → Repo → UseCase → ViewModel → View → DI), based on the actual Tasks implementation.