effect-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEffect-TS Code Review
Effect-TS代码审查
Orchestrate a multi-agent review of code changes against Effect-TS best practices.
协调多Agent对代码变更进行审查,确保符合Effect-TS最佳实践。
Workflow
工作流
Step 1: Discover Changed Files
步骤1:识别变更文件
Run to find all changed files on the current branch. If that fails (e.g., on main), fall back to or for unstaged changes.
git diff --name-only main...HEADgit diff --name-only HEAD~1git diff --name-onlyList the changed files for the user.
运行查找当前分支的所有变更文件。如果执行失败(例如在main分支上),则回退到,或者使用获取未暂存的变更。
git diff --name-only main...HEADgit diff --name-only HEAD~1git diff --name-only向用户列出所有变更文件。
Step 2: Categorize Files
步骤2:文件分类
Split files into categories:
- Backend Effect files: files NOT ending in
.ts, NOT config files (.test.ts,.config.ts, etc.), NOT UI component library directoriestsconfig - Test files: files
.test.ts - UI files: files
.tsx - Skip: ,
.md,.json,.yml, config files, generated files.css
将文件划分为以下类别:
- 后端Effect文件:不以结尾、不属于配置文件(
.test.ts、.config.ts等)、不属于UI组件库目录的tsconfig文件.ts - 测试文件:文件
.test.ts - UI文件:文件
.tsx - 跳过:、
.md、.json、.yml、配置文件、自动生成的文件.css
Step 3: Launch Sub-Agents in Parallel
步骤3:并行启动子Agent
Based on which categories have files, launch the appropriate agents using the Agent tool. Launch all applicable agents in a single message for maximum parallelism.
If backend Effect files exist, launch these 4 agents in parallel:
- — checks Effect primitives (Array, Match, Option, forEach, no try/catch, no async/await, Layer not Effect.provide)
effect-primitives-reviewer - — checks branded type usage for all entity IDs
branded-types-reviewer - — checks tracing setup (Effect.fn trace names, annotateCurrentSpan, structured logging)
otel-reviewer - — checks error definitions and handling (Schema.TaggedError, catchTag, rich context)
error-reviewer
If test files exist, launch:
- — checks @effect/vitest patterns and assesses coverage gaps
test-coverage-reviewer
If UI files exist, launch:
- — checks component library usage, accessibility, layout, brand consistency
ui-reviewer
For each agent, provide the prompt:
Review the following files for [agent's specialty]. Read each file and produce a structured report with Critical/Warning/Info findings.Files to review:
- [list of file paths]
Also review the reference guide at(relative to this skill) for the detailed checklist.references/[relevant-reference].md
根据存在文件的类别,使用Agent工具启动对应的Agent。为了实现最大并行度,请在单条消息中启动所有适用的Agent。
如果存在后端Effect文件,请并行启动以下4个Agent:
- — 检查Effect原语(Array、Match、Option、forEach、不使用try/catch、不使用async/await、使用Layer而非Effect.provide)
effect-primitives-reviewer - — 检查所有实体ID的branded type使用情况
branded-types-reviewer - — 检查链路追踪配置(Effect.fn trace名称、annotateCurrentSpan、结构化日志)
otel-reviewer - — 检查错误定义与处理(Schema.TaggedError、catchTag、丰富上下文)
error-reviewer
如果存在测试文件,启动:
- — 检查@effect/vitest使用模式,评估覆盖率缺口
test-coverage-reviewer
如果存在UI文件,启动:
- — 检查组件库使用、可访问性、布局、品牌一致性
ui-reviewer
为每个Agent提供如下提示:
针对[Agent的专长领域]审查以下文件。阅读每个文件并输出结构化报告,包含严重/警告/信息级别的发现。待审查文件:
- [文件路径列表]
同时请参考本技能相对路径下的指南获取详细检查清单。references/[相关参考文件].md
Step 4: Unified Report
步骤4:统一报告
After all agents complete, compile results into a single report:
undefined所有Agent执行完成后,将结果整合为单份报告:
undefinedEffect Review Report
Effect Review Report
Effect Primitives
Effect Primitives
[agent output]
[agent output]
Branded Types
Branded Types
[agent output]
[agent output]
OTEL / Observability
OTEL / Observability
[agent output]
[agent output]
Error Handling
Error Handling
[agent output]
[agent output]
Test Coverage
Test Coverage
[agent output]
[agent output]
UI Quality
UI Quality
[agent output]
[agent output]
Summary
Summary
| Category | Critical | Warning | Info |
|---|---|---|---|
| Primitives | X | Y | Z |
| Branded Types | X | Y | Z |
| OTEL | X | Y | Z |
| Errors | X | Y | Z |
| Tests | X | Y | Z |
| UI | X | Y | Z |
| Total | X | Y | Z |
Verdict: PASS / NEEDS WORK / FAIL
Score: X/10
- **PASS**: 0 critical findings
- **NEEDS WORK**: 1-3 critical findings
- **FAIL**: 4+ critical findings| Category | Critical | Warning | Info |
|---|---|---|---|
| Primitives | X | Y | Z |
| Branded Types | X | Y | Z |
| OTEL | X | Y | Z |
| Errors | X | Y | Z |
| Tests | X | Y | Z |
| UI | X | Y | Z |
| Total | X | Y | Z |
Verdict: PASS / NEEDS WORK / FAIL
Score: X/10
- **PASS**:0个严重问题
- **NEEDS WORK**:1-3个严重问题
- **FAIL**:4个及以上严重问题Scoring (0-10)
评分规则(0-10分)
After compiling all findings, assign an overall score from 0 to 10:
- 10: Perfect — no findings at all, exemplary Effect-TS code
- 9: Excellent — only minor info-level suggestions
- 8: Great — a few warnings, no criticals
- 7: Good — several warnings but no criticals
- 6: Acceptable — 1 critical or many warnings
- 5: Needs work — 2-3 criticals
- 4: Below standard — 4-5 criticals
- 3: Poor — 6+ criticals or fundamental pattern violations
- 2: Very poor — majority of code ignores Effect patterns
- 1: Minimal compliance — almost no Effect patterns followed
- 0: No compliance — entirely non-Effect code submitted as Effect code
Display the score prominently at the end of the report.
汇总所有发现后,给出0到10的综合评分:
- 10分:完美 — 无任何问题,是Effect-TS代码的典范
- 9分:优秀 — 仅有次要的信息级建议
- 8分:很好 — 少量警告,无严重问题
- 7分:良好 — 若干警告但无严重问题
- 6分:合格 — 1个严重问题或大量警告
- 5分:需要改进 — 2-3个严重问题
- 4分:低于标准 — 4-5个严重问题
- 3分:较差 — 6个及以上严重问题或存在基础模式违反
- 2分:很差 — 大部分代码未遵循Effect模式
- 1分:最低限度合规 — 几乎未遵循任何Effect模式
- 0分:不合规 — 提交的所谓Effect代码完全不使用Effect相关能力
请在报告末尾显著位置展示评分。
Reference Files
参考文件
Detailed checklists with codebase-specific examples:
- — Effect Array, Match, Option, forEach, Schema, Layer
references/effect-primitives.md - — Branded type usage and known types list
references/branded-types.md - — Tracing, span annotations, structured logging
references/otel-patterns.md - — Schema.TaggedError, catchTag, error context
references/error-patterns.md - — @effect/vitest, it.layer, coverage assessment
references/test-patterns.md - — Effect-Atom React patterns, queries, mutations, Result.builder
references/effect-atom-patterns.md
包含代码库特定示例的详细检查清单:
- — Effect Array、Match、Option、forEach、Schema、Layer
references/effect-primitives.md - — Branded type用法与已知类型列表
references/branded-types.md - — 链路追踪、span注解、结构化日志
references/otel-patterns.md - — Schema.TaggedError、catchTag、错误上下文
references/error-patterns.md - — @effect/vitest、it.layer、覆盖率评估
references/test-patterns.md - — Effect-Atom React模式、查询、变更、Result.builder
references/effect-atom-patterns.md