effect-context-witness
CommunityDecouple schemas with Context witnesses
Software Engineering#testing#context#schema design#effect-ts#dependency injection#witness pattern#capability pattern
Authormpsuesser
Version1.0.0
Installs0
System Documentation
What problem does it solve?
It helps you stop hard-coupling ephemeral runtime data to your Effect schemas by choosing the right Context pattern—witness (existence/value) versus capability (behavior)—so your domain models stay minimal and persistence-friendly.
Core Features & Use Cases
- Witness pattern for soft coupling: remove non-essential fields from schemas (like request/correlation IDs or transaction markers) and inject them via
Context.Service, keeping persisted data clean. - Capability pattern for operations: model reusable behavior (like generation/validation, clock operations, or logging methods) as a Context service so business logic can depend on functions, not globals.
- Decision framework + testing guidance: apply clear rules for when to use witness vs capability and provide injection strategies that make testing straightforward.
Quick Start
Use effect-context-witness to refactor a Context dependency so non-persisted fields are removed from the schema and provided via a Context.Service witness instead.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: effect-context-witness Download link: https://github.com/mpsuesser/pi-effect-harness/archive/main.zip#effect-context-witness Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.