effect-incremental-migration

Migrate Promise-based modules to Effect services with backward-compatible facades.

22|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/mpsuesser/pi-effect-harness --skill effect-incremental-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-incremental-migration
Source: https://github.com/mpsuesser/pi-effect-harness/tree/main/harnesses/effect/skills/effect-incremental-migration
Command: npx skills add https://github.com/mpsuesser/pi-effect-harness --skill effect-incremental-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Incrementally migrating Promise-based modules to Effect services without breaking existing callers, while making the dependency graph explicit in service and layer design.

Core Features & Use Cases

  • Service Interface Extraction: Convert module methods to Effect.Effect types while keeping signatures aligned with the original Promise API.
  • Layer-Driven Dependency Wiring: Build Layer.effect implementations that capture real requirements via yield*, then compose a defaultLayer for the normal runtime path.
  • Runtime Bridge for Backward Compatibility: Provide temporary async facades via ManagedRuntime and a shared memoMap, then prune once all Effect callers yield the service directly.
  • Call-Site Migration Rules: Replace Effect.promise(() => facade()) with direct yield* Service usage and update error handling from defect-catching to typed channel errors.
  • Pattern Transformations: Migrate Promise.all fan-out to Effect.forEach with explicit concurrency control.

Quick Start

Run the effect-incremental-migration skill to convert your module’s Promise-based functions into a Context Service plus Layer wiring, keeping temporary async facades only until your internal Effect callers yield the service directly.

Frequently Asked Questions about effect-incremental-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate Promise-based modules to Effect without breaking existing callers?

To migrate Promise-based modules to Effect without breaking callers, extract service interfaces returning Effect types, wire dependencies via Layer.effect, and provide temporary async facades using ManagedRuntime with a shared memoMap for backward compatibility.

What is the best way to convert Promise.all fan-out to Effect with concurrency control?

The best way to convert Promise.all fan-out to Effect is by replacing it with Effect.forEach, which allows you to apply explicit concurrency control over the asynchronous operations while maintaining typed error channels.

How do I wire dependencies when building an Effect service from an async module?

To wire dependencies when building an Effect service, use Layer.effect implementations that capture real requirements via the yield* operator, then compose a defaultLayer for the standard runtime execution path.

When should I prune ManagedRuntime facades during an incremental Effect migration?

You should prune ManagedRuntime facades once all internal Effect callers yield the service directly instead of using Effect.promise, eliminating the temporary async bridge and relying fully on typed context services.

How do I update error handling when refactoring async functions to typed effects?

When refactoring async functions to typed effects, update error handling by moving away from defect-catching patterns and routing failures through typed channel errors explicitly declared in your Effect service signatures.

Can I incrementally migrate async modules to Effect if my codebase still uses raw Promises?

Yes, you can incrementally migrate async modules by composing raw and default layers together, allowing your codebase to maintain raw Promise callers while progressively updating call-sites to consume Effect services directly.