platform-abstraction

Abstract file I/O, process spawning, HTTP clients, and terminal operations across Node.js, Bun, and browsers.

68|13|Updated Aug 9, 2025
One-click install
npx skills add https://github.com/kriegcloud/beep-effect --skill platform-abstraction-kriegcloud
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: platform-abstraction
Source: https://github.com/kriegcloud/beep-effect/tree/main/.repos/beep-effect/.claude/skills/platform-abstraction
Command: npx skills add https://github.com/kriegcloud/beep-effect --skill platform-abstraction-kriegcloud

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables you to write code that interacts with the file system, spawns processes, makes HTTP requests, and performs terminal I/O in a way that works seamlessly across Node.js, Bun, and browser environments, eliminating platform-specific code.

Core Features & Use Cases

  • Cross-Platform Compatibility: Write code once and run it anywhere without modification.
  • Type-Safe Error Handling: All operations track errors within the Effect type signature.
  • Resource Safety: Automatic resource cleanup using Effect's Scope.
  • Use Case: Develop a command-line tool that reads a configuration file, processes it, and writes output to another file, ensuring it runs identically whether executed on a developer's macOS machine, a Linux server, or even in a browser environment.

Quick Start

Use the platform-abstraction skill to read the content of the file named 'config.json'.

Frequently Asked Questions about platform-abstraction

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

FAQPage Schema
How do I write cross-platform code for file system and process management in Node.js and Bun?

Cross-platform code for Node.js and Bun uses @effect/platform to provide portable abstractions for file I/O, process spawning, HTTP clients, and terminal operations. This enables identical execution across server and browser environments without platform-specific code.

Does @effect/platform work with browser environments for terminal I/O and HTTP requests?

Yes, @effect/platform works with browser environments for terminal I/O and HTTP requests by providing a unified service system. You can write portable code that functions identically across Node.js, Bun, and browsers.

What is the best way to ensure type-safe error handling when spawning processes across different runtimes?

Type-safe error handling when spawning processes across runtimes is achieved using Effect's service system, which tracks errors within the type signature. This ensures all platform-abstraction operations are type-safe and testable.

How do I manage resource safety and automatic cleanup during cross-platform file I/O operations?

Resource safety and automatic cleanup during cross-platform file I/O operations are managed using Effect's Scope. This mechanism guarantees resources are safely released after operations complete across Node.js, Bun, and browsers.

Can I use a single codebase for command-line tools that read and write files on macOS, Linux, and browsers?

Yes, you can use a single codebase for command-line tools that read and write files on macOS, Linux, and browsers. The platform-abstraction layer ensures the tool runs identically by eliminating platform-specific code for file I/O and terminal operations.

Why does my cross-platform HTTP client implementation break when moving from Node.js to Bun?

Cross-platform HTTP client implementations break moving from Node.js to Bun due to runtime-specific APIs. Using @effect/platform resolves this by providing a unified service system that abstracts HTTP requests to function identically across environments.