mpsuesser/pi-effect-harness/effect-context-witness
Claude Code and agent skill by mpsuesser/pi-effect-harness
- community
Checking that the SKILL.md file is still in the repository.
Decide between Context.Service witness and capability patterns for dependency injection, understanding coupling trade-offs
Install
npx vskill@latest install mpsuesser/pi-effect-harness/effect-context-witnessSKILL.md
The same SKILL.md was published earlier as mpsuesser/pi-effect-harness/effect-context-witness.
Context Witness Pattern
Choose between witness (existence) and capability (behavior) patterns for Context.Service definitions.
Coupling: Hard vs Soft
Some coupling is necessary and good - but move it from hard to soft coupling.
Hard Coupling (Schema)
Field exists in the schema - tightly coupled to domain model:
Soft Coupling (Witness)
Field removed from schema, only injected in code:
Key insight: schema (hard coupling) => witness (soft coupling)
By removing the field from the schema and injecting it only where needed, you:
- Keep domain models minimal
- Avoid unnecessary persistence
- Easy to test (provide test serial)
- Easy to remove/change (just change injection)
- Explicit dependencies in type signature
When to use witnesses:
- Correlation IDs (for tracing, not persistence)
- Request IDs (for logging, not data)
- Transaction contexts (for coordination, not storage)
- Tenant/Region markers (for routing, not schema)
Witness: Existence Only
Use when you only need to know something exists in the environment:
Capability: Behavior
Use when you need operations:
Decision Framework
| Need | Pattern | |
|---|---|---|
| Just presence/value | Witness | |
| Operations/generation | Capability | |
| Precondition marker | Witness | |
| Side effects | Capability | |
| Multiple implementations | Capability | |
| Mocking behavior | Capability | |
| Correlation ID | Witness | |
| Transaction context | Witness | |
| Logger | Capability | |
| Database | Capability |
When to Use Witness
Good fits:
- Request ID - must exist for tracing
- Transaction context - must be established
- Tenant/Region - required for data boundary
- Pre-validated tokens - already verified
When to Use Capability
Good fits:
- Serial generation - create/validate operations
- Clock -
now()operation - Logger - structured logging methods
- Database - query/transact operations
- HTTP clients - fetch/post operations
Testing Implications
Witnesses are trivial to provide:
Capabilities need implementation:
Coupling Strategy
Rule of thumb: Remove non-essential fields from schema, inject via witness instead.
Ask yourself: Does this need to be persisted/serialized?
- No → Remove from schema, inject via witness
- Yes → Keep in schema
Benefits:
- Minimal schemas (only persisted data)
- Context values available when needed
- Easy to test with different context
- Can add/remove context without schema changes
- Explicit dependencies in type signatures
Choose witness for simplicity, capability for flexibility.
Security
- Security scanPassed, 93 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingharnesses/effect/skills/effect-context-witness/SKILL.md
Popularity
- Repository stars
- 16
- Repository forks
- 1
- 7-day trend score
- 14
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mpsuesser/pi-effect-harness/effect-context-witness)