跳到正文
Skillpedia
通用编程29k · #9371

understand-pr

它能做什么

这项技能指导在合并之前对拉取请求进行全面审阅。适合审阅代码改动的开发者和维护者。

适用场景

  • ✓当你想审阅一个拉取请求,检查这项改动是否应该纳入代码库时。
  • ✓当你想在请别人审阅之前,先审阅自己的拉取请求时。
  • ✓当新的提交加入之后,你想进行复审时。

技能链接

https://github.com/mastra-ai/mastra/blob/main/.mastracode/skills/understand-pr/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/mastra-ai/mastra/blob/main/.mastracode/skills/understand-pr/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请审阅这个拉取请求,告诉我这项改动是否合理,并列出主要风险。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会先弄清改动的目标和一个简单的设计,然后将拉取请求与之对照,在代码中核实关键说法,并撰写简短的摘要。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Understand PR

Review the PR as a maintainer deciding whether the change belongs in the codebase. Help the human understand it without turning the review into a walkthrough. Run uninterrupted to a concise front page. For draft PRs authored by the user or a confirmed user-owned bot, follow gh-review's autonomous posting exception and finish the review without an approval checkpoint; otherwise stay available inside the goal until the human says the review is finished.

The PR follows ARGUMENTS: at the end of the objective. If absent, infer it from the conversation or checked-out branch.

What matters

  1. Your design before theirs. Establish the required outcome and real constraints from the problem and base branch, then choose the simplest design that satisfies them—not a restatement of the author's proposal. Compare the PR against that reasoning. Agreement is valid when independently justified; disagreement needs evidence, not merely a different preference.
  2. Depth proportional to risk. Blast radius, irreversibility, uncertainty, and public-contract impact determine how hard to look—not a fixed checklist.
  3. Verify material claims. Read code deeply and run the smallest useful probes. Findings need real evidence and pointers; process compliance is not evidence.
  4. Judgment over coverage theater. Find the core decision, root cause, and meaningful risks. Do not manufacture findings or run work merely to look thorough.
  5. Complete, not padded. Every request you have evidence for is in the review; length follows from findings, never the other way around. Lead with what matters most and cut narration, not requests. Preserve supporting detail in one review file for follow-up questions.

Review record

Use one ignored file: .mastracode/scratch/reviews/<owner>-<repo>-<pr>.md. Never stage or commit it.

Before reading the diff, write a short Pre-diff model containing:

  • the required outcome and constraints, separate from the proposed solution;
  • how the base branch currently works;
  • the cause or design pressure;
  • the simplest design that meets those requirements, why it is sufficient, and what you would deliberately not add (flags, config, documented limitations);
  • the behavior a valuable test would exercise;
  • what evidence would make you comfortable approving.

Once you inspect the PR, leave that section unchanged. Append the review beneath it. Capture decisive evidence as you work so it survives context compression, but keep a ledger—not command transcripts. Use references/templates.md as an example, not a schema.

1. Build the independent model

Resolve the PR and base branch using the minimal metadata recipe in references/archaeology.md. Until the pre-diff model is written, use only:

  • the problem statement from the PR title and description—treat any solution it names as the author's choice, not part of the problem;
  • linked issue context about the problem;
  • base-branch code and repository guidance.

Do not inspect the changed-file list, diff, PR branch, commits, review conversation, or CI details yet. Do not run git log before writing the pre-diff model—the current checkout may already be the PR branch, which would expose its commit history. Do not consult mastra_expert or another source that may know the PR. Orient on the base branch: locate the entry point, trace the current mechanism, find the closest sibling, and read the nearest repository instructions. Stop when you can explain the mechanism and commit to a design; do not perform archaeology for its own sake.

Write the pre-diff model. Before opening the diff, consider every entry in references/categories/README.md and load the pages relevant to the problem. These references contain broadly useful review knowledge, not just rules for one PR label. If a page could plausibly help, err on the side of reading it. Use their reading order, review focus, characteristic traps, and approval criteria to guide the investigation. Do not skip relevant pages because the main skill seems sufficient. Reading the relevant guidance is required; select checks according to the actual change and its risks rather than executing every listed recipe mechanically. Then open the PR fully.

2. Understand what actually changed

Read the changed-file overview and reassess the categories against the actual change. Load additional relevant pages before reviewing those portions in depth; do the same whenever later inspection reveals anot

常见问题

它会把审阅结果发布到 GitHub 上吗?

这项技能侧重于简报。发布由单独的审阅指南负责,并需要你的批准。

它会运行代码吗?

当小型检查有助于核实关于改动的说法时,它可以运行这些检查。

它只适用于大型改动吗?

不是。审阅的深度会根据改动的风险来调整。

详情

作者的原始描述

Review a PR the way a seasoned maintainer would — build an independent model before seeing the diff, investigate the implementation and history, verify material claims, and return a concise briefing. Use for any PR review, self-review, or re-review.

repo: mastra-ai/mastra

热度

GitHub 星标
29k
排名
#9371
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能