What problem does it solve?
This Skill solves the confusion and brittleness that happens when an Effect application accidentally hard-codes platform-specific imports (Node vs Bun) inside business logic, making the codebase harder to reuse and test.
Core Features & Use Cases
- Clear platform boundary (“Golden Rule”): application code depends on abstract Effect services, while platform-specific wiring happens at entry points or adapter modules via
defaultLayer.
- Node vs Bun runtime integration guidance: shows the correct
provide(NodeServices.layer | BunServices.layer) pattern with the matching runtime runner.
- Layer composition and overriding: demonstrates how to merge multiple layers, add custom services, and override platform services in a predictable order for tests and applications.
- Mocking strategy for tests: emphasizes using mock abstract services (e.g.,
Layer.succeed / FileSystem.makeNoop) instead of importing platform modules during unit tests.
Quick Start
Use effect-platform-layers to restructure your app so domain/services import abstract services from effect, then wire NodeServices.layer or BunServices.layer only in your entry point with NodeRuntime.runMain or BunRuntime.runMain.