change-review
它能做什么
这项技能帮助你的 AI 在代码改动合并之前评估其风险。适合在由 Repowise 建立索引的项目中工作、想知道改动可能会破坏什么的开发者。
适用场景
- ✓当你询问某个拉取请求或分支能否安全合并的时候。
- ✓当你想了解改动在整个代码库中的影响范围的时候。
- ✓当你怀疑漏掉了某个相关文件或后续改动的时候。
技能链接
https://github.com/repowise-dev/repowise/blob/main/plugins/claude-code/skills/change-review/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请审查这个拉取请求,告诉我它是否可以安全合并,以及还可能需要修改什么。”
每周 5 个新技能,1 分钟读完。
工作原理
技能利用 Repowise 把整个改动作为一个整体来评分,综合 git 历史、依赖关系、测试缺口和已记录的决定。然后它把最重要的风险排在前面,并列出可能需要更新的文件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Change Review with Repowise
When a diff is on the table, Repowise turns "what files changed" into "what does this change put at risk" — fusing git history (churn, ownership, co-change) with graph topology (dependents, impact surface), test gaps, security signals, and the architectural decisions that govern the touched code.
Two complementary risk signals, use both:
get_change_risk(revspec=…)(MCP) scores the whole change as one unit (a commit or abase..headrange). No LLM, no network. Prefer this in-MCP tool; it takes a revspec and diffs server-side, so you never shell out. Lead withdirectiveandhealth_delta— what the change actually made worse. Findings the change wrote sort above pre-existing ones it only touched. Thenrisk_percentile(this change ranked against sampled recent commits by diff size and spread, not a bug predictor), stated in one line bydiff_shape;include=["scales"]adds itsreview_prioritytercile andclassificationlabel. The raw 0-10scoreranks 0.99 against lines added, so it sits behindinclude=["diagnostics"]rather than on the wire. Omitrevspecto score uncommitted work. This is the pre-merge gate: "how risky is this change overall?" Therepowise risk <revspec>CLI is the identical scorer for when you are already in a terminal.get_risk(changed_files=…)(MCP) works per file and returns thedirectiveblock, the specific things to check inside the diff.
Score the whole change first
get_change_risk(revspec="main..HEAD") # HEAD, a commit SHA, or base..head
Read directive first: status, a headline naming what got worse, the
reasons behind it and next_actions to run. health_delta carries the
findings the change introduced or resolved. Then risk_percentile and the top
drivers: a high score from large diffusion (many dirs/subsystems) or low author
familiarity tells you where to look hardest. extensions=[".py", ".ts"] counts
only certain file types; exclude_patterns=["tests/"] omits paths. A warning
field, or a directive.status of unknown, means the revspec or filters
matched no files, so an all-zero score there is not a clean bill of health. The
equivalent from a terminal is repowise risk <revspec> (add --ext .py,.ts or
--format json).
Then drill into the per-file directive
Call get_risk in PR mode by passing the changed files:
get_risk(targets=<changed files>, changed_files=<same changed files>)
The response carries its own directive block, per file rather than per change
(distinct from get_change_risk's) — read it first, it's a few short lists:
may_break— files/symbols that import their way to what changed but are not in the diff. Reachability, not a diff: it says these depend on the changed files, not that the thing they use changed. Check each one.missing_cochanges— files that historically change together with the changed files but were left untouched. Often a forgotten update.missing_tests— changed code with a test gap. Flag for new/updated tests.tests_to_run: the tests the change needs, from the same selectionrepowise impacted-testsmakes, withtests_to_run_whygiving each one's reason (the changed file and its evidence, or "runs with every subset"). Checktests_run_allfirst: when it is true no smaller set can be vouched for,tests_run_all_reasonssays why, and the list is only what to run first; recommend the whole suite. When it is false the list is the set to run.tests_to_run_basisismeasuredwhen stored per-test coverage decided a changed file andinferredwhen only the dependency graph or a rule did; say which.tests_statusappears only when no selection could be made (timeout,config_invalid,unknown, ...), and then every test must run.
get_change_risk carries the same answer as impacted_tests: status
(selected or run_all, or why nothing was selected), run_all, reasons,
tests_to_run and why. include=["blast"] on get_risk adds
pr_blast_radius, the fuller dossier behind the directive's lists.
For the line-precise version from a terminal, repowise impacted-tests <revspec>
maps each changed line to the tests whose recorded coverage touches it, then
prints the ids (--format list | xargs pytest runs exactly them). It is honest
about gaps: a changed file with no coverage rows is a labelled filename
常见问题
审查结果首先展示什么?
首先说明这次改动让什么变得更糟,然后是改动的整体风险等级。
它能审查尚未提交的改动吗?
能。如果没有指定范围,它会对你未提交的工作评分。
它需要安装单独的工具吗?
它需要一个带有 .repowise 文件夹、由 Repowise 建立索引的项目。
详情
作者的原始描述
Use when reviewing a set of changes before they merge — a PR, a branch diff, or the working-tree changes you just made — in a Repowise-indexed codebase (.repowise/ directory exists). Activates for "review this PR", "is this safe to merge", "what's the blast radius of these changes", "did I miss anything", or "what else should change with this".
repo: repowise-dev/repowise
热度
- GitHub 星标
- 8.1k
- 排名
- #12565
- 许可证
- AGPL-3.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
architectural-decisions
8.1k帮你的智能体在修改架构之前,借助已记录的决定和历史,弄清代码为何是这样构建的。
code-health
8.1k帮你的智能体逐个文件评估代码健康度,找出风险最高的文件,并决定接下来重构哪些,所用分析来自 Repowise。
codebase-exploration
8.1k帮你的智能体通过回答代码如何运作、谁调用了什么以及东西在哪里构建,快速了解一个陌生项目。
dead-code-cleanup
8.1k帮你的智能体在项目中找出未使用的代码、无法到达的文件和未使用的导出,以便你安全地清理它们。