mcpField
E
effect-patterns-hub

effect-patterns-hub

github.com/mepukaDevelopment549 installsUpdated 44w ago
Repository

About effect-patterns-hub

effect-patterns-hub is a reference skill for Effect-TS developers, offering searchable implementation examples to find patterns, compare approaches, and learn Effect features. Its topics include error handling, concurrency, streams, and testing.

Key features

  1. 01Access 130+ Effect-TS patterns
  2. 02Find examples by topic and use case
  3. 03Compare approaches to the same problem
  4. 04Cover beginner through advanced patterns
  5. 05Search by keyword and tags

Use cases

  1. 01Find Effect error-handling examples
  2. 02Reference concurrency or stream implementations
  3. 03Design service layers and dependency injection
  4. 04Write tests with mocked dependencies

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/mepuka/effect-ontology --skill effect-patterns-hub

After installing, type/effect-patterns-hubin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

patterns/
_README.review.md
_start_here.json
access-config-in-context.mdx
accessing-current-time-with-clock.mdx
accumulate-multiple-errors-with-either.mdx
add-caching-by-wrapping-a-layer.mdx
add-custom-metrics.mdx
avoid-long-andthen-chains.mdx
beyond-the-date-type.mdx
brand-model-domain-type.mdx
brand-validate-parse.mdx
build-a-basic-http-server.mdx
combinator-conditional.mdx
combinator-error-handling.mdx
combinator-filter.mdx
combinator-flatmap.mdx
combinator-foreach-all.mdx
combinator-map.mdx
combinator-sequencing.mdx
combinator-zip.mdx
comparing-data-by-value-with-structural-equality.mdx
compose-scoped-layers.mdx
conditionally-branching-workflows.mdx
constructor-fail-none-left.mdx
constructor-from-iterable.mdx
constructor-from-nullable-option-either.mdx
constructor-succeed-some-right.mdx
constructor-sync-async.mdx
constructor-try-trypromise.mdx
control-flow-with-combinators.mdx

Details

From the project README

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?"

Comments

Markdown supported