agentleFS
Effect-TSEffect-TS/effect-smol/AGENTS.md

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.

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
  1. Very specific:

    Use pnpm as the package manager.

    line 6
  2. Distinctive:

    Keep changes focused and follow established patterns in the repository.

    line 7
  3. Very specific:

    Before writing code, read the relevant files in ./.patterns/ and inspect similar existing code.

    line 8
  4. Distinctive:

    If multiple interpretations exist, present them - don't pick silently.

    line 17
  5. Distinctive:

    If a simpler approach exists, say so.

    line 18
  6. Distinctive:

    If something is unclear, stop.

    line 19
  7. Distinctive:

    No features beyond what was asked.

    line 25
  8. Distinctive:

    No abstractions for single-use code.

    line 26
  9. Distinctive:

    No error handling for impossible scenarios.

    line 28
  10. Distinctive:

    If you write 200 lines and it could be 50, rewrite it.

    line 29
  11. Distinctive:

    Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.

    line 31
  12. Distinctive:

    When editing existing code:

    line 37
  13. Distinctive:

    Don't "improve" adjacent code, comments, or formatting.

    line 39
  14. Distinctive:

    Don't refactor things that aren't broken.

    line 40
  15. Distinctive:

    If you notice unrelated dead code, mention it - don't delete it.

    line 42
  16. Distinctive:

    When your changes create orphans:

    line 44
  17. Very specific:

    Remove imports/variables/functions that YOUR changes made unused.

    line 46
  18. Distinctive:

    Don't remove pre-existing dead code unless asked.

    line 47
  19. Distinctive:

    Prefer existing abstractions and conventions over introducing new ones.

    line 74
  20. Distinctive:

    Run the validation appropriate to the change type.

    line 77
  21. Distinctive:

    Use the narrowest validation that still covers the change:

    line 82
  22. Distinctive:

    When asked to show bundle-size impact for a commit, use the existing bundle comparison workflow:

    line 95
  23. Very specific:

    Read the Markdown report from tmp/bundle-stats.txt and summarize the non-zero differences.

    line 99
  24. Very specific:

    Leave tmp/bundle-base in place unless cleanup is requested.

    line 100
  25. Very specific:

    Read .patterns/effect.md before changing Effect code.

    line 104
  26. Very specific:

    Prefer Effect.fnUntraced over functions that only return Effect.gen.

    line 106
  27. Very specific:

    Prefer class syntax for Context.Service.

    line 107
  28. Very specific:

    Do not use async / await or try / catch.

    line 108
  29. Very specific:

    Do not use Date.now or new Date.

    line 109
  30. Very specific:

    Read .patterns/testing.md before writing or changing tests.

    line 113
  31. Very specific:

    Test files are located in packages/*/test/.

    line 115
  32. Very specific:

    Use it.effect for Effect-returning tests.

    line 117
  33. Very specific:

    Use regular it for pure synchronous tests.

    line 118
  34. Very specific:

    Do not use Effect.runSync in tests.

    line 119
  35. Very specific:

    Do not use expect from Vitest.

    line 120
  36. Very specific:

    When JSDoc examples are localized to a single package, run pnpm docgen from that package directory instead of the repository root.

    line 128
  37. Distinctive:

    Do not hand-edit generated files.

    line 132
  38. Very specific:

    Create a changeset in .changeset/ for runtime behavior changes or exported type/API changes:

    line 138

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

This is the Effect library repository, focusing on functional programming patterns and effect systems in TypeScript.

Overview

  • The git base branch is main.
  • Use pnpm as 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

  1. Inspect nearby implementation, tests, and pattern docs before editing.
  2. Prefer existing abstractions and conventions over introducing new ones.
  3. For ad hoc runnable code, create a temporary file in scratchpad/, run it with node scratchpad/<file>.ts, and delete it when done. The local runtime is Node 24, which can run TypeScript files directly; use plain node for local TypeScript probes instead of tsx unless node fails.
  4. Run the validation appropriate to the change type.
  5. 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 typeValidation
Code changespnpm lint-fix, targeted pnpm test <test_file.ts>, pnpm check
Tests-only changespnpm lint-fix, targeted pnpm test <test_file.ts>, pnpm check
Type-level/API type changesTargeted pnpm test-types <filename>, plus pnpm check when source types changed
JSDoc text/category/link changespnpm lint
JSDoc example changespnpm lint; from the changed package directory, run pnpm docgen
Docs-only changespnpm 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:

  1. For the latest commit, run pnpm bundle-compare HEAD~1. For another base, run pnpm bundle-compare <base-ref>.
  2. Read the Markdown report from tmp/bundle-stats.txt and summarize the non-zero differences.
  3. Leave tmp/bundle-base in place unless cleanup is requested. To clean it up, run git worktree remove --force tmp/bundle-base.

Coding Patterns

Read .patterns/effect.md before changing Effect code. In particular:

  • Prefer Effect.fnUntraced over functions that only return Effect.gen.
  • Prefer class syntax for Context.Service.
  • Do not use async / await or try / catch; use Effect APIs such as Effect.gen, Effect.fnUntraced, and Effect.tryPromise.
  • Do not use Date.now or new Date; use Clock, and use TestClock in 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.effect for Effect-returning tests.
  • Use regular it for pure synchronous tests.
  • Do not use Effect.runSync in tests.
  • Do not use expect from Vitest; use assert from @effect/vitest.
  • Type-level tests are in packages/*/typetest/ and run with pnpm test-types <filename>.

Documentation

  • For AI documentation, read ai-docs/README.md very carefully before writing examples.
  • AI documentation changes may include explanatory comments when useful.
  • For public JSDoc @category guidance, read .patterns/jsdoc.md.
  • When JSDoc examples are localized to a single package, run pnpm docgen from that package directory instead of the repository root.

Generated Files

Do not hand-edit generated files. Run the appropriate generator instead.

  • index.ts barrel files are generated; run pnpm codegen after 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.