Guidance for the automated reviewer (kilo-code-bot) on PRs in this repo.
The goal of the review is to catch things CI cannot catch: bugs, design issues, and judgment calls about style and fork hygiene. Be helpful, not pedantic — frame everything as a suggestion the human can accept or reject.
CI already runs and will report failures directly. Do not comment on:
- Lint, formatting, or typecheck errors (root
lint,turbo typecheck) - Test failures (CLI tests, vscode tests)
knipunused exportskilocode_changemarker rules — both directions:- Missing markers on shared opencode files (
script/check-opencode-annotations.ts) - Markers present in kilo-only paths like
packages/kilo-vscode/,packages/kilo-ui/,packages/opencode/src/kilocode/(bun run check-kilocode-change)
- Missing markers on shared opencode files (
- Workflow allowlist drift (
script/check-workflows.ts) - Stale
packages/kilo-docs/source-links.md(script/extract-source-links.ts) - Markdown table padding (
script/check-md-table-padding.ts) - Visual regression snapshots (CI generates baselines on Linux)
- SDK regeneration drift (
generate.yml) - Generated artifact freshness (
check-kilo-generated-artifacts.yml) - Docs link checks, nix evals, container builds
If the only issue you'd raise is one of the above, just say lgtm.
Read enough of the surrounding file to actually understand the change — diffs alone hide context. Look for:
- Logic errors, off-by-one, wrong conditions, swapped arguments
- Unhandled error paths, swallowed promises, missing
await - Race conditions, especially around session/process lifecycle in the CLI and Agent Manager
- Resource leaks (unclosed file handles, child processes, subscriptions)
- Inputs that aren't validated where they cross trust boundaries (server routes, IPC, config loading)
The full guide is in AGENTS.md. Don't be a zealot — only flag actual violations, and recognize when the existing code already complies through a different mechanism.
- No
let: preferconstwith ternary or IIFE (packages/opencode/src/util/iife.ts). Butletis fine when it's genuinely the simplest option; don't demand IIFE rewrites for trivial cases. - No
else: prefer early returns. Don't complain aboutelseif the code already uses early returns elsewhere. You may flag excessive nesting regardless. - No empty
catch: always flag — empty catches hide bugs. - Avoid
try/catchwhere possible: if a try/catch is added, consider whether it's needed at all. - Avoid
any: flag newanyusage unless there's a clear reason. - Single-word names: prefer
cfg,pid,dir,opts,erroverinputPID,connectTimeout. Only flag newly introduced multi-word names where a clear single-word alternative exists. - Avoid unnecessary destructuring: prefer
obj.aoverconst { a } = objto preserve context. - Bun APIs: prefer
Bun.file()etc. over node equivalents in CLI code. - Type inference: avoid explicit annotations unless needed for exports/clarity.
When suggesting fixes, ensure the suggestion is valid TypeScript (matched braces, correct syntax). Prefer prose comments over suggestion blocks unless the fix is trivially mechanical.
Kilo CLI is a fork of opencode. Minimizing diff against upstream is a top priority.
- If a change modifies a shared opencode file (anything under
packages/opencode/not in a path containingkilocode), ask whether the logic could live in a Kilo-only directory instead (packages/opencode/src/kilocode/,packages/kilo-gateway/, etc.) or be reduced to a smaller hook. - Refactors or reorganizations of upstream code are a red flag — flag them unless clearly justified.
- See
.kilo/skills/kilocode-merge-minimizer/SKILL.mdfor the decision rules.
When Config.Info in packages/opencode/src/config/config.ts gains a new kilocode_change field, the matching JSON Schema entry must also be added in the cloud repo (apps/web/src/app/config.json/extras.ts). CI does not check this — flag it as a reminder if you see a new config field added.
- Tests should exercise real implementation, not duplicate logic into the test.
- Mocks should be avoided where reasonable; flag mock-heavy tests that look like they're testing the mock rather than the code.
- New behavior in
packages/opencode/should generally come with a test underpackages/opencode/test/.
- Features, bug fixes, and breaking changes should include a changeset (
.changeset/*.md). If a PR clearly changes user-visible behavior and has no changeset, mention it. - Changeset descriptions are read by end users — if one is present but written as implementation notes ("Add a new export handler that serializes…"), suggest a user-facing rewrite ("Support exporting conversations as markdown").
- PR descriptions should explain why, not enumerate files. Skip file-by-file inventories.
For changes under packages/kilo-vscode/webview-ui/:
- Significant visual or layout changes should have a Storybook story added under
webview-ui/src/stories/. Minor tweaks and i18n-only changes don't need one. - Don't ask for locally generated baseline PNGs — those must come from Linux CI.
- Leave comments on the exact line via
gh api .../pulls/{n}/comments. - Make it clear suggestions are suggestions; the human decides.
- If the PR is clean against the above, comment
lgtmand nothing else.