01 / Good and bad pairs
Paired examples throughout
Destructuring, variable count, control flow and schema definitions each get a two-block comparison. The rule is stated in one line and then shown twice, marked good and bad.

Open source coding agent, built for the terminal.
Twelve code blocks in 161 lines; most style rules show the wrong version beside the right one.
├── └── packages ├── app │ ├── e2e │ │ └── performance │ │ └── │ └── ├── core │ └── src │ └── tool │ └── ├── desktop │ └── ├── effect-drizzle-sqlite │ └── ├── llm │ └── ├── opencode │ ├── src │ │ ├── server │ │ │ └── routes │ │ │ └── instance │ │ │ └── httpapi │ │ │ └── │ │ └── session │ │ └── llm │ │ └── │ └── ├── schema │ └── └── stats └──
The file, explained
A style guide that argues against abstraction, followed by a set of runtime invariants for its session core. The highest ratio of code to prose in the directory.
Quoted passages are verbatim. Open one to see it in the source.
01 / Good and bad pairs
Destructuring, variable count, control flow and schema definitions each get a two-block comparison. The rule is stated in one line and then shown twice, marked good and bad.
02 / Behavioral framing
Logic stays in one function unless it is reused, hides a genuinely complex boundary, or has a name that improves the caller. The same instruction appears twice in the file, once in the general principles and once under complex logic.
Source excerpt starting at line 26.- Do not extract single-use helpers preemptively. Inline the logic at the call site unless the helper is reused, hides a genuinely complex boundary, or has a clear independent name that improves the caller.
03 / From this file
A single line fixes the allowed direction across six packages, including which layers client runtime code may never reach. It can be checked at an import without opening a config file.
Source excerpt starting at line 3.- Keep runtime dependencies directed from Schema to Core and Protocol, then from Core and Protocol to Server. Client runtime code may depend on Schema and Protocol but never Core or Server; `sdk-next` composes Client, Core, and Server.
04 / From this file
At most three words, hyphenated, no slashes, no type prefixes, with three examples given.
05 / From this file
The session core section states properties the type system does not hold: durable admission stays separate from model execution, one provider stream call per turn, no bridging through the legacy loop. They are written as standing constraints rather than as style.
Source excerpt starting at line 157.- Preserve one explicit `llm.stream(request)` call per provider turn and reload projected history before durable continuation. Do not bridge through legacy `SessionPrompt.loop(...)` or delegate orchestration to an in-memory tool loop.
06 / From this file
The default branch is dev, a local main ref may not exist, and tests cannot run from the repository root because of a named guard. Three lines, each covering a state an agent would otherwise have to discover.
Put it to work
opencode's file tells an agent how the codebase works. It cannot tell it which bug three customers hit this week. Modem keeps that context current and attaches it to the work.
Try Modem