pr-explainer
できること
このスキルは、プルリクエストを分かりやすい言葉で説明するローカルのウェブページを作ります。何が変わったか、なぜ重要か、どう働くか、どうテストされたかを、差分全体を並べずに扱います。
使う場面
- ✓レビューアーが複雑なプルリクエストを素早く理解できるようにしたいとき。
- ✓大きな変更を、生の差分ではなく、案内つきで説明する必要があるとき。
- ✓問題、変更、証拠を1か所で説明したいとき。
スキルのリンク
https://github.com/mastra-ai/mastra/blob/main/.claude/skills/pr-explainer/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“レビューアーが10分で変更を理解できるよう、このプルリクエストのHTMLレビューガイドを作ってください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、ブランチ、コミット、変更されたファイルを読み、問題から、システムの文脈、主要な変更、テスト結果の順に説明を並べます。短いセクション、例、図を備えた1つのHTMLページを書きます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
PR Explainer
Create a local, self-contained HTML page that teaches a reviewer the PR story: what changed, why it matters, how it works, how it fits into the system, and how it was verified.
Required workflow
Understand the PR before writing HTML
- Collect PR title/number, branch, link if available, base branch, commit range, changed files, and verification already performed.
- Inspect the current state with
git status --short. - Inspect recent commits with
git log --oneline -n 10. - Inspect scope with
git diff <base>...HEAD --statandgit diff <base>...HEAD. - If one commit carries the main change, inspect it with
git show --stat <commit>andgit show <commit>.
Find the explanation path
- Do not explain files in raw diff order.
- Teach the change in this order when possible:
- problem,
- system context,
- before/after data or control flow,
- key code changes,
- proof from tests/builds/manual checks,
- reviewer takeaway.
- Classify changed files as core behavior, plumbing/integration, tests, release metadata, or incidental noise.
- Highlight only files that help explain the PR.
Write for approachability
- Use plain language, short sections, concrete before/after examples, small focused snippets, diagrams, tables, and callouts.
- Explain the problem before implementation details.
- Define acronyms or package-specific terms before using them.
- Avoid dumping the full diff or assuming the reviewer already knows internal context.
Create a local self-contained HTML file
- Put generated files in
.pr-review/. - Use one HTML file containing all CSS and content.
- Do not commit
.pr-review/by default. - Prefer repo ignore rules or
.git/info/excludeso generated review pages stay out of commits.
- Put generated files in
Recommended HTML structure
Use this structure unless the PR clearly needs a different teaching order:
Hero
- PR number/title, one-sentence summary, branch/link/status.
- Small metrics: files changed, tests added, packages affected.
Problem
- Previous behavior.
- Why it was wrong, confusing, missing, or risky.
System Context
- Where the change sits in the product or architecture.
- Upstream callers, downstream behavior, and why this is the right layer.
- Behavior intentionally not changed.
Before/After Flow
- Visual old path vs. new path when the PR changes flow, state, ownership, permissions, request handling, data transformation, or component relationships.
Code Walkthrough
- Step-by-step explanation path.
- Focused diffs for important files only.
- Explain what each snippet accomplishes and why it is necessary.
Tests / Verification
- Tests added or updated.
- Commands run for tests, build, typecheck, lint, or manual verification.
- Known unrelated warnings or failures, if any.
Reviewer Takeaway
- The shortest useful mental model of the PR.
- What the reviewer should focus on while reviewing the actual diff.
Diagrams
Add diagrams when they reduce cognitive load. Prefer simple HTML/CSS diagrams over external dependencies.
Good diagram types:
- Request flow: Client → Server → Handler → Service → Result
- Before/after path: broken path vs. fixed path
- Ownership map: package/module responsibility boundaries
- Data transformation: input → normalized form → output
- State machine: pending → running → complete/error
Each diagram must answer: “What does this help the reviewer understand faster?”
Focused diff snippets
Show snippets along the explanation path, not giant patches. Each important snippet should include:
- file path,
- relevant added/removed lines only,
- visual styling for additions/removals,
- a short explanation,
- connection back to the PR story.
Use this pattern:
<div class="diff">
<div class="diff-title">packages/example/src/file.ts</div>
<pre>
<span class="del">- old behavior</span>
<span class="add">+ new behavior</span>
</pre>
</div>
A reviewer should understand the PR without opening GitHub, but the page should not replace the final full diff review.
Verification requirements
End with proof. Include exact commands when available, for example:
pnpm --filter @scope/package test path/to/test.ts -- --run
pnpm turbo build --filter ./packages/package
If verification was not run, say so clearly and list the recommended commands
よくある質問
変更されたすべてのファイルを表示しますか?
いいえ。説明に役立つファイルだけを強調し、付随的なノイズは省きます。
ページはどこに保存されますか?
プロジェクト内のレビュー用フォルダにある、ローカルのページとして保存されます。
最初に何が必要ですか?
変更を見るための、プルリクエストのブランチとコミット履歴です。
詳細
作者による元の説明
Use when creating an approachable, self-contained HTML review aid for a pull request; explaining what changed, why it matters, how it works, and how it fits into the broader system; turning PR diffs, commits, tests, and architecture context into a local `.pr-review/` HTML page for reviewers; or helping reviewers understand complex code changes without dumping the full diff.
repo: mastra-ai/mastra
人気
- GitHubのスター
- 29k
- ランキング
- #9362
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
debugging-difficult-bugs
29kエージェントが、本物のプログラムが実行時にどう動くかをログに残して、難しいバグをデバッグできるよう支援します。テストだけで推測するのではありません。
mastra-frontend
29kエージェントが、スタイルを一から書くのではなく、既製のコンポーネントを組み合わせて、Mastraのプレイグラウンドのデザインシステムで画面を作れるよう支援します。
pr-splitter
29kエージェントが、大きく入り組んだプルリクエストを、元の作業を安全に保ちながら、レビューしやすい小さなプルリクエストに分けられるよう支援します。
ralph-plan
29kエージェントが、短いやり取りを通じて、作業に明確な段階と確認項目がある、構造化されたタスクのコマンドを計画できるよう支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。