Agent Skills › repowise-dev/repowise › change-review

change-review

GitHub

用于在代码合并前审查变更风险。通过MCP工具评估整体变更及单个文件的风险,分析依赖影响、测试缺口和安全信号,辅助判断是否安全合并。

plugins/codex/skills/change-review/SKILL.md repowise-dev/repowise

Trigger Scenarios

review this PR is this safe to merge what is the blast radius of these changes did I miss anything

Install

npx skills add repowise-dev/repowise --skill change-review -g -y
More Options

Non-standard path

npx skills add https://github.com/repowise-dev/repowise/tree/main/plugins/codex/skills/change-review -g -y

Use without installing

npx skills use repowise-dev/repowise@change-review

指定 Agent (Claude Code)

npx skills add repowise-dev/repowise --skill change-review -a claude-code -g -y

安装 repo 全部 skill

npx skills add repowise-dev/repowise --all -g -y

预览 repo 内 skill

npx skills add repowise-dev/repowise --list

SKILL.md

Frontmatter
{
    "name": "change-review",
    "description": "Use when reviewing a set of changes before they merge in a Repowise-indexed repository, a PR, a branch diff, or the working-tree changes you just made. Activates for \"review this PR\", \"is this safe to merge\", \"what is the blast radius of these changes\", or \"did I miss anything\"."
}

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 a base..head range). No LLM, no network. Prefer this in-MCP tool; it takes a revspec and diffs server-side, so you never shell out. Lead with directive and health_delta — what the change actually made worse. Findings the change wrote sort above pre-existing ones it only touched. Then risk_percentile (this change ranked against sampled recent commits by diff size and spread, not a bug predictor), stated in one line by diff_shape; include=["scales"] adds its review_priority tercile and classification label. The raw 0-10 score ranks 0.99 against lines added, so it sits behind include=["diagnostics"] rather than on the wire. Omit revspec to score uncommitted work. This is the pre-merge gate: "how risky is this change overall?" The repowise 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 the directive block, 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 selection repowise impacted-tests makes, with tests_to_run_why giving each one's reason (the changed file and its evidence, or "runs with every subset"). Check tests_run_all first: when it is true no smaller set can be vouched for, tests_run_all_reasons says 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_basis is measured when stored per-test coverage decided a changed file and inferred when only the dependency graph or a rule did; say which. tests_status appears 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 guess, and a brand-new file is "unknown, run the full suite", never "no tests needed".

Then go deeper where it matters

  1. Why does this code exist? For any non-trivial changed file, call get_why(query="<file>") — don't let a change silently contradict a recorded architectural decision. Surface conflicts_with / supersedes hits.
  2. Did the change make health worse? get_health(targets=<changed files>, include=["biomarkers"]) — call out new complexity, deep nesting, or duplication the diff introduced.
  3. Who should review? get_risk ownership + co-change signals suggest the people with the most context on the touched code.

Getting the diff

  • A GitHub PR: gh pr diff <number> (or gh pr view <number> --json files).
  • A branch: git diff --name-only main...HEAD.
  • Working tree: git status --porcelain.
  • CLI shortcut for a range: repowise risk main..HEAD scores a branch/PR range for defect risk directly.

Write the review around evidence

Lead with a risk level and the directive findings, each tied to a concrete file. Distinguish "may break" (a dependent outside the diff) from "worth a look" (a co-change or health regression). Don't pad with findings the tools didn't support.

Error handling

If get_risk errors or returns nothing, the MCP server may be down or the repo unindexed — say so and review from the raw diff, noting that Repowise context was unavailable. Suggest /prompts:repowise-init if the repo isn't indexed.

Version History

  • 09471b8 Current 2026-10-19 07:00

    调整风险评分展示逻辑,优先显示基于差异大小和范围的百分位排名,而非审查优先级;修正修复历史记录中排除的配置文件范围。

  • 8f69324 2026-09-22 12:16

    优化评分排序逻辑,将引入的缺陷置于已有问题之前;移除无用的原始0-10分数,将其移至诊断字段;过滤测试文件性能发现并改进空Diff状态处理。

  • fbb78c4 2026-09-03 07:46

    修复技能文档生成漂移问题,统一共享源码并重新渲染,确保 Codex 等宿主同步获取最新的指令优先级调整(优先查看 directive 和 health_delta)。

  • 3433e55 2026-08-27 21:02

    将 get_risk 输出中的 will_break 重命名为 may_break,以准确反映基于文件列表而非完整 diff 的分析精度限制,并更新相关文档与 CLI 文本。

  • 370793f 2026-08-19 23:15

    修复风险报告数值含义歧义:移除冗余概率字段,明确分数单位为单提交校准,支持对未提交工作区打分,修正合并提交处理及作者查找失败逻辑。

  • b5f4753 2026-07-25 05:12

Same Skill Collection

plugins/claude-code/skills/architectural-decisions/SKILL.md
plugins/claude-code/skills/change-review/SKILL.md
plugins/claude-code/skills/code-health/SKILL.md
plugins/claude-code/skills/codebase-exploration/SKILL.md
plugins/claude-code/skills/dead-code-cleanup/SKILL.md
plugins/claude-code/skills/pre-modification/SKILL.md
plugins/codex/skills/architectural-decisions/SKILL.md
plugins/codex/skills/code-health/SKILL.md
plugins/codex/skills/codebase-exploration/SKILL.md
plugins/codex/skills/dead-code-cleanup/SKILL.md
plugins/codex/skills/pre-modification-check/SKILL.md

Metadata

Files
0
Version
09471b8
Hash
52be7dfc
Indexed
2026-07-25 05:12

홈 - 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-25 01:01
浙ICP备14020137号-1