← library

Coding · v2.1.0 · featured

Code Review Agent

Not a linter in a trench coat. You paste a git diff or a file; it returns a summary, blocking issues with line-accurate comments, nits you can ignore, suggested tests, and a merge recommendation (approve / request changes). Prefers specific line notes over sermons. TypeScript, Python, Go, SQL. Dark IDE two-pane — paste left, findings right.

diff.ghost · 12,647 votes · 76,836 score · 38,895 opens

#review#diff#quality#security

Spec

Build a Code Review Agent that behaves like a staff engineer on a busy review, not a blog post about clean code.

PRODUCT
Two-pane review desk. Left: paste a unified git diff or a whole file. Right: findings grouped by severity. Bottom bar: merge call. The agent does not rewrite the file unless the user clicks “propose patch”.

LANGUAGES IN PHASE 1
TypeScript/JavaScript, Python, Go, SQL. Detect from diff headers and fences. If unknown, review as generic and say so.

SCREENS
1. Desk
   - Left pane: textarea, monospace, 14px, tab inserts 2 spaces. Placeholder: “paste diff or file”.
   - Meta row: detected language, lines added/removed (parse the diff), a “this is a whole file, not a diff” checkbox.
   - Right pane: grouped findings
        BLOCKING — must fix. File:line, 1–3 sentence why, a 2–8 line suggested fix in a copyable fence.
        SHOULD — real issues that can ship behind a follow-up.
        NIT — naming, dead code, comment rot. Collapsed by default.
        TESTS — 1–4 suggested test cases (name + assertion in plain language).
   - Merge call sticky: APPROVE / REQUEST CHANGES / COMMENT-ONLY, with a 20-word reason.
2. Patch sheet (optional) — concatenated suggested fixes as a unified diff the user can copy. Only generated on demand.

REVIEW RUBRIC (encode this in the system behavior, visible as a tiny legend)
Correctness, security (injection, authz, secrets, unsafe HTML), API contracts, concurrency, tests, naming. Do not nag about formatting if a formatter would fix it — one note “run the formatter”, not 12 nits.

DATA
Last 6 reviews in localStorage. No git hosting integration in Phase 1.

EMPTY / ERROR
- Empty left pane: a “load sample diff” (a small TypeScript function with an SQL-injection-shaped bug and a naming nit) so the UI is never a blank manifesto.
- Huge paste (>80k chars): warn, still try, offer “review the first 400 lines”.
- Cannot parse as diff: treat as whole file, show the checkbox already on.

VISUAL
Dark IDE. Raised pane, 1px line borders, no rounded cards. Findings use a 3-char severity tag (BLK / SHD / NIT). Line refs are clickable and scroll/highlight the left pane if the line exists. IBM Plex Mono everywhere in panes.

KEYBOARD
Cmd/Ctrl+Enter to run. j/k move findings when right pane is focused. Enter copies the suggested fix.

OUT OF SCOPE
GitHub/GitLab OAuth, inline PR posting, auto-merge, whole-repo indexing, CI.

ACCEPTANCE
- Sample diff produces at least one BLOCKING and one NIT, in different groups.
- Merge call is one of the three states, never “looks good overall :)”.
- Mobile: panes stack, left first, findings after; sticky merge call; 44px targets.