Code-Review-Loop 是一个优先确定性的、基于角色的 PR 差异审查 CLI,具有结构化流水线和多个子命令。

Stars

4

7 天增长

暂无数据

Fork 数

0

开放 Issue

0

开源协议

MIT

最近更新

2026-07-30

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它将本地确定性检查与 LLM 驱动的角色视角和话语分析相结合,强调可审计性和可追溯性,并支持先前运行的修复跟踪。

适合谁使用

  • Rust 开发者和工具链使用者
  • 寻求结构化 PR 分析的代码审查者
  • 需要确定性 CI/CD 审查集成的团队
  • 需要可重现审查输出的开发者

典型使用场景

  • 执行包含角色视角和话语分析的完整 PR 审查流水线
  • 生成 PR 摘要元数据(标题、整体介绍、标签)
  • 生成具有前后代码片段的具体补丁建议
  • 针对差异提出自由形式的问题

项目优势

  • 清晰的确定性/LLM 边界,便于审计
  • 基于角色的视角减少偏见,提供多种观点
  • 匿名话语模式减少从众偏差
  • 先前运行结果调和,跨迭代跟踪修复

使用前须知

  • 启发式策略信号可能产生误报
  • 严重性惩罚硬编码,无法通过配置文件调整
  • 固定角色映射过于主观,可能不适合所有项目
  • 文件重命名频繁时,声明匹配可能产生噪音

README 快速开始

Code-Review-Loop

A deterministic-first, persona-based review CLI for PR diffs.

Code-Review-Loop runs a structured review pipeline:

  1. select personas/lenses,
  2. review each lens independently,
  3. cross-check findings with discourse (AGREE/CHALLENGE/CONNECT/SURFACE),
  4. optionally verify against requirements/conventions, and
  5. summarize score/effort/verdict in deterministic tables.

The tool is implemented in Rust. Default LLM backend is Claude Code CLI (claude -p --output-format json); an OpenRouter backend (--backend openrouter + OPENROUTER_API_KEY) is also available and does not require the claude CLI.

What this repository is for

This CLI is designed for PR-level review and post-review remediation checks.

  • review : full PR pipeline (primary mode)
  • describe : generate PR summary metadata (title, summary, walkthrough, labels)
  • improve : produce concrete patch suggestions with before/after code snippets
  • ask : free-form Q&A against a diff

It favors traceability and auditability:

  • deterministic checks are locally computed,
  • LLM output is limited to judgmental parts, and
  • fixed schemas keep outputs reviewable by scripts.

This repository is the private implementation counterpart and aligns operationally with the public full-review skill ecosystem where applicable.

Build and requirements

Requirements

  • Rust toolchain (for building CLI)
  • claude CLI in PATH (for LLM-backed review modes, default backend) — or --backend openrouter with OPENROUTER_API_KEY set, which needs no claude CLI
  • optional: semgrep for local deterministic SAST/secrets/semi-static checks

Build

cargo build --release

# Built binary:
# target/release/codereview

If you want to keep a local debug binary:

cargo build

Core usage

All commands expect a diff patch and a spec file.

git diff > diff.patch

review (primary pipeline)

codereview review \
  --spec specs/default.toml \
  --diff diff.patch \
  --requirements requirements.md \
  --conventions conventions.md \
  --deterministic-results deterministic-results.json \
  --human-voice \
  --out runs/pr123

requirements, conventions, and deterministic-results are optional. If omitted, the tool emits explicit “not provided” sections rather than inventing assumptions.

Output (normally under runs/pr123):

  • `repo

项目描述

Reproducible full-review benchmark with clean English setup and runner documentation.

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

7-e1even
精选
7-e1even GitHub avatar

learn-agent

A collection of notes on building coding agents, derived from the production development of the desktop agent Reina, with each mechanism simplified into a zero-dependency, single-file Node.js demo.

AI 与机器学习大语言模型
218
slvDev
精选
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI 与机器学习大语言模型
1,960
jamesob
精选
jamesob GitHub avatar

local-llm

A comprehensive guide for building and configuring a high-end local machine to run state-of-the-art LLMs, with detailed hardware choices, BIOS tuning, and Docker-based model serving.

AI 与机器学习大语言模型
1,660