@aurelienbbn/agentlint-plugin-effect

中文文档
0.1.5发布于 2026/10/14MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 2280

Custom agentlint rules for Effect projects.

原始使用文档
文档目录4 节
  1. Quick start
  2. Rules
  3. Registered contract inventory
  4. Credits

@aurelienbbn/agentlint-plugin-effect

npm downloads CI license node

3 agentlint reviews for Effect: Schema-owned contracts, bounded retries, layers built once.

[!WARNING] Requires the engine @aurelienbbn/agentlint >=0.3.0 <0.9.0 as a peer. Evidence.

Quick start

agentlint init --preset "@aurelienbbn/agentlint-plugin-effect#starterPreset"
agentlint rules test
agentlint rules scan --review
agentlint next --format json

init keeps an existing config and prints the install command; never installs. Calibrate bindings before requiring agentlint check --all.

import { defineConfig } from "@aurelienbbn/agentlint";
import { layerIdentity, resiliencePolicy, strictPreset } from "@aurelienbbn/agentlint-plugin-effect";

export default defineConfig({ extends: [strictPreset], rules: [layerIdentity, resiliencePolicy] });

Rules

RulestrictstarterAuthorityStandard revDetector
prefer-schema-contracts✅✅agent22
resilience-policy🧪agent11
layer-identity🧪agent11

✅ in preset · 🧪 opt-in, register explicitly. Presets ignore **/*.d.ts.

export interface User {
  id: string;
} // ❌ prefer-schema-contracts
export type User = (typeof User)["Type"]; // ✅ Schema-derived

Effect.tryPromise({ try: () => fetch(url), catch: toError }); // ❌ resilience-policy
Effect.tryPromise({ try: () => fetch(url), catch: toError }).pipe(Effect.timeout("2 seconds")); // ✅

const makeDbLayer = (config: DbConfig) => Layer.effect(Db, connect(config)); // ❌ layer-identity: new pool per call
const makeConfigLayer = (config: DbConfig) => Layer.succeed(Config, config); // ✅
prefer-schema-contracts: fires, silent spellings, source

Fires on exported interfaces and exported object type aliases, found through the real parser's enclosing export statement. Internal compile-time interfaces and generic helpers may stay manual.

export type User = (typeof User)["Type"]; // ✅ silent
export type UserEncoded = typeof User.Encoded; // ✅ silent
export type User = Schema.Schema.Type<typeof User>; // ✅ silent
export type UserEncoded = Schema.Codec.Encoded<typeof User>; // ✅ silent
export interface User extends Schema.Schema.Type<typeof UserSchema> {} // ✅ silent
// also silent: typeof X["Encoded"], typeof X.Type

The fix for a manual alias: run @effect/tsgo's typeToEffectSchema, typeToEffectSchemaClass, or structuralTypeToSchema (recursive) refactor on it instead of re-typing the Schema by hand.

Spelling source: Effect 4 docs (effect/ai-docs/src/01_effect/02_schema/10_schema-basics.ts in [email protected]) derive types with typeof Contract["Type"] / typeof Contract["Encoded"]; dotted and Schema.Schema.Type<typeof Contract> spellings are recognized too.

resilience-policy: triggers and option
Fires onSilent when
every Effect.retry / Effect.retryOrElse calltest file
Effect.tryPromise, HttpClient.get|post|put|patch|del|head|options|execute callsenclosing statement or function shows a timeout or retry
request.pipe(Effect.retry(Schedule.exponential("100 millis"))); // ❌ fires: no bound

defineResiliencePolicy({ outboundCallPattern }) replaces the outbound call pattern. Effect-dialect sibling of core/boundary-resilience.

layer-identity: triggers and silent cases

Layers are memoized by reference: a factory called at two composition sites builds two pools. Fires on functions, arrows and methods returning a Layer.* expression. Silent: Layer.succeed, Layer.empty, Layer.fresh, LayerMap lookups, test files. The judge counts call sites across the repository.

const tenants = LayerMap.make((tenant: string) => Layer.effect(Db, connect(tenant))); // ✅ silent
Agentlint rule contract
FactDetail
rule shapelifecycle, standard (revision), detector (version), binding (id, authority, scope, material options)
composingdefineConfig({ extends: [preset] }) or defineConfig({ rules: [configuredRule] }); repeated uses need distinct binding ids
authoritydefaults permit agent acceptance; repository owners choose scope and can raise authority to human
accepting a findingrequires matching current evidence and authority
fixtures@aurelienbbn/agentlint/testing runs the embedded activation/silence fixtures with the real parser

Registered contract inventory

Generated from package exports by pnpm catalog. Rule-specific options and limitations are described above and in the source tests.

Rule/checkTrigger or review scope
layer-identityFlags functions that return a newly built Layer so call sites get reviewed for duplicate resource construction.
prefer-schema-contractsFlags exported manual object contracts that need Effect Schema ownership.
resilience-policyFlags Effect.retry policies and outbound Effect calls that show no timeout so the bound, jitter, retryable-only predicate and idempotency get reviewed.

Credits

starterPreset onboarding: conceptual inspiration from desloppify by Peter O'Malley; no code or guidance copied.

版本与发布记录

@aurelienbbn/agentlint-plugin-effect 共发布 6 个版本,首次发布于 2026/09/25;过去 12 个月发布了 6 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.5latest2026/10/1424 天前
0.1.42026/10/1325 天前
0.1.32026/09/301 个月前
0.1.22026/09/301 个月前
0.1.12026/09/251 个月前
0.1.02026/09/251 个月前

关于 @aurelienbbn/agentlint-plugin-effect 的常见问题

@aurelienbbn/agentlint-plugin-effect 是什么?

Custom agentlint rules for Effect projects.

如何安装 @aurelienbbn/agentlint-plugin-effect?

在项目目录运行 npm install @aurelienbbn/agentlint-plugin-effect,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@aurelienbbn/agentlint(>=0.3.0 <0.9.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@aurelienbbn/agentlint-plugin-effect 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aurelienbbn/agentlint-plugin-effect 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@aurelienbbn/agentlint-plugin-effect 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js ^22.19.0 || ^24.11.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@aurelienbbn/agentlint-plugin-effect 可以商用吗?

@aurelienbbn/agentlint-plugin-effect 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@aurelienbbn/agentlint-plugin-effect 的下载量有多少?

根据 npm 官方下载统计,@aurelienbbn/agentlint-plugin-effect 在 2026/10/07 – 2026/11/05 这 30 天内被下载 2,280 次,日均约 76 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aurelienbbn/agentlint-plugin-effect 还在维护吗?

最新版本 0.1.5 发布于 2026/10/14(24 天前);至今共发布 6 个版本,其中过去 12 个月发布了 6 个;首次发布于 2026/09/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。