effect-smol
AGENTS.md782 starsChanged 5 months agoMITView on GitHub
This is the Effect library repository, focusing on functional programming patterns and effect systems in TypeScript. Don't assume. Don't hide confusion. Surface tradeoffs. Before implementing: Minimum code that solves the problem. Nothing speculative. Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify. Touch only what you must. Clean up only your own mess. When editing existing code: When your changes create orphans: The test: Every changed line should trace directly to the user's request. Define success…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,700 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- grill-meSkill
- jsdocsSkill
- scratchpadSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
38 rules. About 0 are common, 20 are distinctive, and 18 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈20
Distinctive · estimate
This author's own choices. Worth a look.
18
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 6
Use pnpm as the package manager.
- Distinctive: line 7
Keep changes focused and follow established patterns in the repository.
- Very specific: line 8
Before writing code, read the relevant files in ./.patterns/ and inspect similar existing code.
- Distinctive: line 17
If multiple interpretations exist, present them - don't pick silently.
- Distinctive: line 18
If a simpler approach exists, say so.
- Distinctive: line 19
If something is unclear, stop.
- Distinctive: line 25
No features beyond what was asked.
- Distinctive: line 26
No abstractions for single-use code.
- Distinctive: line 28
No error handling for impossible scenarios.
- Distinctive: line 29
If you write 200 lines and it could be 50, rewrite it.
- Distinctive: line 31
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
- Distinctive: line 37
When editing existing code:
- Distinctive: line 39
Don't "improve" adjacent code, comments, or formatting.
- Distinctive: line 40
Don't refactor things that aren't broken.
- Distinctive: line 42
If you notice unrelated dead code, mention it - don't delete it.
- Distinctive: line 44
When your changes create orphans:
- Very specific: line 46
Remove imports/variables/functions that YOUR changes made unused.
- Distinctive: line 47
Don't remove pre-existing dead code unless asked.
- Distinctive: line 74
Prefer existing abstractions and conventions over introducing new ones.
- Distinctive: line 77
Run the validation appropriate to the change type.
- Distinctive: line 82
Use the narrowest validation that still covers the change:
- Distinctive: line 95
When asked to show bundle-size impact for a commit, use the existing bundle comparison workflow:
- Very specific: line 99
Read the Markdown report from tmp/bundle-stats.txt and summarize the non-zero differences.
- Very specific: line 100
Leave tmp/bundle-base in place unless cleanup is requested.
- Very specific: line 104
Read .patterns/effect.md before changing Effect code.
- Very specific: line 106
Prefer Effect.fnUntraced over functions that only return Effect.gen.
- Very specific: line 107
Prefer class syntax for Context.Service.
- Very specific: line 108
Do not use async / await or try / catch.
- Very specific: line 109
Do not use Date.now or new Date.
- Very specific: line 113
Read .patterns/testing.md before writing or changing tests.
- Very specific: line 115
Test files are located in packages/*/test/.
- Very specific: line 117
Use it.effect for Effect-returning tests.
- Very specific: line 118
Use regular it for pure synchronous tests.
- Very specific: line 119
Do not use Effect.runSync in tests.
- Very specific: line 120
Do not use expect from Vitest.
- Very specific: line 128
When JSDoc examples are localized to a single package, run pnpm docgen from that package directory instead of the repository root.
- Distinctive: line 132
Do not hand-edit generated files.
- Very specific: line 138
Create a changeset in .changeset/ for runtime behavior changes or exported type/API changes:
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
This is the Effect library repository, focusing on functional programming patterns and effect systems in TypeScript.
Overview
- The git base branch is
main. - Use
pnpmas the package manager. - Keep changes focused and follow established patterns in the repository.
- Before writing code, read the relevant files in
./.patterns/and inspect similar existing code.
Think Before Coding
Don't assume. Don't hide confusion. Surface tradeoffs.
Before implementing:
- State your assumptions explicitly. If uncertain, ask.
- If multiple interpretations exist, present them - don't pick silently.
- If a simpler approach exists, say so. Push back when warranted.
- If something is unclear, stop. Name what's confusing. Ask.
Simplicity First
Minimum code that solves the problem. Nothing speculative.
- No features beyond what was asked.
- No abstractions for single-use code.
- No "flexibility" or "configurability" that wasn't requested.
- No error handling for impossible scenarios.
- If you write 200 lines and it could be 50, rewrite it.
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
Surgical Changes
Touch only what you must. Clean up only your own mess.
When editing existing code:
- Don't "improve" adjacent code, comments, or formatting.
- Don't refactor things that aren't broken.
- Match existing style, even if you'd do it differently.
- If you notice unrelated dead code, mention it - don't delete it.
When your changes create orphans:
- Remove imports/variables/functions that YOUR changes made unused.
- Don't remove pre-existing dead code unless asked.
The test: Every changed line should trace directly to the user's request.
Goal-Driven Execution
Define success criteria. Loop until verified.
Transform tasks into verifiable goals:
- "Add validation" → "Write tests for invalid inputs, then make them pass"
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
- "Refactor X" → "Ensure tests pass before and after"
For multi-step tasks, state a brief plan:
1. [Step] → verify: [check]
2. [Step] → verify: [check]
3. [Step] → verify: [check]Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
Workflow
- Inspect nearby implementation, tests, and pattern docs before editing.
- Prefer existing abstractions and conventions over introducing new ones.
- For ad hoc runnable code, create a temporary file in
scratchpad/, run it withnode scratchpad/<file>.ts, and delete it when done. The local runtime is Node 24, which can run TypeScript files directly; use plainnodefor local TypeScript probes instead oftsxunlessnodefails. - Run the validation appropriate to the change type.
- Report which validation commands were run and any commands that could not be run.
Validation
Use the narrowest validation that still covers the change:
| Change type | Validation |
| Code changes | pnpm lint-fix, targeted pnpm test <test_file.ts>, pnpm check |
| Tests-only changes | pnpm lint-fix, targeted pnpm test <test_file.ts>, pnpm check |
| Type-level/API type changes | Targeted pnpm test-types <filename>, plus pnpm check when source types changed |
| JSDoc text/category/link changes | pnpm lint |
| JSDoc example changes | pnpm lint; from the changed package directory, run pnpm docgen |
| Docs-only changes | pnpm lint-fix; no tests required unless examples or code changed |
Bundle Size Preview
When asked to show bundle-size impact for a commit, use the existing bundle comparison workflow:
- For the latest commit, run
pnpm bundle-compare HEAD~1. For another base, runpnpm bundle-compare <base-ref>. - Read the Markdown report from
tmp/bundle-stats.txtand summarize the non-zero differences. - Leave
tmp/bundle-basein place unless cleanup is requested. To clean it up, rungit worktree remove --force tmp/bundle-base.
Coding Patterns
Read .patterns/effect.md before changing Effect code. In particular:
- Prefer
Effect.fnUntracedover functions that only returnEffect.gen. - Prefer class syntax for
Context.Service. - Do not use
async/awaitortry/catch; use Effect APIs such asEffect.gen,Effect.fnUntraced, andEffect.tryPromise. - Do not use
Date.nowornew Date; useClock, and useTestClockin tests.
Testing
Read .patterns/testing.md before writing or changing tests.
- Test files are located in
packages/*/test/. - Main Effect library tests are in
packages/effect/test/. - Use
it.effectfor Effect-returning tests. - Use regular
itfor pure synchronous tests. - Do not use
Effect.runSyncin tests. - Do not use
expectfrom Vitest; useassertfrom@effect/vitest. - Type-level tests are in
packages/*/typetest/and run withpnpm test-types <filename>.
Documentation
- For AI documentation, read
ai-docs/README.mdvery carefully before writing examples. - AI documentation changes may include explanatory comments when useful.
- For public JSDoc
@categoryguidance, read.patterns/jsdoc.md. - When JSDoc examples are localized to a single package, run
pnpm docgenfrom that package directory instead of the repository root.
Generated Files
Do not hand-edit generated files. Run the appropriate generator instead.
index.tsbarrel files are generated; runpnpm codegenafter adding or removing modules.
Changesets
Create a changeset in .changeset/ for runtime behavior changes or exported type/API changes:
---
"package-name": patch/minor/major
---
A description of the change.Tests-only changes, internal refactors, docs-only changes, and JSDoc-only maintenance may skip changesets by maintainer decision.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

