ブランチの差分からプルリクエストの説明文を作成(日本語・英語)

Pull request description writer from the branch diff (English / Japanese)

base...HEAD の差分とコミットから、変更箇所・リスクの手がかり(マイグレーション・設定・依存関係・公開 API)・テストの変更をまとめ、概要・変更内容・テスト・リスク・リリース手順・スクリーンショットの PR 説明文を日本語か英語で作ります。

ClaudeHermes AgentCodexCursorMIT(改変・再配布・商用利用可)Python

できること

プルリクエストの説明文を、ブランチで実際に変わった内容から作ります。

  • 付属スクリプトが git diff base...HEAD と git log を読み、変更ファイルを領域(ディレクトリ)ごとに行数つきでまとめる
  • リスクの手がかりを表示: DB マイグレーション、依存パッケージ、設定・インフラ、CI、公開 API、認証まわり、削除されたファイル、500 行を超える変更、ALTER TABLE などの SQL、削除された公開関数
  • 変更されたテストファイルを一覧にし、コードだけ変わってテストがない場合は注意を表示
  • UI のファイルが変わったときだけスクリーンショットのチェックリストを入れる
  • 概要・変更内容・テスト・リスク・リリース手順と切り戻し・スクリーンショット・チェックリストのひな形を日本語または英語で出力し、エージェントが差分を読んで埋める

使い方

python scripts/pr_context.py --base main --lang ja

エージェントに「このブランチの PR 説明を書いて」と頼みます。Claude・Codex・Hermes Agent・Cursor で使えます。頼んだ場合だけ gh pr create などで PR を作成します。

必要な環境

  • Python 3(標準ライブラリのみ)
  • Git

注意点

  • スクリプトは読み取り専用で、push や PR の作成は行いません。
  • リスクの判定はファイルパスと一部の行パターンからのヒントです。最終的な内容は差分を読んで判断します。
  • 実行していないテストの結果は書きません。分からない部分はコメントのまま残します。
English description

Reads base...HEAD and the commits, groups changed areas, flags migrations, config, dependency and public API risks, lists test changes, and drafts a PR description in English or Japanese.

What it does

Writes a pull request description from what the branch actually changes.

  • The bundled script reads git diff base...HEAD and git log, and groups changed files by area with line counts
  • Risk hints: database migrations, dependencies, config and infrastructure, CI, public API, auth code, deleted files, changes over 500 lines, SQL such as ALTER TABLE, removed exported functions
  • Lists changed test files and warns when code changed without any test changes
  • Adds a screenshot checklist only when UI files changed
  • Prints a template in English or Japanese (summary, changes, testing, risks, rollout and rollback, screenshots, checklist) that the agent fills in after reading the diff

How to use

python scripts/pr_context.py --base main --lang en

Ask the agent to write the PR description for the current branch. Works with Claude, Codex, Hermes Agent and Cursor. It creates the PR (for example with gh pr create) only when you ask.

Requirements

  • Python 3 (standard library only)
  • Git

Caveats

  • The script is read-only; it never pushes or creates pull requests.
  • Risk flags are hints from file paths and a few line patterns; the final text is based on reading the diff.
  • It never claims test results that were not actually run; unknown parts stay as comments.

インストール方法

  1. ダウンロードしたZIPを展開します(中に pr-description-writer/ フォルダと SKILL.md があります)。
  2. フォルダごと、使うエージェントのスキル置き場にコピーします。
    • Claude:~/.claude/skills/(プロジェクト単位なら .claude/skills/)
    • Hermes Agent:~/.hermes/skills/
    • Codex:~/.agents/skills//Cursor:~/.cursor/skills/
    • Claude アプリ(claude.ai):「カスタマイズ → スキル」からZIPをアップロード
  3. エージェントを再起動し、スキル一覧に表示されることを確認します。

Windows・Mac 別、エージェント別のインストール手順

出品者

HackStar

Skills that make everyday developer work faster and safer: Git, testing, APIs and security.

出品スキル 8 件

出品者のプロフィールとスキル一覧