Code Review Tool · Static Analysis · Operate Surface · 2026 · Solo — unified diff parser, YAGNI detection engine, GitHub Reviews REST API integration, server-side token proxy, Operate surface design, TDD (24 tests), Vercel production deployment

YAGNI Watch

Unified diff parser + 5-category YAGNI static analysis engine in pure TypeScript: dead conditionals, TODO-gated functions, over-parameterized functions (≥6 params across TS named/arrow/method and Python def), single-variant switches, and I-prefix interface abstractions — all with accurate file:line citations from hunk-offset tracking.

The problem

Over-engineering — dead conditionals, TODO stubs shipped as real functions, I-prefix interfaces with one implementation, switches with one arm, functions with 6+ parameters — lands in main because reviewers miss it under deadline pressure. No automated gate for YAGNI violations integrates directly into the GitHub review workflow.

Architecture

Key decisions

01

Pattern-based over AST

Full AST parsing (tree-sitter, acorn) for arbitrary unified diffs would require shipping a runtime parser to Vercel edge functions. Regex patterns are portable, bounded, testable, and sufficient for the YAGNI categories targeted — dead conditionals, parameter counts, switch arm counts, interface naming.

02

Server-side token proxy

The GitHub token travels directly from browser memory to the /api/post-review server route over HTTPS, never touching client-side localStorage, never appearing in server logs. The server route forwards it as a bearer token and discards it immediately.

03

Class method detection

TypeScript class method signatures match `async methodName(params): ReturnType {` which is structurally different from standalone function declarations. The regex required a separate capture group for the method pattern to avoid false-matching control-flow constructs.

04

Operate over Inspect surface

The primary CTA posts the review to GitHub rather than displaying a report. This transforms the tool from an inspection artifact (paste → read) into an operate artifact (paste → act), creating a durable record in the PR timeline.

Metrics

24 tests
TDD tests (6 parser + 4 dead-cond + 4 TODO-gate + 3 over-param + 3 switch + 3 abstraction + 1 integration)
5 categories
YAGNI violation types detected
0/10
Slop audit score