jpskill.com
🛠️ 開発・MCP コミュニティ

pr-description

ブランチの差分から、変更内容、理由、確認方法などをまとめた質の高いプルリクエストの説明文を、レビュー担当者が理解しやすいように作成するSkill。

📜 元の英語説明(参考)

Generates structured pull request descriptions from branch diffs with context, motivation, testing instructions, rollback plans, and reviewer guidance. Produces descriptions that help reviewers understand what changed, why, and how to verify. Use when creating PRs, writing PR descriptions, preparing merge requests, or when the user asks for help describing their changes.

🇯🇵 日本人クリエイター向け解説

一言でいうと

ブランチの差分から、変更内容、理由、確認方法などをまとめた質の高いプルリクエストの説明文を、レビュー担当者が理解しやすいように作成するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o pr-description.zip https://jpskill.com/download/9144.zip && unzip -o pr-description.zip && rm pr-description.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9144.zip -OutFile "$d\pr-description.zip"; Expand-Archive "$d\pr-description.zip" -DestinationPath $d -Force; ri "$d\pr-description.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して pr-description.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → pr-description フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

PR Description Generator

概要

レビュー担当者に、何が変更されたかだけでなく、なぜ変更されたのかを伝えるプルリクエストの説明を生成します。すべてのPRの説明には、動機、変更点、テスト手順、ロールバック計画、およびレビュー担当者へのガイダンスのための構造化されたセクションが含まれています。目標は、レビュー担当者がフォローアップの質問をすることなく、変更を理解し、検証し、安全にデプロイできるような説明を作成することです。

どのようなときに使うか

  • プルリクエストまたはマージリクエストを作成するとき
  • PRの説明を作成または改善するとき
  • レビューのためにブランチの変更点を要約するように求められたとき
  • コードレビューのために変更セットを準備するとき
  • ユーザーが「変更内容を説明して」または「PRの説明を書いて」と言ったとき

以下の場合には使用しないでください:

  • ユーザーがコミットメッセージを求めている場合(コミットメッセージスキルを使用)
  • ユーザーが変更履歴のエントリを求めている場合(変更履歴スキルを使用)
  • ユーザーが変更のコードレビューを求めている場合(コードレビューのスキルを使用)

ワークフロー

1. ブランチ全体の差分を分析する

何かを書く前に、変更の完全な範囲を理解します。

  • ブランチとそのベース(通常は main)の間の完全な差分を読みますgit diff main...HEAD または同等のものを使用します。
  • 変更されたファイルを数え、新しいファイル、変更されたファイル、削除されたファイルとして分類します。
  • 変更の種類を特定します: 機能、バグ修正、リファクタリング、インフラストラクチャ、ドキュメント、または混合。
  • 依存関係をマッピングします: どの変更が他の変更に依存していますか?論理的なグループ化は何ですか?

出力:何が変更されたか、そしてそれらの要素がどのように適合するかについてのメンタルモデル。

2. 動機と背景を決定する

これは最も重要なステップです。レビュー担当者はWHATの前にWHYを知る必要があります。

  • これはどのような問題を解決しますか? issue、バグレポート、またはユーザーフィードバックへのリンク。
  • なぜ今なのか? 何がこの作業を引き起こしたのか — バグレポート、パフォーマンスの低下、新しい要件?
  • どのような代替案が検討されましたか? 拒否されたアプローチとその理由を簡単に説明します。
  • リスクは何ですか? セキュリティへの影響、パフォーマンスへの影響、破壊的な変更。

動機が差分から明らかでない場合は、ユーザーに尋ねてください。動機を推測しないでください — 間違った「なぜ」は「なぜ」がないよりも悪いです。

3. 構造化された説明を書く

以下の出力テンプレートを使用してください。すべてのセクションを埋めてください。セクションが本当に適用されない場合(たとえば、ドキュメントのみの変更にはロールバックは不要)、省略するのではなく、適用できない理由を明示的に記述してください。

4. テスト手順を書く

テスト手順はコピー&ペースト可能でなければなりません。レビュー担当者は、解釈なしにステップバイステップでそれらに従うことができる必要があります。

  • 実行する正確なコマンド(フラグと引数付き)を含めます
  • 各ステップの予想される出力または動作を指定します
  • ハッピーパスと少なくとも1つのエッジケースをカバーします
  • 手動テストが必要な場合は、正確なUIステップを記述します
  • レビュー担当者が特定のデータまたは構成を必要とする場合は、セットアップ手順を含めます

悪い例:「ログインフローをテストする」良い例:「1. npm run dev を実行する 2. /login に移動する 3. 「Googleでサインイン」をクリックする 4. Google OAuthの同意画面へのリダイレクトを確認する 5. 同意後、/dashboard へのリダイレクトと、右上隅にユーザーアバターが表示されることを確認する」

5. ロールバック計画を書く

すべての本番環境向けの変更には、ロールバック計画が必要です。以下を含めます。

  • リバートする方法: 正確なコマンドまたはステップ(例:git revert <sha>
  • データベースの移行: 可逆的ですか?ダウンマイグレーションは何ですか?
  • フィーチャーフラグ: デプロイなしでこれをオフに切り替えることはできますか?
  • データへの影響: リバートするとユーザーデータが失われたり、孤立したレコードが残ったりしますか?
  • 依存関係: これをリバートすると、他のデプロイされた変更が壊れますか?

6. 注意深いレビューが必要な領域にフラグを立てる

レビュー担当者が注意を集中できるように支援します。

  • セキュリティに敏感な変更: 認証ロジック、入力検証、データアクセス
  • パフォーマンスが重要なパス: ホットループ、データベースクエリ、API呼び出し
  • 破壊的な変更: APIコントラクトの変更、スキーマの移行
  • 複雑なロジック: アルゴリズム、ステートマシン、並行処理
  • 確信が持てない領域: 確信が持てないことについて正直に話してください

ファイル固有のガイダンスについてはPR差分でインラインコメントを使用し、クロス・カッティングな懸念事項についてはReviewer Notesセクションを使用します。

出力テンプレート

すべてのPRの説明を次のように構成します。

## Summary

[このPRが何を行い、なぜ行うのかについての1〜3文の概要。WHYから始めます。]

## Motivation

[これはどのような問題を解決しますか?なぜ今この変更が必要なのですか?issueまたはバグレポートへのリンク。検討された代替案とその拒否された理由について言及します。]

## Changes

[変更された内容の整理されたリスト。論理的にグループ化されています。ファイルごとのリストではありません — 概念または機能領域でグループ化します。]

- **[Area 1]**: [何が変更され、なぜ変更されたのか]
- **[Area 2]**: [何が変更され、なぜ変更されたのか]
- **[Area 3]**: [何が変更され、なぜ変更されたのか]

## Testing Instructions

[レビュー担当者が変更が機能することを確認するために従うことができるステップバイステップの手順。コマンドはコピー&ペースト可能でなければなりません。]

1. [必要に応じてセットアップ手順]
2. [実行するアクション]
3. [予想される結果]
4. [検証するエッジケース]

### Automated Tests

- [新規または変更されたテストのリストと、それらがカバーするもの]

## Rollback Plan

[この変更を安全に元に戻す方法。正確なコマンド、移行の反転手順、およびデータへの影響評価を含めます。]

## Reviewer Notes

[注意深いレビューが必要な領域。セキュリティ上の懸念、パフォーマンスへの影響、破壊的な変更、または不確実な領域。レビュー担当者が注意を集中できるように支援します。]

- **[File or area]**: [何を探すべきか、そしてなぜ]

シナリオ: APIゲートウェイにレート制限を追加するブランチ。

入力差分サマリー: 4つのファイルが変更されました — 新しいミドルウェア、構成の更新、テスト、ドキュメント。

出力:

## Summary

APIゲートウェイにリクエストレート制限を追加して、不正使用を防ぎ、トラフィックの急増からダウンストリームサービスを保護します。2026-02-28の停止がきっかけで、単一のクライアントが50kリクエスト/分を送信しました。

## Motivation

2月28日、誤って構成されたクライアントスクリプトが `/api/orders` を50k req/minで叩き、注文サービスを圧倒し、23分間の停止を引き起こしました(INC-4521)。単一のクライアントが他のクライアントのサービスを低下させるのを防ぐために、ゲートウェイレベルでクライアントごとのレート制限が必要です。

Alterna

(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

PR Description Generator

Overview

Generate pull request descriptions that tell reviewers WHY something changed, not just WHAT changed. Every PR description includes structured sections for motivation, changes, testing instructions, rollback plan, and reviewer guidance. The goal is a description that lets a reviewer understand, verify, and safely deploy the change without asking follow-up questions.

When to use

  • When creating a pull request or merge request
  • When writing or improving a PR description
  • When asked to summarize branch changes for review
  • When preparing a changeset for code review
  • When the user says "describe my changes" or "write a PR description"

Do NOT use when:

  • The user wants a commit message (use a commit message skill)
  • The user wants a changelog entry (use a changelog skill)
  • The user wants a code review of the changes (use a code review skill)

Workflow

1. Analyze the Full Branch Diff

Before writing anything, understand the complete scope of changes:

  • Read the full diff between the branch and its base (usually main). Use git diff main...HEAD or equivalent.
  • Count changed files and categorize them: new files, modified files, deleted files.
  • Identify the change type: feature, bugfix, refactor, infrastructure, documentation, or mixed.
  • Map dependencies: Which changes depend on others? What's the logical grouping?

Output: A mental model of what changed and how the pieces fit together.

2. Determine Motivation and Context

This is the most important step. Reviewers need to know WHY before WHAT.

  • What problem does this solve? Link to issues, bug reports, or user feedback.
  • Why now? What triggered this work — a bug report, a performance regression, a new requirement?
  • What alternatives were considered? Briefly note rejected approaches and why.
  • What's the risk? Security implications, performance impact, breaking changes.

If the motivation isn't obvious from the diff, ask the user. Never guess at motivation — a wrong "why" is worse than no "why."

3. Write the Structured Description

Use the output template below. Fill every section. If a section genuinely doesn't apply (e.g., no rollback needed for a docs-only change), explicitly state why it's not applicable rather than omitting it.

4. Write Testing Instructions

Testing instructions must be copy-pasteable. A reviewer should be able to follow them step-by-step without interpretation.

  • Include exact commands to run (with flags and arguments)
  • Specify expected output or behavior for each step
  • Cover the happy path AND at least one edge case
  • If manual testing is needed, describe exact UI steps
  • Include setup steps if the reviewer needs specific data or configuration

Bad: "Test the login flow" Good: "1. Run npm run dev 2. Navigate to /login 3. Click 'Sign in with Google' 4. Verify redirect to Google OAuth consent screen 5. After consent, verify redirect back to /dashboard with user avatar in top-right"

5. Write the Rollback Plan

Every production-facing change needs a rollback plan. Include:

  • How to revert: Exact commands or steps (e.g., git revert <sha>)
  • Database migrations: Are they reversible? What's the down migration?
  • Feature flags: Can this be toggled off without a deploy?
  • Data impact: Will reverting lose user data or leave orphaned records?
  • Dependencies: Does reverting this break other deployed changes?

6. Flag Areas for Careful Review

Help reviewers focus their attention:

  • Security-sensitive changes: Auth logic, input validation, data access
  • Performance-critical paths: Hot loops, database queries, API calls
  • Breaking changes: API contract changes, schema migrations
  • Complex logic: Algorithms, state machines, concurrency
  • Areas you're uncertain about: Be honest about what you're not sure of

Use inline comments in the PR diff for file-specific guidance, and the Reviewer Notes section for cross-cutting concerns.

Output Template

Structure every PR description as follows:

## Summary

[1-3 sentence overview of what this PR does and why. Lead with the WHY.]

## Motivation

[What problem does this solve? Why is this change needed now? Link to issues or
bug reports. Mention alternatives considered and why they were rejected.]

## Changes

[Organized list of what changed, grouped logically. Not a file-by-file list —
group by concept or feature area.]

- **[Area 1]**: [What changed and why]
- **[Area 2]**: [What changed and why]
- **[Area 3]**: [What changed and why]

## Testing Instructions

[Step-by-step instructions a reviewer can follow to verify the change works.
Commands must be copy-pasteable.]

1. [Setup step if needed]
2. [Action to take]
3. [Expected result]
4. [Edge case to verify]

### Automated Tests

- [List of new or modified tests and what they cover]

## Rollback Plan

[How to revert this change safely. Include exact commands, migration reversal
steps, and data impact assessment.]

## Reviewer Notes

[Areas that need careful review. Security concerns, performance implications,
breaking changes, or areas of uncertainty. Help reviewers focus their
attention.]

- **[File or area]**: [What to look for and why]

Example

Scenario: Branch adding rate limiting to the API gateway.

Input diff summary: 4 files changed — new middleware, config updates, tests, docs.

Output:

## Summary

Adds request rate limiting to the API gateway to prevent abuse and protect
downstream services from traffic spikes. Triggered by the outage on 2026-02-28
where a single client sent 50k requests/minute.

## Motivation

On Feb 28, a misconfigured client script hammered `/api/orders` at 50k req/min,
overwhelming the orders service and causing a 23-minute outage (INC-4521). We
need per-client rate limiting at the gateway level to prevent any single client
from degrading service for others.

Alternatives considered:

- **Application-level rate limiting**: Rejected because each service would need
  its own implementation, and the gateway already sees all traffic.
- **CDN-level rate limiting**: Too coarse — we need per-API-key limits, not
  per-IP.

## Changes

- **Rate limit middleware** (`src/middleware/rate-limiter.ts`): New sliding
  window rate limiter using Redis. Configurable per-route limits with sensible
  defaults (1000 req/min for reads, 100 req/min for writes).
- **Configuration** (`config/rate-limits.yaml`): Per-route limit definitions.
  Defaults can be overridden per API key via the admin dashboard.
- **Gateway integration** (`src/gateway.ts`): Middleware registered before
  routing. Returns 429 with `Retry-After` header when limit exceeded.
- **Tests** (`tests/rate-limiter.test.ts`): 12 new tests covering sliding window
  accuracy, Redis failure fallback, and per-key override behavior.

## Testing Instructions

1. Start Redis locally: `docker run -d -p 6379:6379 redis:7-alpine`
2. Run the test suite: `npm test -- --grep "rate-limiter"`
3. Verify all 12 tests pass
4. Start the dev server: `REDIS_URL=redis://localhost:6379 npm run dev`
5. Send 5 rapid requests:
   `for i in {1..5}; do curl -s -o /dev/null -w "%{http_code}\n" http://localhost:3000/api/orders; done`
6. Verify all return 200
7. Send 1001 requests rapidly:
   `ab -n 1001 -c 10 http://localhost:3000/api/orders`
8. Verify the last requests return 429 with a `Retry-After` header

### Automated Tests

- `rate-limiter.test.ts`: Sliding window counting, Redis connection failure
  fallback to in-memory, per-key limit overrides, 429 response format

## Rollback Plan

1. Revert this PR: `git revert <merge-sha>`
2. Deploy the revert — no database migrations to reverse
3. Redis rate limit keys will expire naturally (TTL = window size)
4. No data loss risk — rate limiting is stateless from the application's
   perspective
5. If Redis is the issue (not this code), disable rate limiting via env var:
   `RATE_LIMIT_ENABLED=false`

## Reviewer Notes

- **`src/middleware/rate-limiter.ts:45-62`**: The sliding window algorithm —
  please verify the math on window boundary transitions. I'm using a weighted
  overlap approach rather than fixed windows.
- **Redis failure mode** (`rate-limiter.ts:78`): When Redis is unreachable, we
  fall back to in-memory limiting. This means limits aren't shared across
  instances — acceptable for a degraded mode, but worth discussing.
- **Security**: Rate limit headers expose the client's current usage. Verify
  this doesn't leak sensitive information for your use case.

Common Mistakes

Mistake Fix
File-by-file change list instead of conceptual grouping Group changes by feature area or concept, not by filename
Missing motivation ("what" without "why") Always explain the problem being solved and why this approach was chosen
Vague testing instructions ("test the feature") Write copy-pasteable commands with expected outputs for each step
No rollback plan Every production change needs revert steps, migration reversal, and data impact
Omitting reviewer guidance Flag security-sensitive, performance-critical, and uncertain areas explicitly
Assuming reviewers have context Link to issues, explain acronyms, provide background for domain-specific changes
Listing every file changed Summarize conceptually — reviewers can see the file list in the diff
No edge case in testing instructions Include at least one error path or boundary condition to verify
Rollback plan says "revert the PR" with no details Specify exact commands, migration steps, data impact, and dependency considerations

Key Principles

  1. WHY before WHAT — The motivation section is the most important part of a PR description. A reviewer who understands why a change was made can evaluate whether the approach is correct. A reviewer who only knows what changed can only check for typos. Lead every description with the problem being solved.

  2. Testing instructions must be copy-pasteable — If a reviewer has to interpret, adapt, or guess at your testing instructions, they won't test. Include exact commands, expected outputs, and setup steps. A reviewer should be able to verify the change by copying and pasting from the PR description.

  3. Every change is revertible until proven otherwise — Include a rollback plan for every PR. If the change truly can't be reverted (destructive migration, data format change), say so explicitly and explain the mitigation strategy. "No rollback needed" is almost always wrong.

  4. Guide the reviewer's attention — Reviewers have limited time and attention. Flag the 2-3 areas that matter most: security-sensitive logic, complex algorithms, performance-critical paths, or areas where you're uncertain. Don't make them discover the important parts on their own.

  5. Describe concepts, not files — Group changes by what they accomplish, not which files they touch. "Added rate limiting middleware with Redis-backed sliding windows" is useful. "Changed rate-limiter.ts, gateway.ts, config.yaml" is not — the reviewer can see the file list in the diff.