PR reviews catch real changes
Text diffs say “3 lines changed”. The semantic diff says “retry removed, DbService added,
error path now uncaught”. Stop merging behaviour drift on autopilot.
export const transferWorkflow = (
fromAccountId: string,
toAccountId: string,
amount: number,
) =>
Effect.gen(function* () {
const accounts = yield* AccountService
const audit = yield* AuditLog
const balance = yield* accounts.getBalance(fromAccountId)
if (balance < amount) {
return yield* Effect.fail(
new InsufficientFundsError(balance, amount)
)
}
yield* accounts.debit(fromAccountId, amount)
yield* accounts.credit(toAccountId, amount)
yield* audit.record(`Transferred ${amount}`)
})
Same function. 5 seconds to grok, not 5 minutes and your CI
catches it the moment someone removes AuditLog or swaps sequential for parallel.
PR reviews catch real changes
Text diffs say “3 lines changed”. The semantic diff says “retry removed, DbService added,
error path now uncaught”. Stop merging behaviour drift on autopilot.
Onboard without reading every yield
New teammates open the interactive HTML viewer for a function and see services, layers, error paths and concurrency at a glance — instead of tracing generators line-by-line.
Docs that can't lie
Service maps and railway diagrams generated straight from the AST. Refactor freely; the diagrams move with the code, not with a stale Notion page.
Catch hidden complexity in CI
Cyclomatic, cognitive, path count, nesting depth, parallel breadth — fail the build when a function quietly crosses your team’s thresholds.
Prefer the CLI for CI pipelines and local sanity checks? Same analyzer, same IR.
$ npx effect-analyze ./src/transfer-workflow.ts --format explain
transferWorkflow (generator):
1. Yields accounts <- AccountService
2. Yields audit <- AuditLog
3. Yields balance <- accounts.getBalance
4. If balance < amount:
Returns InsufficientFundsError
5. Calls accounts.debit
6. Calls accounts.credit
7. Calls audit.record
Services required: AccountService, AuditLog
Error paths: AccountNotFoundError, InsufficientFundsError
Concurrency: sequential (no parallelism)
✓ analyzed in 42ms · 0 issues · 4 services · 2 error paths t3code case study — Mermaid diff output on a real codebase under refactor.# Installnpm install effect-analyzer
# Analyze a filenpx effect-analyze ./src/my-program.ts
# Generate a railway diagramnpx effect-analyze ./src/my-program.ts --format mermaid-railway
# Compare versionsnpx effect-analyze HEAD:program.ts program.ts --diff