swift-protocol-di-testing
Installation
SKILL.md
Swift Protocol-Based Dependency Injection for Testing
Patterns for making Swift code testable by abstracting external dependencies behind small, focused protocols.
When to Activate
- Making Swift code testable without real I/O operations
- Abstracting file system, network, or database access behind protocols
- Writing deterministic tests with configurable mock behavior
- Supporting multiple environments (app, tests, previews)
Core Pattern -- Protocol Design
Each protocol handles exactly one external concern: