Prompt Refactor

Extract Protocol Interfaces

Refactor concrete types into protocol-oriented designs for testability and flexibility.

swift
Insert label Protocols
Prompt

Identify concrete dependencies in this code that should be behind protocols. Extract protocol interfaces for services, repositories, and external dependencies. Add protocol extensions with sensible defaults where useful. Show how the protocol enables mock implementations for testing.

Add this to your Facet Inserts in Crystl for one-click access.

Get Crystl