skills/mepuka/effect-ontology/effect-patterns-hub

effect-patterns-hub

SKILL.md

Effect Patterns Hub

Purpose: Provide quick access to 130+ curated Effect-TS patterns from the EffectPatterns repository. Use this skill to find specific implementation patterns, compare approaches, and reference best practices.

Triggers

  • Looking for a specific Effect pattern or idiom
  • Need real-world examples of Effect concepts
  • Want to see multiple approaches to the same problem
  • Comparing implementation strategies
  • Learning new Effect features

Pattern Library Location

Local Patterns: .claude/skills/effect-patterns-hub/patterns/
Documentation: docs/effect-patterns/
Count: 130+ patterns in MDX format

Quick Decision Tree

I need to...

Create Effects

Transform & Compose

Control Flow

Error Handling

Concurrency

Services & Dependency Injection

Resource Management

Streaming

Schema & Validation

Data Types

Pattern Matching

HTTP & Web

Testing

Observability

Runtime & Execution

Configuration

Time & Scheduling

Project Setup

Advanced Concepts

Pattern Categories

By Skill Level

Beginner (Getting Started)

  • Constructor patterns (succeed, fail, sync, async)
  • Basic combinators (map, flatMap, tap)
  • Simple error handling (catch, catchTag)
  • Effect.gen basics
  • runPromise/runSync

Intermediate (Building Applications)

  • Services and layers
  • Schema validation
  • HTTP servers and clients
  • Resource management
  • Concurrency basics (Effect.all, fork)
  • Testing with mocks

Advanced (Production Systems)

  • Complex layer composition
  • Custom runtimes
  • Streaming pipelines
  • Graceful shutdown
  • OpenTelemetry integration
  • Performance optimization (Chunk, Ref)

By Use Case

Domain Modeling

  • Schema definitions
  • Brand types
  • Tagged errors
  • Option/Either for optional/fallible values

API Development

  • HTTP server setup
  • Route handling
  • Request validation
  • Error handling
  • Response formatting

Data Processing

  • Stream processing
  • Batch operations
  • Parallel processing
  • Resource-safe pipelines

Application Architecture

  • Service layer design
  • Dependency injection
  • Module composition
  • Configuration management

Testing

  • Mock layers
  • Test utilities
  • Testable services

Observability

  • Structured logging
  • Distributed tracing
  • Custom metrics
  • Performance monitoring

Search Patterns

By Keyword

Use Grep to search patterns by keyword:

# Find patterns about error handling
grep -l "error" patterns/*.mdx

# Find patterns about concurrency
grep -l "concurrent\|parallel\|fiber" patterns/*.mdx

# Find patterns about HTTP
grep -l "http\|server\|client" patterns/*.mdx

# Find patterns about testing
grep -l "test\|mock" patterns/*.mdx

By Frontmatter Tags

All patterns include metadata:

  • title: Human-readable name
  • id: Unique identifier (filename without extension)
  • skillLevel: beginner, intermediate, advanced
  • useCase: domain-modeling, error-handling, concurrency, etc.
  • summary: Brief description
  • tags: Keywords for searching
  • related: Links to related patterns

Common Searches

"How do I create an Effect from..."

  • → Search constructor patterns: grep -l "constructor" patterns/*.mdx
  • → Check constructor-*.mdx files

"How do I handle errors when..."

  • → Search error handling: grep -l "error\|catch\|retry" patterns/*.mdx
  • → Check handle-*.mdx and pattern-catchtag.mdx

"How do I run multiple things concurrently?"

  • → Search concurrency: grep -l "concurrent\|parallel\|all\|fork" patterns/*.mdx
  • → Check run-effects-in-parallel-with-all.mdx

"How do I work with services?"

  • → Search services: grep -l "service\|layer\|dependency" patterns/*.mdx
  • → Check model-dependencies-as-services.mdx, understand-layers-for-dependency-injection.mdx

"How do I validate data?"

  • → Search schema: grep -l "schema\|validate\|parse" patterns/*.mdx
  • → Check define-contracts-with-schema.mdx, parse-with-schema-decode.mdx

Integration with Other Skills

Foundations → Patterns Hub

When you need concrete examples for foundation concepts, check patterns:

  • effect-foundations teaches concepts → patterns show implementation

Architect → Patterns Hub

When designing systems, reference architectural patterns:

  • Layer composition → organize-layers-into-composable-modules.mdx
  • Service design → model-dependencies-as-services.mdx
  • Scoped resources → scoped-service-layer.mdx

Engineer → Patterns Hub

When implementing features, find relevant patterns:

  • HTTP endpoints → handle-get-request.mdx, validate-request-body.mdx
  • Error handling → retry-based-on-specific-errors.mdx
  • Concurrency → run-effects-in-parallel-with-all.mdx

Tester → Patterns Hub

When writing tests, reference testing patterns:

  • Mock services → mocking-dependencies-in-tests.mdx
  • Test layers → use-default-layer-for-tests.mdx
  • Testable design → write-tests-that-adapt-to-application-code.mdx

Usage Workflow

  1. Identify Need: "I need to [do something] with Effect"
  2. Check Decision Tree: Find relevant section above
  3. Read Pattern: Use Read tool on the pattern file
  4. Adapt to Context: Apply pattern to your specific use case
  5. Check Related: Follow related links in pattern frontmatter
  6. Consult Agent: If unclear, use @effect-engineer or @effect-architect

Anti-Pattern Detection

If you find yourself:

  • Using imperative loops → Check process-collection-in-parallel-with-foreach.mdx
  • Mixing promises and Effects → Check constructor-try-trypromise.mdx, solve-promise-problems-with-effect.mdx
  • Long andThen chains → Check avoid-long-andthen-chains.mdx, use-gen-for-business-logic.mdx
  • Leaking requirements → Check model-dependencies-as-services.mdx
  • Manual resource cleanup → Check safely-bracket-resource-usage.mdx

Pattern File Structure

Each pattern file follows this structure:

---
title: Human-readable title
id: kebab-case-id
skillLevel: beginner | intermediate | advanced
useCase: primary-use-case
summary: Brief description
tags:
  - keyword1
  - keyword2
related:
  - related-pattern-id-1
  - related-pattern-id-2
author: Author name
---

# Title

## Guideline
What to do

## Rationale
Why do it this way

## Good Example
✅ Recommended approach

## Bad Example
❌ What to avoid

## Related Patterns
Links to related patterns

Maintenance

Patterns are synced from EffectPatterns repository.

To update patterns:

cd /tmp
git clone --depth=1 https://github.com/PaulJPhilp/EffectPatterns.git
cp -r EffectPatterns/content/published/* /Users/pooks/Dev/crate/.claude/skills/effect-patterns-hub/patterns/
cp -r EffectPatterns/content/published/* /Users/pooks/Dev/crate/docs/effect-patterns/

Summary

  • 130+ patterns covering all Effect-TS concepts
  • Decision tree for quick pattern lookup
  • Integration with existing skills and agents
  • Searchable by keyword, use case, skill level
  • Examples showing good and bad practices
  • Related patterns for deeper exploration

Use this skill as your go-to reference for "How do I... with Effect?"

Weekly Installs
34
GitHub Stars
5
First Seen
Jan 23, 2026
Installed on
opencode28
gemini-cli27
github-copilot27
codex27
cursor25
kimi-cli23