agentleFS
theseus-runtheseus-run/theseus/.agents/skills/effect-testing-runtime/SKILL.md

effect-testing-runtime

Skill1 starsChanged 6 months agoMITView on GitHub

Use when testing or verifying Effect code in Theseus, including Effect.runPromise boundaries, test layers, fake services, deterministic time, config providers, stream/fiber tests, and runtime edge behavior.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 8 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill for testing Effect programs and deciding where effects are run.

    line 8
  2. Very specific:

    Use the bun-test skill for Bun test runner APIs and the testing-patterns skill for repo-level test placement.

    line 10
  3. Distinctive:

    Run effects at process, test, or script edges.

    line 14
  4. Very specific:

    Do not call Effect.runPromise or Effect.runSync inside services or domain functions.

    line 15
  5. Distinctive:

    Prefer test layers and fake services over global mutation.

    line 33
  6. Distinctive:

    Use deterministic services for time, randomness, IDs, storage, language models, and config.

    line 34
  7. Very specific:

    Use ConfigProvider when config should come from a map/object rather than the process environment.

    line 35
  8. Distinctive:

    Keep typed expected failures in the error channel when that is the contract being tested.

    line 36
  9. Distinctive:

    Test defects separately from expected domain failures.

    line 37
  10. Very specific:

    Do not hide timing problems with sleeps.

    line 43
  11. Distinctive:

    When testing time-based behavior, verify local Effect test-clock APIs before using them.

    line 44
  12. Distinctive:

    Should the package-local test run be enough, or did public signatures require root typecheck?

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
SKILL.md

Effect Testing And Runtime

Use this skill for testing Effect programs and deciding where effects are run.

Use the bun-test skill for Bun test runner APIs and the testing-patterns skill for repo-level test placement.

Runtime Boundary

  • Run effects at process, test, or script edges.
  • Do not call Effect.runPromise or Effect.runSync inside services or domain functions.
  • In tests, build the program, provide test layers, then run it at the test boundary.
import { Effect } from "effect"
import { expect, test } from "bun:test"

test("returns user", async () => {
  const result = await Effect.runPromise(
    Users.find("user-1").pipe(Effect.provide(UsersTestLive)),
  )

  expect(result.id).toBe("user-1")
})

Test Services

  • Prefer test layers and fake services over global mutation.
  • Use deterministic services for time, randomness, IDs, storage, language models, and config.
  • Use ConfigProvider when config should come from a map/object rather than the process environment.
  • Keep typed expected failures in the error channel when that is the contract being tested.
  • Test defects separately from expected domain failures.

Concurrent And Streaming Tests

  • For streams, test completion semantics as well as emitted values.
  • For background fibers, test interruption or shutdown behavior.
  • Do not hide timing problems with sleeps; use deterministic signals such as Deferred, queue events, or test clocks when available.
  • When testing time-based behavior, verify local Effect test-clock APIs before using them.

Checks

  • Is the effect run only at the test boundary?
  • Are all required services provided intentionally?
  • Does the test assert typed failures rather than stringified defects?
  • Does the test prove shutdown/completion for fibers, queues, and streams?
  • Should the package-local test run be enough, or did public signatures require root typecheck?

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.