agentleFS
ElasticKnown publisherelastic/elastic-ramen/packages/opencode/AGENTS.md

elastic-ramen / opencode

AGENTS.md19 starsChanged 8 months agoMITView on GitHub

Instructions to follow when writing Effect.

We split this AGENTS.md into the rules it gives an agent

6 rules. About 0 are common, 0 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use Schema.Class for data types with multiple fields.

    line 18
  2. Very specific:

    Use branded schemas (Schema.brand) for single-value types.

    line 19
  3. Very specific:

    Use Schema.TaggedErrorClass for typed errors.

    line 28
  4. Very specific:

    Use Effect.gen(function* () { ...

    line 34
  5. Very specific:

    Use Effect.fn("ServiceName.method") for named/traced effects and Effect.fnUntraced for internal helpers.

    line 35
  6. Very specific:

    Prefer DateTime.nowAsDate over new Date(yield* Clock.currentTimeMillis) when you need a Date.

    line 40

≈ “Common” is an estimate: at least 1 in 5 of the 36,368 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

opencode database guide

Database

  • Schema: Drizzle schema lives in src/**/*.sql.ts.
  • Naming: tables and columns use snake*case; join columns are <entity>_id; indexes are <table>*<column>\_idx.
  • Migrations: generated by Drizzle Kit using drizzle.config.ts (schema: ./src/**/*.sql.ts, output: ./migration).
  • Command: bun run db generate --name <slug>.
  • Output: creates migration/<timestamp>_<slug>/migration.sql and snapshot.json.
  • Tests: migration tests should read the per-folder layout (no _journal.json).

opencode Effect guide

Instructions to follow when writing Effect.

Schemas

  • Use Schema.Class for data types with multiple fields.
  • Use branded schemas (Schema.brand) for single-value types.

Services

  • Services use ServiceMap.Service<ServiceName, ServiceName.Service>()("@console/<Name>").
  • In Layer.effect, always return service implementations with ServiceName.of({ ... }), never a plain object.

Errors

  • Use Schema.TaggedErrorClass for typed errors.
  • For defect-like causes, use Schema.Defect instead of unknown.
  • In Effect.gen, prefer yield* new MyError(...) over yield* Effect.fail(new MyError(...)) for direct early-failure branches.

Effects

  • Use Effect.gen(function* () { ... }) for composition.
  • Use Effect.fn("ServiceName.method") for named/traced effects and Effect.fnUntraced for internal helpers.
  • Effect.fn / Effect.fnUntraced accept pipeable operators as extra arguments, so avoid unnecessary flow or outer .pipe() wrappers.

Time

  • Prefer DateTime.nowAsDate over new Date(yield* Clock.currentTimeMillis) when you need a Date.

Errors

  • In Effect.gen/fn, prefer yield* new MyError(...) over yield* Effect.fail(new MyError(...)) for direct early-failure branches.

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.

Reviews can't be read right now.

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.