Gh pr create update
gh CLI を使って GitHub のPRを作成/更新する。ユーザーがPR作成/更新やドラフト/ベース/ラベル管理を依頼したときに使う。デフォルトのベースブランチ選定とPRテンプレートの利用を扱う。From its SKILL.md
npx -y skills add dsk52/skills --skill gh-pr-create-updateAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
3.0 KB, 959 tokens by cl100k_base, as published. Nobody here has run it
GH PR 作成/更新
前提
- PR操作は
ghCLI を使う。 - 現在のリポジトリで作業する。
.github/pull_request_template.mdがあればその構成に従う。なければ「背景・対応内容・補足・レビューしてほしい点」を使う。
ワークフロー
-
ブランチの状態を確認
- pushされいてるか確認し、必要があればユーザーに確認する
-
必要情報の収集
- ユーザーが提示した情報(タイトル、ベースブランチ、ラベル、ドラフト指定など)は反映する。
- ベースブランチ指定がなければ
mainを使う。 - ベースブランチ指定がある場合(例:
topic/*、release/*)はそれに従う。 - ドラフト指定がなければドラフトにする。
-
PR本文の作成
- テンプレートがある場合、日本語で記入し構成は維持する。
- テンプレートがない場合、日本語セクションを作る。
- 背景
- 対応内容
- 補足
- レビューしてほしい点
- ユーザーの要望があればケース別の変更内容を含める。
- 本文はPR内の差分すべてから生成する。
- 実行したテストは箇条書きで記載する。
- Markdownの見出し(最低でも
##)を必ず含める。 - PR本文は
\nに依存せず、ヒアドキュメントで作り--body-file -に渡す。 gh pr create --body "..."/gh pr edit --body "..."のような直書きは使わない(バッククォート等のシェル展開事故を防ぐため)。
-
PR作成
--body-file -のヒアドキュメントを使う。cat <<'EOF' | gh pr create --draft --base <base> --head <current-branch> --title <title> --body-file -## 背景...EOF
- ラベル指定があれば
--label codexのように追加する。
-
PR更新
--body-file -のヒアドキュメントを使う。cat <<'EOF' | gh pr edit <number|url> --title <title> --body-file - --base <base> --add-label <label>## 背景...EOF
判断ルール
- 既存PRがある、または更新依頼の場合は
gh pr editを優先する。 - PRの有無が不明なら
gh pr view --json number,urlを実行し、結果に応じて判断する。 - 本文は簡潔・事実ベースで、無関係な変更は書かない。
例
- "これまでの内容でmainに向けてPRを作って"
- "ここまでの内容を元にPRを更新して"
- "今回行なった作業を元にPRを更新して"
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.