make help lists all. Key: check (format-check + typecheck + test), test [TEST=path], typecheck, format-check, replay, topology, topology-diff, topology-check. Extra flags: ARGS="...".
stylua <changed files>only; unrelated files only if asked.make format-check; report unrelated failures, don't fix.make typecheckuntil zero errors. Fix annotations, not runtime checks.- Tool missing → report blocker, don't claim validation.
- Trust
emmylua_lsstrict diagnostics. Fail fast. - No runtime type guards (
type(),if x == nil,orfallbacks) on typed contracts. - Contracts via
---@class,---@alias, inline shapes; optional via?. - Comments explain why, not what.
Entry (ui/**, commands/handlers/**, quick_chat.lua) → services/* → infra (session, api, server_job).
- Services: permanent boundary, own shared business logic. Handlers only adapt intents.
- New entry-layer
opencode.session/opencode.apiimport: needs approval + PR note (reason, file + symbol, removal condition). - No pass-through shims/facades. Keep changes local, reversible.
- New service contract: define name, inputs, outputs, failure behavior first. Never silently change existing ones.
Use scanner, not grep, for architecture/debt. Remove debt only after code + tests pass.
make topology: gap vs target policy.make topology-diff ARGS="--from main --to HEAD": improved/regressed/neutral.make topology-check: CI gate vsorigin/main; fails on new layer-rule breaks, new/grown import loops, or modules missing fromtopology.jsonc.- Flags:
--json,--snapshot <git-ref>. Docs:scripts/dependency-topology/README.md.