Platform Layers

Abstract platform-specific services like FileSystem and Path for cross-platform Effect-TS applications.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a robust framework for structuring applications that need to be portable across different runtime environments like Node.js, Bun, and the browser, ensuring consistent behavior and maintainability.

Core Features & Use Cases

  • Platform Agnostic Code: Write application logic that relies on abstract interfaces, not specific platform implementations.
  • Environment-Specific Entry Points: Define platform-specific layers at the application's entry point to provide concrete implementations.
  • Testing with Mocks: Easily test your application logic by providing mock implementations of platform services.
  • Use Case: Develop a command-line tool that reads configuration files and interacts with the file system. This Skill ensures your tool runs seamlessly whether executed with Node.js, Bun, or in a browser-like environment, by abstracting file system and path operations.

Quick Start

Use the platform-layers skill to structure your application for cross-platform compatibility by importing abstractions and providing platform-specific layers at the entry point.

Frequently Asked Questions about Platform Layers

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

FAQPage Schema
How do I structure cross-platform applications with Effect-TS?

To structure cross-platform applications with Effect-TS, you abstract platform-specific services like FileSystem, Path, and Terminal into interfaces. You then provide concrete platform implementations at the environment entry point, keeping domain logic independent of runtimes like Node.js, Bun, or browsers.

How do I test Effect-TS logic that relies on file system operations?

You test Effect-TS file system operations by providing mock implementations of platform services during test execution. This Skill facilitates injecting mock service layers, allowing you to verify domain logic without touching the actual runtime environment.

Can I use the same application logic across Node.js, Bun, and the browser?

Yes, you can run the same application logic across Node.js, Bun, and the browser. By relying on abstract interfaces for platform-specific services, your code remains platform agnostic and behaves consistently across different runtime environments.

What is the best way to isolate domain logic from runtime environments?

The best way to isolate domain logic from runtime environments is through dependency injection. This Skill supports patterns for layer composition and overriding, ensuring your domain code depends only on abstract service interfaces rather than specific platform implementations.

How do I override platform-specific layers at the application entry point?

You override platform-specific layers at the application entry point by defining environment-specific concrete implementations. This Skill provides layer composition patterns that allow you to inject the correct FileSystem or Terminal services for your target runtime.