From kk-dev
現在の変更からブランチ作成、コミット、プッシュ、PR 作成を一括実行する。CI の完了も監視する。トリガー - PR 作成, プルリクエスト, pull request, ブランチ作成して PR
How this skill is triggered — by the user, by Claude, or both
Slash command
/kk-dev:create-pr [--draft] [--skip-ci-wait] [--reviewer username][--draft] [--skip-ci-wait] [--reviewer username]haikuThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
- ブランチ: !`git branch --show-current`
git branch --show-currentgit status --shortgit diff現在の変更を確認し、以下のステップで PR を作成してください:
git branch --show-current)main または develop ブランチにいる場合はエラー終了git fetch origin を実行git push -u origin {branch} を実行gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'
gh pr create --base {default_branch} --body "{body}" で PR を作成以下の順序で PR テンプレートを探す:
# 優先順位の高い順にチェック
for tmpl in \
.github/pull_request_template.md \
.github/PULL_REQUEST_TEMPLATE.md \
pull_request_template.md \
PULL_REQUEST_TEMPLATE.md \
docs/pull_request_template.md; do
if [ -f "$tmpl" ]; then
echo "$tmpl"
break
fi
done
## Summary, ## Changes, ## Test plan など) を diff の内容に基づいて埋める。テンプレートの構造はそのまま維持し、セクションの中身だけを適切に記述する。テンプレート内にチェックボックス (- [ ]) がある場合はそのまま残す。diff に .tf ファイルが含まれる場合のみ実行する。含まれない場合はこのステップをスキップ。
which infracost
.tf ファイルが存在するディレクトリを特定するinfracost diff --path <tf ディレクトリ>
## Cost Estimate セクションに含める (gh pr edit で追記)PR 本文には何も追加しない。Step 5 の結果サマリーで以下を表示:
infracost をインストールすると Terraform の変更に対するコスト見積もりを PR に含められます。
PR 作成後、GitHub Actions の CI が完了するまで監視:
# 30秒間隔で最大20回 (10分) ポーリング
gh pr checks --watch --interval 30
成功: 完了メッセージを表示し、PR URL を出力
失敗: 失敗した job を特定し、ログを取得して問題を分析
gh run view {run_id} --log-failed
最終的に以下を出力:
$ARGUMENTS
引数で以下を指定可能:
--draft: ドラフト PR として作成--skip-ci-wait: CI の完了を待たずに終了--reviewer {username}: レビュアーを指定Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub kokoichi206/cc-plugins --plugin kk-dev