Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计提醒

effect-ts效果 ts

Agent Skill

effect-ts 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,939

周安装

80

GitHub Stars

131

下载量

634
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:effect-ts(效果 ts)
来源仓库:https://github.com/pproenca/dot-skills
仓库路径:skills/effect-ts
安装命令:
npx skills add https://github.com/pproenca/dot-skills --skill effect-ts
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/pproenca/dot-skills --skill effect-ts

简介

用于记录任务执行中的错误、用户纠正和经验缺口,适合让 Agent 持续沉淀问题和修正最佳实践时使用。

  • 适用于效果 ts 相关的信息整理,可结合来源仓库进一步核验用法。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需确认权限范围和维护状态。
  • 安装前建议检查是否会触发联网、命令执行或文件读写,确保操作边界清晰。
  • effect-ts 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Effect TypeScript Best Practices

Effect is a TypeScript library for building complex, type-safe applications with structured error handling, dependency injection via services/layers, fiber-based concurrency, and resource safety.

When to Apply

  • Writing or reviewing TypeScript code that imports from effect, @effect/schema, or @effect/platform
  • Implementing typed error handling with Effect<Success, Error, Requirements>
  • Building services and layers for dependency injection
  • Working with Schema for data validation, decoding, and transformation
  • Using fiber-based concurrency (queues, semaphores, PubSub, deferred)
  • Processing data with Stream and Sink
  • Migrating from Promises, fp-ts, neverthrow, or ZIO to Effect

How to Use

This skill is organized by domain. Read the relevant reference file for the area you're working in.

Read First: The Paradigm

Always read this before diving into API references, especially when refactoring existing code to use Effect or writing new Effect services:

ReferenceWhen to Read
Think in Effect: The Paradigm ShiftBefore any other reference. Mental model shifts, refactoring recipes, anti-patterns, application architecture. Read this to understand HOW to think in Effect — the other files teach WHAT to type.

Core Foundations

ReferenceWhen to Read
Getting StartedCreating the Effect type, pipelines, generators, running effects
Error ManagementTyped errors, recovery, retrying, timeouts, sandboxing
Core ConceptsRequest batching, configuration management, runtime system

Data & Validation

ReferenceWhen to Read
Data TypesOption, Either, Cause, Chunk, DateTime, Duration, Exit, Data
Schema BasicsSchema intro, basic usage, classes, constructors, effect data types
Schema AdvancedTransformations, filters, annotations, error formatting, JSON Schema output

Architecture & Dependencies

ReferenceWhen to Read
Requirements ManagementServices, Layers, dependency injection, layer memoization
Resource ManagementScope, safe resource acquisition/release, caching
State ManagementRef, SubscriptionRef, SynchronizedRef for concurrent state

Concurrency & Streaming

ReferenceWhen to Read
ConcurrencyFibers, Deferred, Latch, PubSub, Queue, Semaphore
Streams and SinksCreating, consuming, transforming streams; sink operations
SchedulingBuilt-in schedules, cron, combinators, repetition

Platform & Observability

ReferenceWhen to Read
PlatformFileSystem, Command, Terminal, KeyValueStore, Path
ObservabilityLogging, metrics, tracing, Supervisor
TestingTestClock for time simulation; for service mocking and layer testing, see Requirements Management

Style, AI & Migration

ReferenceWhen to Read
Code StyleBranded types, pattern matching, dual APIs, guidelines, traits
AI IntegrationEffect AI packages for LLM tool use and execution planning
MicroLightweight Effect alternative for smaller bundles
Migration GuidesComing from Promises, fp-ts, neverthrow, or ZIO

Quick Reference — Common Patterns

The Effect Type

//         ┌─── Success type
//         │        ┌─── Error type
//         │        │      ┌─── Required dependencies
//         ▼        ▼      ▼
Effect<Success, Error, Requirements>

Creating Effects

import { Effect } from "effect"

// From sync values
const succeed = Effect.succeed(42)
const fail = Effect.fail(new Error("oops"))

// From sync code that may throw
const sync = Effect.try(() => JSON.parse(data))

// From promises
const async = Effect.tryPromise(() => fetch(url))

// From generators (recommended for complex flows)
const program = Effect.gen(function* () {
  const user = yield* getUser(id)
  const todos = yield* getTodos(user.id)
  return { user, todos }
})

Running Effects

// Async (returns Promise)
Effect.runPromise(program)

// With full Exit information
Effect.runPromiseExit(program)

// Sync (throws on async)
Effect.runSync(program)

Typed Errors

import { Data, Effect } from "effect"

class NotFound extends Data.TaggedError("NotFound")<{
  readonly id: string
}> {}

class Unauthorized extends Data.TaggedError("Unauthorized")<{}> {}

// Error type is tracked: Effect<User, NotFound | Unauthorized>
const getUser = (id: string) =>
  Effect.gen(function* () {
    // ...
  })

Services and Layers

import { Context, Effect, Layer } from "effect"

// Define a service
class UserRepo extends Context.Tag("UserRepo")<
  UserRepo,
  { readonly findById: (id: string) => Effect.Effect<User, NotFound> }
>() {}

// Use in effects — adds to Requirements channel
const program = Effect.gen(function* () {
  const repo = yield* UserRepo
  return yield* repo.findById("1")
})

// Implement with a Layer
const UserRepoLive = Layer.succeed(UserRepo, {
  findById: (id) => Effect.succeed({ id, name: "Alice" })
})

// Provide and run
program.pipe(Effect.provide(UserRepoLive), Effect.runPromise)

Schema Validation

import { Schema } from "effect"

const User = Schema.Struct({
  id: Schema.Number,
  name: Schema.String,
  email: Schema.String.pipe(Schema.pattern(/@/))
})

type User = typeof User.Type

// Decode (parse + validate)
const decode = Schema.decodeUnknownSync(User)
const user = decode({ id: 1, name: "Alice", email: "a@b.com" })

Pipelines

import { Effect, pipe } from "effect"

// Data-last (pipe style)
const result = pipe(
  getTodos,
  Effect.map((todos) => todos.filter((t) => !t.done)),
  Effect.flatMap((active) => sendNotification(active.length)),
  Effect.catchTag("NetworkError", () => Effect.succeed("offline"))
)

// Fluent (method style)
const result2 = getTodos.pipe(
  Effect.map((todos) => todos.filter((t) => !t.done)),
  Effect.flatMap((active) => sendNotification(active.length))
)

Gotchas

See gotchas.md for known failure points.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.2%
按下载量换算210

Claude

30.12%
按下载量换算191

Cursor

18.59%
按下载量换算118

Gemini CLI

9.63%
按下载量换算61

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/pproenca/dot-skills --skill effect-ts 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills