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
- Very specific: line 18
Use Schema.Class for data types with multiple fields.
- Very specific: line 19
Use branded schemas (Schema.brand) for single-value types.
- Very specific: line 28
Use Schema.TaggedErrorClass for typed errors.
- Very specific: line 34
Use Effect.gen(function* () { ...
- Very specific: line 35
Use Effect.fn("ServiceName.method") for named/traced effects and Effect.fnUntraced for internal helpers.
- Very specific: line 40
Prefer DateTime.nowAsDate over new Date(yield* Clock.currentTimeMillis) when you need a Date.
≈ “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.
Files
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.sqlandsnapshot.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.Classfor 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 withServiceName.of({ ... }), never a plain object.
Errors
- Use
Schema.TaggedErrorClassfor typed errors. - For defect-like causes, use
Schema.Defectinstead ofunknown. - In
Effect.gen, preferyield* new MyError(...)overyield* 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 andEffect.fnUntracedfor internal helpers. Effect.fn/Effect.fnUntracedaccept pipeable operators as extra arguments, so avoid unnecessaryflowor outer.pipe()wrappers.
Time
- Prefer
DateTime.nowAsDateovernew Date(yield* Clock.currentTimeMillis)when you need aDate.
Errors
- In
Effect.gen/fn, preferyield* new MyError(...)overyield* Effect.fail(new MyError(...))for direct early-failure branches.
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 28,693 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 repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- packages/opencode/test/AGENTS.mdAGENTS.md
- elastic-cli-usageSkill
- elasticsearch-esqlSkill
- observability-rcaSkill
- slo-managementSkill
- agents-sdkSkill
- cloudflareSkill
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.

