effect-best-practices

Enforce consistent Effect-TS patterns for services, errors, layers, and observability.

203|9|Updated Dec 23, 2019
One-click install
npx skills add https://github.com/elianiva/dotfiles --skill effect-best-practices-elianiva
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-best-practices
Source: https://github.com/elianiva/dotfiles/tree/main/agents/skills/effect-best-practices
Command: npx skills add https://github.com/elianiva/dotfiles --skill effect-best-practices-elianiva

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the problem of inconsistent architectural patterns across Effect-TS codebases by prescribing an opinionated, standardized set of patterns for services, errors, layers, atoms, and observability to improve maintainability and collaboration.

Core Features & Use Cases

  • Always use Effect.Service for business logic to gain automatic accessors, wiring, and a stable Default layer.
  • Use Schema.TaggedError for errors to enable serialization, type-safe catchTag handling, and precise UI feedback.
  • Emphasize explicit Layer composition and dependency declarations to avoid leaking internals and improve testability.
  • Apply branding with branded IDs, Option handling, and Effect.fn-based tracing for robust observability and type safety.
  • Integrate observability practices (logging, span annotations, and metrics) across services, patterns, and RPC boundaries.
  • Provide reference patterns for service, error, schema, layer, RPC/cluster, and atom patterns to standardize development.

Quick Start

Create a small UserService using Effect.Service with accessors, wire a tagged NotFoundError, and expose a Default layer to serve in an app.

Frequently Asked Questions about effect-best-practices

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

FAQPage Schema
How do I structure services in Effect-TS for better maintainability?

Use Effect.Service for business logic in Effect-TS to gain automatic accessors, dependency wiring, and a stable Default layer. This standardized service pattern improves maintainability and team collaboration across your codebase.

What is the best way to handle errors in Effect-TS?

Schema.TaggedError is the best way to handle errors in Effect-TS. It enables serialization, type-safe catchTag handling, and precise UI feedback, ensuring robust and predictable error management across your application.

How do I compose layers in Effect-TS without leaking internals?

Compose layers explicitly in Effect-TS by declaring dependencies directly. This prevents leaking internal implementation details, ensures clean architectural boundaries, and drastically improves the testability of your services.

How do I add observability and tracing to Effect-TS services?

Add observability to Effect-TS services using Effect.fn-based tracing. Apply span annotations, logging, and metrics across service boundaries and RPC calls to ensure robust monitoring and debuggable performance.

Does this Effect-TS architecture pattern require specific TypeScript setup?

This Effect-TS architecture pattern requires an advanced TypeScript environment. You need explicit usage of core Effect primitives, branded IDs, and Option handling to enforce the standardized service, error, and layer patterns.