effect-domain-modeling

effect-domain-modeling is a skill for Claude Code, Codex from mpsuesser/pi-effect-harness. It costs 48 tokens per session (7,491 once invoked), scanned A, original, MIT.

A pattern for defining business data types in Effect, including entities, value objects, and alternatives grouped into one type. It uses schemas to describe, validate, and distinguish those alternatives at runtime.

In plain words
What is it for?
Use it to model orders, users, workflow states, errors, and other business concepts that can have several distinct forms.
Why use it?
It reduces repeated code and makes invalid or ambiguous domain data easier to detect. The accompanying checks and matching functions make it clearer how each possible data case is handled.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to model orders, users, workflow states, errors, and other business concepts that can have several distinct forms.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mpsuesser/pi-effect-harness/effect-domain-modeling
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.

Any agent
npx skills add mpsuesser/pi-effect-harness --skill effect-domain-modeling
Clone the repo
git clone --depth 1 https://github.com/mpsuesser/pi-effect-harness

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for effect-domain-modeling

README.md
[![agentmods](https://agentmods.dev/badge/skills/mpsuesser/pi-effect-harness/effect-domain-modeling/github.svg)](https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-domain-modeling)
Your own site
<a href="https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-domain-modeling"><img src="https://agentmods.dev/badge/skills/mpsuesser/pi-effect-harness/effect-domain-modeling/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for effect-domain-modeling

Your own site · 80×15
<a href="https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-domain-modeling"><img src="https://agentmods.dev/badge/skills/mpsuesser/pi-effect-harness/effect-domain-modeling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,491 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00048 $0.07491
Opus 5 $0.00024 $0.03746
Sonnet 5 $0.00010 $0.01498
Haiku 4.5 $0.00005 $0.00749

Measured 9d ago against content hash 406e7181436d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

effect-domain-modeling 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 9d 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.

harnesses/effect/skills/effect-domain-modeling/SKILL.md · 1,213 lines

How it starts

The opening of the file, as written. The whole thing — 1,213 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Effect Domain Modeling Skill

Use this skill when creating domain models, entities, value objects, or any types that represent core business concepts. This skill covers the complete lifecycle from type definition to runtime utilities.

Effect Source Reference

The Effect v4 source is available at ~/.cache/effect-v4/. Browse and read files there directly to look up APIs, types, and implementations.

Reference this for:

  • Full Schema API: packages/effect/SCHEMA.md
  • Match source: packages/effect/src/Match.ts
  • Migration guide: MIGRATION.md
  • Effect source: packages/effect/src/

Core Pattern: Schema.TaggedStruct

The foundation of Effect domain modeling combines two key features:

  1. Schema.TaggedStruct - Automatic _tag discriminator for union types
  2. Schema.decodeSync - Type-safe constructors with validation

In v4, Equal.equals performs deep structural comparison by default, so no special wrapping (like the removed Schema.Data) is needed.

import { Schema, Equal } from 'effect';

// Define each variant with TaggedStruct
export const Pending = Schema.TaggedStruct('pending', {
	id: Schema.String,
	createdAt: Schema.DateTimeUtc
});

export const Active = Schema.TaggedStruct('active', {
	id: Schema.String,
	createdAt: Schema.DateTimeUtc,
	startedAt: Schema.DateTimeUtc
});

export const Completed = Schema.TaggedStruct('completed', {
	id: Schema.String,
	createdAt: Schema.DateTimeUtc,
	completedAt: Schema.DateTimeUtc
});

// Union type
export const Task = Schema.Union([Pending, Active, Completed]);

export type Task = Schema.Schema.Type<typeof Task>;

// Export member types for refinements
export type Pending = Schema.Schema.Type<typeof Pending>;
export type Active = Schema.Schema.Type<typeof Active>;
export type Completed = Schema.Schema.Type<typeof Completed>;

Use Schema.annotate(...) selectively for public or widely reused schemas when the metadata is actually consumed. Local or still-evolving domain schemas can stay unannotated.

Read the full file on GitHub · 1,213 lines

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. 9d ago First seen · 1,213 lines · 48 tokens per session scan A 406e7181436d

Subscribe to this mod's changes

effect-domain-modeling is a skill published in the GitHub repository mpsuesser/pi-effect-harness (24 stars, last pushed 2mo ago), licensed MIT. It adds 48 tokens to every session and 7,491 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.