diff-analyze
它能做什么
这项技能审查一组代码改动,为风险打分,并标明改动的类型。适合准备拉取请求或较大改动、希望快速进行风险检查的开发者。
适用场景
- ✓当你准备拉取请求,想了解其风险时。
- ✓当某项改动涉及多个模块,你希望有第二种视角时。
- ✓当你需要关于应邀请哪些审核者的建议时。
技能链接
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-jujutsu/skills/diff-analyze/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请分析我当前改动的风险,并建议应由谁来审核。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能根据你选择的基准读取 git 差异,为风险打分,对改动分类,并根据文件路径推断审核角色。它还会为每个文件给出行数和风险。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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
- Pick the ref —
HEADfor uncommitted work,main..BRANCHfor a branch (--branch), or the PR's base..head range (--pr, resolve it withgh pr view N --json baseRefName,headRefName). The analyze_* tools take arefand run git themselves; they do not accept diff text. - Analyze diff — call
mcp__plugin_ruflo-core_ruflo__analyze_diffwith{ ref, includeFileRisks: true }for a comprehensive analysis - Risk score — call
mcp__plugin_ruflo-core_ruflo__analyze_diff-riskwith{ ref }for a quantified risk assessment - Classify changes — call
mcp__plugin_ruflo-core_ruflo__analyze_diff-classifywith{ ref }to categorize (feature, bugfix, refactor, etc.) - Get reviewer roles — call
mcp__plugin_ruflo-core_ruflo__analyze_diff-reviewerswith{ ref, limit }for roles inferred from paths and risk; check CODEOWNERS separately when assigning people - Diff stats — call
mcp__plugin_ruflo-core_ruflo__analyze_diff-statswith{ ref }for line counts, file counts, complexity metrics - File-level risk — call
mcp__plugin_ruflo-core_ruflo__analyze_file-riskwith{ 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
常见问题
基准应该选什么?
未提交的工作使用 HEAD;比较分支与 main 时,或使用拉取请求的基础和目标范围。
它会指名具体的人吗?
它根据文件路径和风险建议角色。具体的人员请查看 CODEOWNERS 文件。
它会修改我的代码吗?
不会。它只分析改动并报告结果。
详情
作者的原始描述
Analyze git diffs for risk scoring, reviewer recommendations, and change classification. Use when preparing a PR, reviewing a large or cross-module change, or before merging to assess risk and pick reviewers.
repo: ruvnet/ruflo
热度
- GitHub 星标
- 81k
- 排名
- #1637
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。