This document details the exact steps an agent must follow to refactor a complex Effect-based orchestrator or worker into the "Functional Core, Imperative Shell" pattern.
Many workers organically grow into a messy, interleaved mix of:
- I/O & Side Effects:
yield* db.findUnique,yield* fetch(...),yield* Effect.logInfo,