技能 编程开发 Git 代码变更风险与评审分析

Git 代码变更风险与评审分析

v20261020
diff-analyze
此技能用于分析 Git 代码差异,评估风险等级、推荐评审人员并对变更进行分类。在提交 PR 或合并前,帮助开发者理解变更风险,特别是针对大型或跨模块的修改。支持指定分支或 PR 范围,提供详细的统计数据和文件级风险评估。
获取技能
422 次下载
概览

Diff Analysis

Analyze git diffs for risk, complexity, and reviewer assignment.

When to use

Before submitting a PR or after making significant changes, analyze the diff to understand risk level, get reviewer recommendations, and classify the type of change.

Steps

  1. Pick the ref — HEAD for uncommitted work, main..BRANCH for a branch (--branch), or the PR's base..head range (--pr, resolve it with gh pr view N --json baseRefName,headRefName). The analyze_* tools take a ref and run git themselves; they do not accept diff text.
  2. Analyze diff — call mcp__plugin_ruflo-core_ruflo__analyze_diff with { ref, includeFileRisks: true } for a comprehensive analysis
  3. Risk score — call mcp__plugin_ruflo-core_ruflo__analyze_diff-risk with { ref } for a quantified risk assessment
  4. Classify changes — call mcp__plugin_ruflo-core_ruflo__analyze_diff-classify with { ref } to categorize (feature, bugfix, refactor, etc.)
  5. Get reviewer roles — call mcp__plugin_ruflo-core_ruflo__analyze_diff-reviewers with { ref, limit } for roles inferred from paths and risk; check CODEOWNERS separately when assigning people
  6. Diff stats — call mcp__plugin_ruflo-core_ruflo__analyze_diff-stats with { ref } for line counts, file counts, complexity metrics
  7. File-level risk — call mcp__plugin_ruflo-core_ruflo__analyze_file-risk with { path } (required) for each file the earlier steps flagged

Risk factors

  • Files with high churn history
  • Security-sensitive paths (auth, crypto, permissions)
  • Large diffs (>500 lines)
  • Cross-module changes
  • Database migration files
信息
分类 编程开发
名称 diff-analyze
版本 v20261020
大小 2.21KB
更新时间 2026-10-21
语言