Agent skill

Effect V4

by zhe-qi in zhe-qi/clhoria-template

Effect v4 模式指南。当需要创建 Effect 服务、定义错误类型、编写 Effect 程序、管理 Layer 组合、或使用 Effect 封装异步操作时使用

MITAuto-check passedDatabases

Install Effect V4

skills CLI
$ npx skills add zhe-qi/clhoria-template --skill effect-v4 -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install zhe-qi/clhoria-template effect-v4 --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/zhe-qi/clhoria-template.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/effect-v4 .claude/skills/effect-v4 && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
effect-v4
GitHub stars
193
Token cost
~887 tokens
SKILL.md length
228 words
Files
6 (incl. references)
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

Effect v4 模式指南。当需要创建 Effect 服务、定义错误类型、编写 Effect 程序、管理 Layer 组合、或使用 Effect 封装异步操作时使用

  • Databases work in your project
  • SKILL.md covers 技术栈, 文件结构, 核心规则速查 and v3 → v4 迁移对照, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Effect V4 is an agent skill from zhe-qi/clhoria-template. Effect v4 模式指南。当需要创建 Effect 服务、定义错误类型、编写 Effect 程序、管理 Layer 组合、或使用 Effect 封装异步操作时使用

Its SKILL.md is about 890 tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/anti-patterns.md`, `references/effect-composition.md` and `references/error-patterns.md`).

It sits in Databases. It works with Hono and Zod. The repository describes itself as: Production-ready Hono backend template that doubles as an AI agent harness — providing feedforward guides, feedback sensors, and progressive specialization to make AI coding… The licence is MIT.

When your agent uses it

  • Databases work in your project

Example prompts

  • “/effect-v4”

What it can do on your machine

Read from SKILL.md and the folder at commit 589f13e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Effect V4 loads about 887 tokens when it runs, and up to ~9.3k if it reads all its reference files. Until then it costs about 23 tokens; SKILL.md has 228 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~23
When it runs · the whole SKILL.md, loaded when a task matches
~887
With references · SKILL.md plus every file in references/, read only if the agent opens them
~9.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from zhe-qi/clhoria-template at commit 589f13e, republished under its MIT licence (© zhe-qi). 228 words, ~887 tokens.

Download SKILL.mdSave it as .claude/skills/effect-v4/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
effect-v4
description
Effect v4 模式指南。当需要创建 Effect 服务、定义错误类型、编写 Effect 程序、管理 Layer 组合、或使用 Effect 封装异步操作时使用
argument-hint
[service/error/layer/pattern]

Effect v4 Best Practices

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

技术栈

  • Effect: 4.0.0-beta.48(Context.Service、Data.TaggedError、Layer)
  • 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(...)

核心规则速查

类别DODON'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 迁移对照

v3v4说明
Effect.Service<T>()("name", { accessors, dependencies, effect })Context.Service<T, Shape>()("name") + Layer.succeed/effectService 类只是标签,Layer 独立构造
accessors: true → Service.method()yield* ServiceTag → service.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 可空类型

与项目集成

Effect 在本项目中的定位是 基础设施编排层,不是全栈框架。边界清晰:

Hono Handler (async/await)
  └─ Effect.runPromise(program)    ← 边界:进入 Effect 世界
       └─ Effect.gen(function* () {
            const db = yield* DbService;     ← 获取 service
            const result = yield* Effect.tryPromise(...);  ← 异步操作
            return result;
          })

入口点(允许 Effect.runPromise):

  • Hono route handler
  • BullMQ Worker processor
  • Bootstrap 初始化
  • Singleton destroy 回调

Service 内部(禁止 Effect.runPromise):

  • 返回 Effect.Effect<A, E, R>
  • 用 yield* 组合其他 Effect
  • 用 Effect.tryPromise 包装异步

参考文档

© zhe-qi, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in .agents/skills/effect-v4 of zhe-qi/clhoria-template.

  • SKILL.md
  • references/anti-patterns.md
  • references/effect-composition.md
  • references/error-patterns.md
  • references/resource-management.md
  • references/service-patterns.md

Open the folder on GitHubat commit 589f13e

Compare with similar skills

Effect V4 next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Effect V4 compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Effect V4 this skillzhe-qi/clhoria-template193—~887Automated safety check: PassMIT
Backend ExpertCaoMeiYouRen/caomei-auth220—~329Automated safety check: PassMIT
Hono Idiomsirahardianto/awesome-agv157—~3kAutomated safety check: PassMIT
Hono Routingsecondsky/claude-skills227—~3.6kAutomated safety check: PassMIT
Typescript Idiomsirahardianto/awesome-agv157—~6.1kAutomated safety check: PassMIT
Better Drizzlealmeidazs/better-drizzle348—~1.7kAutomated safety check: PassApache-2.0

Similar skills

  • Backend Expert

    CaoMeiYouRen/caomei-auth

    设计或实现后端 API、服务层、数据库读写、鉴权权限控制、输入校验、事务处理与错误处理时使用。用户提到 API、route、handler、server、auth、permission、drizzle、database、zod、Hono、Nuxt server routes、backend bug 修复时都应触发。

    220 GitHub stars~329 tokensUpdated 8 days ago
    DatabasesAuto-check passed
  • Hono Idioms

    irahardianto/awesome-agv

    Hono lightweight web framework patterns: type-safe route handlers, middleware composition, Zod validation, and RPC clients for Cloudflare Workers, Node, or Bun.

    157 GitHub stars~3k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Hono Routing

    secondsky/claude-skills

    Type-safe Hono APIs with routing, middleware, RPC. An agent skill from secondsky/claude-skills.

    227 GitHub stars~3.6k tokensUpdated 11 days ago
    DevelopmentAuto-check passed
  • Typescript Idioms

    irahardianto/awesome-agv

    TypeScript strict typing: type narrowing, discriminated unions, Zod runtime validation, generic utility types, and Vitest testing.

    157 GitHub stars~6.1k tokensUpdated 4 days ago
    Testing & QAAuto-check passed
  • Better Drizzle

    almeidazs/better-drizzle

    Write, review, and debug code that uses better-drizzle, the typed repository layer over Drizzle ORM 1.x (better(db), client.users.findMany, paginate, cursor, upsertMany, relation include/connect…

    348 GitHub stars~1.7k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Add Backend

    ahpxex/open-dashboard

    Everything about the data layer — pick one of six ready-to-run backend templates (TanStack Start + Drizzle + better-auth, Hono + Drizzle + better-auth, Hono + Prisma + better-auth, Hono + Drizzle +…

    146 GitHub stars~3.6k tokensUpdated 3 mo ago
    DatabasesAuto-check passed

More from zhe-qi/clhoria-template

All 10 skills in this repo
  • Bullmq

    zhe-qi/clhoria-template

    创建或修改 BullMQ 队列任务。当需要创建新队列、添加任务类型、注册 Worker、设置定时任务、或用户请求"添加后台任务/队列处理"时使用

    193 GitHub stars~1.6k tokensUpdated 2 mo ago
    Auto-check passed
  • Create Tier

    zhe-qi/clhoria-template

    创建或修改一个新的 API tier。当用户请求“新增 tier / 创建 partner tier / 新增 merchant 端 / 新增 tenant 端 / 新增 API 端 / 新增一套路由层”时使用。目标是在不修改框架核心的前提下,为新 tier 补齐配置、中间件、类型别名、路由入口和测试。

    193 GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check: notes
  • Crud

    zhe-qi/clhoria-template

    创建或修改 CRUD 模块。当需要创建新的增删改查 API、修改现有路由模块、添加新字段、新增接口、或用户请求"创建/修改 XX 管理"时使用

    193 GitHub stars~552 tokensUpdated 2 mo ago
    Auto-check passed
  • DB Schema

    zhe-qi/clhoria-template

    创建或修改数据库 Schema。当需要创建新表、修改表结构、定义字段、设置索引约束、或涉及 Drizzle ORM / drizzle-zod 操作时使用

    193 GitHub stars~620 tokensUpdated 2 mo ago
    Auto-check passed
  • Drizzle V1

    zhe-qi/clhoria-template

    Drizzle ORM v1 关系查询指南。当需要定义 Relations v2、编写关系查询、使用 through 多对多、预定义过滤器、或从旧版 Drizzle 迁移时使用

    193 GitHub stars~3k tokensUpdated 2 mo ago
    Auto-check passed
  • Source Command Opsx Explore

    zhe-qi/clhoria-template

    Enter explore mode - think through ideas, investigate problems, clarify requirements

    193 GitHub stars~1.6k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Categories

Questions about Effect V4

What does Effect V4 do?

Effect v4 模式指南。当需要创建 Effect 服务、定义错误类型、编写 Effect 程序、管理 Layer 组合、或使用 Effect 封装异步操作时使用. Effect V4 is an agent skill from zhe-qi/clhoria-template.

When should I use Effect V4?

Effect V4 fits situations like: databases work in your project.

How do I install Effect V4 in Claude Code?

Run `npx skills add zhe-qi/clhoria-template --skill effect-v4 -a claude-code`. Or copy the skill folder (.agents/skills/effect-v4 in zhe-qi/clhoria-template) into .claude/skills/effect-v4 in your project. Claude Code loads it when a task matches its description.

How do I install Effect V4 in Codex?

Run `npx skills add zhe-qi/clhoria-template --skill effect-v4 -a codex`. Or copy the skill folder (.agents/skills/effect-v4 in zhe-qi/clhoria-template) into .agents/skills/effect-v4 in your project. Codex loads it when a task matches its description.

Can I use Effect V4 in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zhe-qi/clhoria-template --skill effect-v4 -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/effect-v4, .gemini/skills/effect-v4, .github/skills/effect-v4 and .opencode/skills/effect-v4 in your project.

What does Effect V4 need to run?

SKILL.md names no scripts, command-line tools or credentials: Effect V4 is instructions for the agent only.

Does Effect V4 access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Effect V4 safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Effect V4 use?

Effect V4 is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Effect V4 use?

About 887 tokens (SKILL.md is roughly 3.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 8.4k tokens, read only when the agent opens those files.

What are the alternatives to Effect V4?

Skills that share tags, products or a category with Effect V4: Backend Expert (CaoMeiYouRen/caomei-auth, 220 stars), Hono Idioms (irahardianto/awesome-agv, 157 stars), Hono Routing (secondsky/claude-skills, 227 stars) and Typescript Idioms (irahardianto/awesome-agv, 157 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Effect V4?

zhe-qi (a GitHub user) maintains it in zhe-qi/clhoria-template, which has 193 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on July 30, 2026.

Source: zhe-qi/clhoria-template on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.