You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first end-to-end review path: /unic-pr-review:review-pr invoked without a URL detects Pre-PR mode, computes the local diff against the resolved base branch, fans out to a single review-aspect sub-agent (code-reviewer), and renders Findings to the terminal grouped by Severity. No writes anywhere.
This slice also lands the load-bearing pure-function library used by every later slice — signature.mjs (footer renderer only — the parser comes in #re-review-detection), severity-bucketer.mjs, mode-detector.mjs, changed-file-analyser.mjs (minimal: always spawn code-reviewer), review-summary-renderer.mjs, inline-comment-renderer.mjs, notices.mjs.
Motto: get out of the models' way. The aspect agent is trusted to read the diff and emit structured Findings with no rule-table assistance. Renderers own template consistency.
Acceptance criteria
commands/review-pr.md exists. No URL argument → Pre-PR mode. With a URL, exits with "ADO mode not yet supported" (filled in by later slices).
Base-branch resolution chain (git symbolic-ref refs/remotes/origin/HEAD → develop → main → master → hard error) is implemented and unit-tested.
agents/code-reviewer.md exists with a distinctive name + colour, embeds the Confidence-Score rubric (90-100 Critical, 80-89 Important, 60-79 Minor, <60 dropped), and emits Findings as JSON { severity, confidence, filePath, startLine, endLine, title, body, suggestion? } — no Bot Signature footer.
scripts/lib/signature.mjs exports a footer renderer that produces exactly 🤖 Reviewed by Claude Code — Iteration N (with trailing newlines per the PRD schema). The parser entry point is stubbed for now.
scripts/lib/severity-bucketer.mjs maps confidence 0–100 to one of critical / important / minor / dropped per the thresholds.
scripts/lib/changed-file-analyser.mjs returns at minimum ['code-reviewer'] for any non-empty changed-files list.
scripts/lib/review-summary-renderer.mjs builds the exact Review Summary template from the PRD (Notices → Intent Check → 🔴 Critical → 🟠 Important → 🟡 Minor → ✅ What's good → footer via signature.mjs).
scripts/lib/inline-comment-renderer.mjs builds the Inline Comment template (severity emoji + title + prose + optional ```suggestion block + footer via signature.mjs).
Neither renderer inlines the literal footer string; both import the footer from scripts/lib/signature.mjs. The PRD schemas use the {BOT_SIGNATURE_FOOTER} placeholder to make this contract explicit — a renderer test asserts the footer in rendered output is byte-identical to signature.mjs's output.
Default run writes nothing — only prints the rendered preview to the terminal and exits 0.
Per-module unit tests cover signature, severity-bucketer, mode-detector, changed-file-analyser (single case), review-summary-renderer (with and without Intent Check / Notices), inline-comment-renderer.
Parent
docs/issues/unic-pr-review/PRD.mdWhat to build
The first end-to-end review path:
/unic-pr-review:review-prinvoked without a URL detects Pre-PR mode, computes the local diff against the resolved base branch, fans out to a single review-aspect sub-agent (code-reviewer), and renders Findings to the terminal grouped by Severity. No writes anywhere.This slice also lands the load-bearing pure-function library used by every later slice —
signature.mjs(footer renderer only — the parser comes in #re-review-detection),severity-bucketer.mjs,mode-detector.mjs,changed-file-analyser.mjs(minimal: always spawncode-reviewer),review-summary-renderer.mjs,inline-comment-renderer.mjs,notices.mjs.Motto: get out of the models' way. The aspect agent is trusted to read the diff and emit structured Findings with no rule-table assistance. Renderers own template consistency.
Acceptance criteria
commands/review-pr.mdexists. No URL argument → Pre-PR mode. With a URL, exits with "ADO mode not yet supported" (filled in by later slices).git symbolic-ref refs/remotes/origin/HEAD→develop→main→master→ hard error) is implemented and unit-tested.agents/code-reviewer.mdexists with a distinctive name + colour, embeds the Confidence-Score rubric (90-100 Critical, 80-89 Important, 60-79 Minor, <60 dropped), and emits Findings as JSON{ severity, confidence, filePath, startLine, endLine, title, body, suggestion? }— no Bot Signature footer.scripts/lib/signature.mjsexports a footer renderer that produces exactly🤖 Reviewed by Claude Code — Iteration N(with trailing newlines per the PRD schema). The parser entry point is stubbed for now.scripts/lib/severity-bucketer.mjsmaps confidence 0–100 to one ofcritical/important/minor/ dropped per the thresholds.scripts/lib/mode-detector.mjsreturnspre-pr/first-review/re-review/first-review-fallbackfrom{ hasUrl, hasPriorSignature, revisionsAvailable }. Table-driven.scripts/lib/changed-file-analyser.mjsreturns at minimum['code-reviewer']for any non-empty changed-files list.scripts/lib/review-summary-renderer.mjsbuilds the exact Review Summary template from the PRD (Notices → Intent Check → 🔴 Critical → 🟠 Important → 🟡 Minor → ✅ What's good → footer viasignature.mjs).scripts/lib/inline-comment-renderer.mjsbuilds the Inline Comment template (severity emoji + title + prose + optional```suggestionblock + footer viasignature.mjs).scripts/lib/signature.mjs. The PRD schemas use the{BOT_SIGNATURE_FOOTER}placeholder to make this contract explicit — a renderer test asserts the footer in rendered output is byte-identical tosignature.mjs's output.Blocked by