effect-v4

effect-v4 is a skill for Claude Code from zhe-qi/clhoria-template. It costs 43 tokens per session (1,250 once invoked), scanned A, original, MIT.

A guide for using Effect v4, a TypeScript library for structuring asynchronous work, services, dependencies, and typed errors.

In plain words
What is it for?
Use it when creating Effect services, defining typed errors, composing service layers, or wrapping asynchronous operations.
Why use it?
It keeps Effect code consistent with this project's HTTP, validation, database, logging, and queue tools.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when creating Effect services, defining typed errors, composing service layers, or wrapping asynchronous operations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zhe-qi/clhoria-template/effect-v4
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 zhe-qi/clhoria-template --skill effect-v4
Clone the repo
git clone --depth 1 https://github.com/zhe-qi/clhoria-template

Made for: Claude Code.

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-v4

README.md
[![agentmods](https://agentmods.dev/badge/skills/zhe-qi/clhoria-template/effect-v4/github.svg)](https://agentmods.dev/skills/zhe-qi/clhoria-template/effect-v4)
Your own site
<a href="https://agentmods.dev/skills/zhe-qi/clhoria-template/effect-v4"><img src="https://agentmods.dev/badge/skills/zhe-qi/clhoria-template/effect-v4/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-v4

Your own site · 80×15
<a href="https://agentmods.dev/skills/zhe-qi/clhoria-template/effect-v4"><img src="https://agentmods.dev/badge/skills/zhe-qi/clhoria-template/effect-v4.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,250 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00043 $0.01250
Opus 5 $0.00022 $0.00625
Sonnet 5 $0.00009 $0.00250
Haiku 4.5 $0.00004 $0.00125

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

Security

Grade A, and why

effect-v4 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 10d 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.

.agents/skills/effect-v4/SKILL.md · 94 lines

How it starts

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

Effect v4 Best Practices

本 skill 为 Effect v4 (4.0.0-beta.48) 在本项目中的使用提供规范化指南。

技术栈

  • Effect: 4.0.0-beta.48(Context.ServiceData.TaggedErrorLayer
  • HTTP: Hono(非 Effect HttpApi)
  • 验证: Zod v4(非 Effect Schema)
  • ORM: Drizzle(PostgreSQL)
  • 日志: Pino(非 Effect.log)
  • 队列: BullMQ + Redis (ioredis)

文件结构

src/lib/infrastructure/effect/
├── index.ts          # Barrel exports
├── errors.ts         # Data.TaggedError 定义
├── services/         # Context.Service 定义
│   ├── db.ts         # DbService
│   ├── logger.ts     # LoggerService
│   └── bullmq.ts     # BullMQService
└── layers/
    └── live.ts       # InfraLayer = Layer.mergeAll(...)

核心规则速查

类别 DO DON'T
Service 定义 Context.Service<Self, Shape>()("tag") Effect.Service (v3 API)
Service 构造 Layer.succeed(Tag, instance) / Layer.effect(Tag, ...) 在使用处 Effect.provide
错误类型 Data.TaggedError("Tag")<{ fields }> Schema.TaggedError / 普通 Error
错误处理 catchTag / catchTags 按标签匹配 catchAll / mapError 丢失类型
追踪函数 Effect.fn("Service.method")(function* ...) 匿名 generator 无追踪名
异步包装 Effect.tryPromise({ try, catch }) Effect 内部 raw await
错误抛出 yield* Effect.fail(new XxxError(...)) Effect.gen 内 throw
Layer 组合 Layer.mergeAll 平铺同级 深层嵌套 Layer.provide
Layer 链式 Layer.provideMerge 增量组合 多层 Layer.provide(类型爆炸)
执行边界 Effect.runPromise 仅在 Hono handler 入口 Service 内部 runPromise

v3 → v4 迁移对照

v3 v4 说明
Effect.Service<T>()("name", { accessors, dependencies, effect }) Context.Service<T, Shape>()("name") + Layer.succeed/effect Service 类只是标签,Layer 独立构造
accessors: trueService.method() yield* ServiceTagservice.method() 先获取 service 实例再调方法
dependencies: [Dep.Default] Layer.provide(depLayer) / Layer.provideMerge(depLayer) 依赖关系在 Layer 组合时声明
Schema.TaggedError<T>()("tag", { fields }) Data.TaggedError("tag")<{ fields }> 不需要 Schema 字段,用 TS readonly
HttpApiSchema.annotations({ status: 404 }) Hono handler 中 c.json(Resp.fail(...), 404) HTTP 状态码在路由层处理
Config.string("KEY") import env from "@/env" 项目用 Zod 验证的 env
Effect.log("msg") logger.info({ data }, "[Module]: msg") 项目用 Pino
Schema.Option(Schema.String) field: string | null 项目用 Drizzle/Zod 可空类型

Read the full file on GitHub · 94 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago First seen · 94 lines · 43 tokens per session scan A 90ea6587ff4a

Subscribe to this mod's changes

effect-v4 is a skill published in the GitHub repository zhe-qi/clhoria-template (191 stars, last pushed 1mo ago), licensed MIT. It adds 43 tokens to every session and 1,250 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

no-bare-casts

Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.

prisma/orm · 52 tokens

aws-sst-development

SST v4 (Ion) expert for managing AWS resources as code with the Pulumi-backed framework.

sickn33/agentic-awesome-skills · 26 tokens

dd-code-generation

Use pup CLI for immediate Datadog operations or generate code for integration into applications.

DataDog/pup · 16 tokens

fast-typescript-check

Keep www-sacred's TypeScript fast to type-check and fast to run. Use when touching the ASCII/canvas animation components (the only real per-frame code here), tightening type-check wall-clock, or auditing a change for runtime or compiler regressions. Scoped to this repo — a React 19 / Next.js 16 component library plus…

internet-development/www-sacred · 84 tokens

migrate-better-result-3

Migrate a TypeScript codebase from better-result 2.x to 3.0. Use when upgrading better-result across the TaggedError syntax, removed Result serialization helpers, recovery inference, matching, or retry APIs.

dmmulroy/better-result · 52 tokens

typescript-magician

Designs complex generic types, refactors any types to strict alternatives, creates type guards and utility types, and resolves TypeScript compiler errors. Use when the user asks about TypeScript (TS) types, generics, type inference, type guards, removing any types, strict typing, type errors, infer, extends…

mcollina/skills · 108 tokens