effect-patterns-services-agents

A collection of Effect-TS patterns for building services and agents in a TypeScript codebase. Effect-TS is a library for organizing asynchronous work, dependencies, and errors in a consistent way.

In plain words
What is it for?
It helps create service modules, agent interfaces, dependency injection, tagged errors, recovery logic, and related tests in the MCP server packages.
Why use it?
It gives developers a shared structure for connecting services and handling failures without scattering setup and error logic throughout the code.

Skill for Claude CodeCodexCursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/pauljphilp/effectpatterns/effect-patterns-services-agents
Any agent
npx skills add PaulJPhilp/EffectPatterns --skill effect-patterns-services-agents
Clone the repo
git clone --depth 1 https://github.com/PaulJPhilp/EffectPatterns

Made for: Claude Code, Codex, Cursor.

Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 531 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00046 $0.00531
Opus 5 $0.00023 $0.00266
Sonnet 5 $0.00009 $0.00106
Haiku 4.5 $0.00005 $0.00053

Measured 2d ago against content hash 1bf6e3840be3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

effect-patterns-services-agents scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/skills/effect-patterns-services-agents/SKILL.md · 89 lines

What it actually says

Effect Patterns – Services & Agents

Effect.Service pattern

Use Effect's Service pattern for composable, type-safe dependency injection:

import { Effect, Context } from "effect"

export class MyService extends Context.Tag("MyService")<MyService, {
  method: () => Effect.Effect<string>
}>() {}

const effect = Effect.gen(function* () {
  const service = yield* MyService
  const result = yield* service.method()
  return result
})

Modern form with Effect.Service:

export class MyAgent extends Effect.Service<MyAgent>()("MyAgent", {
  effect: Effect.gen(function* () {
    return {
      analyze: (input: string) => Effect.succeed("result")
    }
  })
})

Service / agent structure

Use this layout for agents and service modules:

agents/
├── analyzer/
│   ├── api.ts          # Public interface
│   ├── schema.ts       # Type definitions
│   ├── service.ts      # Core logic
│   ├── types.ts        # Domain types
│   └── __tests__/      # Test suite

Error handling as values

Use tagged error types; recover with catchTag:

import { Data } from "effect"

export class APIError extends Data.TaggedError("APIError")<{
  readonly status: number
  readonly message: string
}> {}

Effect.catchTag("APIError", (err) => /* handle */)

Layered service composition

Compose services via Effect.Layer; provide to the app with Effect.provide:

const appLayer = Layer.mergeAll(
  ConfigService.layer,
  CacheService.layer,
  CircuitBreakerService.layer,
  RateLimiterService.layer,
  ReviewCodeService.layer,
)

Effect.provide(appEffect, appLayer)

Conventions in this repo

  • Effect-TS native: Use Effect for composability and error handling.
  • Type safety: Use @effect/schema for types and validation.
  • No path aliases: Use workspace:* dependencies; run from project root.
  • Debug from root: e.g. scripts/debug-blocking.ts for correct module resolution.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 89 lines · 46 tokens per session scan A 1bf6e3840be3

Subscribe to this mod's changes

effect-patterns-services-agents is a skill published in the GitHub repository PaulJPhilp/EffectPatterns (795 stars, last pushed 2mo ago), licensed MIT. It adds 46 tokens to every session and 531 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

effect-ai-tool

Define and implement AI tools using Effect AI's Tool and Toolkit APIs. Use when building LLM integrations with type-safe tool definitions, parameter validation, and handler implementations. Covers user-defined tools, provider-defined tools, and toolkit composition.

mpsuesser/pi-effect-harness · 50 tokens

effect-ai-chat

Build stateful AI chat sessions with the Effect Chat module. Use this skill when implementing multi-turn conversations, agentic tool-calling loops, chat persistence, streaming chat responses, or structured object generation within a conversation context.

mpsuesser/pi-effect-harness · 48 tokens

effect-mcp-server

Build MCP (Model Context Protocol) servers with Effect using McpServer, McpSchema, Tool, and Toolkit. Use this skill when implementing MCP servers that expose tools, resources, and prompts to LLM clients via stdio or HTTP transports.

mpsuesser/pi-effect-harness · 55 tokens

clawhub

Use the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com. Use when you need to fetch new skills on the fly, sync installed skills to latest or a specific version, or publish new/updated skill folders with the npm-installed clawhub CLI.

the-open-agent/openagent · 63 tokens

wiki-agent

Query-driven targeted ingest from a specific AI agent's raw history. Use this skill when the user invokes /wiki-claude, /wiki-codex, /wiki-hermes, /wiki-openclaw, /wiki-copilot, /wiki-pi — with or without a search topic. Different from wiki-history-ingest (which bulk-ingests everything new): this skill finds sessions…

Ar9av/obsidian-wiki · 190 tokens

vault-skill-factory

Generate a portable, self-contained Agent Skill from mature, curated Obsidian wiki pages — turning a cluster of verified knowledge into a reusable "digital expert" (SKILL.md + references/). Use this skill when the user says "/vault-skill-factory", "make a skill from my wiki", "turn these pages into a skill", "generate…

Ar9av/obsidian-wiki · 172 tokens