effect-layers-services
Define services, provide layers, compose dependencies, and switch live/test. Use for DI boundaries and app composition.
Best use case
effect-layers-services is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Define services, provide layers, compose dependencies, and switch live/test. Use for DI boundaries and app composition.
Teams using effect-layers-services should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/effect-layers-services/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How effect-layers-services Compares
| Feature / Agent | effect-layers-services | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Define services, provide layers, compose dependencies, and switch live/test. Use for DI boundaries and app composition.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Layers & Services
## When to use
- You need DI boundaries or swapping test/live implementations
- You want to compose infra (logger, db, http) once for the app
## Define Service
```ts
class UserRepo extends Effect.Service<UserRepo>()("UserRepo", {
sync: () => ({ find: (id: string) => Effect.succeed({ id }) })
}) {}
```
## Provide Layer
```ts
const program = Effect.gen(function* () {
const repo = yield* UserRepo
return yield* repo.find("123")
}).pipe(Effect.provide(UserRepo.Default))
```
## Compose
```ts
const AppLayer = Layer.merge(UserRepo.Default, Logger.Default)
```
## Test vs Live
```ts
const layer = process.env.NODE_ENV === "test" ? UserRepoTest : UserRepo.Default
```
## Guidance
- Services define interfaces; Layers bind implementations
- Compose layers at the app boundary; keep handlers unaware of wiring
- Use `.Default` for quick live/test setup; add custom layers as needed
## Pitfalls
- Circular layer dependencies → split modules, provide from above
- Providing layers too deep → centralize to avoid duplication and confusion
## Cross-links
- Foundations: requirement channel `R` and provisioning
- Resources: scoped resources exposed via layers
- EffectPatterns inspiration: https://github.com/PaulJPhilp/EffectPatterns
## Local Source Reference
**CRITICAL: Search local Effect source before implementing**
The full Effect source code is available at `docs/effect-source/`. Always search the actual implementation before writing Effect code.
### Key Source Files
- Layer: `docs/effect-source/effect/src/Layer.ts`
- Effect: `docs/effect-source/effect/src/Effect.ts`
- Context: `docs/effect-source/effect/src/Context.ts`
### Example Searches
```bash
# Find Layer composition patterns
grep -F "Layer.merge" docs/effect-source/effect/src/Layer.ts
grep -F "Layer.provide" docs/effect-source/effect/src/Layer.ts
# Study Effect.Service patterns
grep -F "Effect.Service" docs/effect-source/effect/src/Effect.ts
# Find Context usage
grep -F "Tag" docs/effect-source/effect/src/Context.ts
grep -F "make" docs/effect-source/effect/src/Context.ts
# Look at Layer test examples
grep -F "Layer." docs/effect-source/effect/test/Layer.test.ts
```
### Workflow
1. Identify the Layer or Service API you need
2. Search `docs/effect-source/effect/src/Layer.ts` for the implementation
3. Study the types and composition patterns
4. Look at test files for usage examples
5. Write your code based on real implementations
**Real source code > documentation > assumptions**
## References
- Agent Skills overview: https://www.anthropic.com/news/skills
- Skills guide: https://docs.claude.com/en/docs/claude-code/skillsRelated Skills
microservices-orchestrator
Expert skill for designing, decomposing, and managing microservices architectures. Activates when users need help with microservices design, service decomposition, bounded contexts, API contracts, or transitioning from monolithic to microservices architectures.
managed-db-services
Configure DigitalOcean Managed MySQL, MongoDB, Valkey, Kafka, and OpenSearch for App Platform. Use when setting up non-PostgreSQL databases, configuring trusted sources, or troubleshooting database connectivity.
flox-services
Running services and background processes in Flox environments. Use for service configuration, network services, logging, database setup, and service debugging.
effect-module-resource
Guidance for `effect/Resource` focused on APIs like get, isResource, and auto. Load after `effect-skill-router` when this module is the primary owner.
effect-module-request
Guidance for `effect/Request` focused on APIs like of, fail, and succeed. Load after `effect-skill-router` when this module is the primary owner.
developing-backend-services
Backend service development best practices. Use when designing, building, or reviewing backend services, REST APIs, gRPC services, microservices, webhooks, message queues, or server-side applications regardless of language or framework.
design-microservices
マイクロサービス設計エージェント - ターゲットアーキテクチャ、変換計画、運用計画の策定。/design-microservices [対象パス] で呼び出し。
u01954-handoff-contracting-for-accessibility-services
Operate the "Handoff Contracting for accessibility services" capability in production for accessibility services workflows. Use when mission execution explicitly requires this capability and outcomes must be reproducible, policy-gated, and handoff-ready.
microservices-patterns
Design microservices architectures with service boundaries, event-driven communication, and resilience patterns. Use when building distributed systems, decomposing monoliths, or implementing micros...
microservices-architecture
Microservices architecture patterns and best practices. Use when designing distributed systems, breaking down monoliths, or implementing service communication.
aesthetic-usability-effect
Los diseños atractivos se perciben como más usables. Use cuando justifique inversión en diseño visual, diseñe primeras impresiones, o maneje errores.
Advanced Effect Di Environment
Model dependencies using Effect-style Context, Layer, and Service patterns with compile-time safety. Use when designing DI systems, modeling environments, or building Effect-TS applications.