effect-platform-abstraction

Replace Node.js/Bun-specific APIs with Effect platform abstractions for cross-platform code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of brittle, environment-specific code caused by using Node.js/Bun globals (like fs, path, child_process, fetch, console) instead of a consistent abstraction layer, so your code runs reliably across Node.js and Bun.

Core Features & Use Cases

  • Cross-platform file I/O using Effect services (FileSystem) rather than direct fs/fs/promises calls.
  • Safe, correct path handling using the Path service instead of manual string concatenation or Node’s path module.
  • Portable process spawning, terminal I/O, HTTP, and caching via Effect platform services like ChildProcessSpawner, Terminal, HttpClient, and KeyValueStore.
  • Type-safe errors and resource safety through Effect’s service and Scope-based design.
  • Use case: When building a CLI or small server that reads config files, calls an HTTP endpoint, and runs subprocesses, apply this skill to keep all I/O code portable and testable.

Quick Start

Apply the effect-platform-abstraction skill while implementing cross-platform code that reads/writes files, spawns processes, makes HTTP requests, or performs terminal I/O in TypeScript with Effect.

Frequently Asked Questions about effect-platform-abstraction

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

FAQPage Schema
How do I write cross-platform TypeScript code that runs unchanged on Node.js and Bun?

Cross-platform TypeScript code requires replacing direct Node.js and Bun APIs with Effect platform abstractions for filesystem and process spawning. Using services like FileSystem, HttpClient, and Terminal ensures your application runs unchanged on both runtimes while keeping behavior consistent and testable.

What is the best way to handle file I/O in TypeScript without using the fs module directly?

The best way to handle file I/O without the fs module is using Effect's FileSystem service. This platform abstraction replaces direct fs or fs/promises calls, providing type-safe errors and resource safety through Effect's service and Scope-based design across Node.js and Bun environments.

Can I use Effect platform services for HTTP requests instead of fetch or axios?

Yes, you can use Effect's HttpClient service instead of fetch or axios for HTTP requests. This platform abstraction provides portable, type-safe network access that runs consistently across Node.js and Bun, avoiding environment-specific bugs caused by direct global API usage.

How do I spawn child processes in a portable way across Node.js and Bun?

To spawn child processes portably across Node.js and Bun, use Effect's ChildProcessSpawner service instead of direct child_process imports. This abstraction ensures consistent process spawning behavior and integrates with Effect's resource management for safe cleanup.

Why does using Node.js path module cause bugs in cross-platform applications?

Using the Node.js path module causes bugs because it couples your code to a specific runtime environment. Replacing it with Effect's Path service provides safe, correct path handling that remains consistent across Node.js and Bun, avoiding manual string concatenation errors.

Do I need specific runtime layers to use Effect platform abstractions for terminal I/O?

Yes, you need appropriate runtime and platform layers like NodeServices or BunServices to use Effect platform abstractions for terminal I/O. These layers provide the environment-specific implementations that back Effect's Terminal service, ensuring consistent behavior across runtimes.