Claude Code Plugins

Community-maintained marketplace

Feedback

fix-dependabot-prs

@bannzai/Pilll
313
21

dependabotから上がってきた複数のPRを一括で解決し、まとめPRを作成する。dependabotのPR対応を依頼された時に使用。

Install Skill

Shared

Installs to .agents/skills, used by Codex, Amp, Warp, Cursor, OpenCode, and more.

CodexAmp
Warp
CursorOpenCode
Cline
Gemini CLI
GitHub Copilot
Personal

Available across projects.

$npx skills-installer add @bannzai/Pilll/fix-dependabot-prs --client shared
Project

Writes to .agents/skills.

$npx skills-installer add @bannzai/Pilll/fix-dependabot-prs -p --client shared
Note: Review the skill instructions before using it.

SKILL.md

name fix-dependabot-prs
description dependabotから上がってきた複数のPRを一括で解決し、まとめPRを作成する。dependabotのPR対応を依頼された時に使用。
allowed-tools Read, Bash(gh run:*), Bash(gh pr:*), Bash(git status:*), Bash(git push:*), Bash(git add:*), Bash(git commit:*), Bash(git cherry-pick:*), Bash(git merge:*), Bash(git fetch:*), Bash(git pull:*), Bash(git diff:*), Bash(git checkout:*), Bash(flutter:*), Bash(dart:*), Bash(pod:*), Glob, Grep, Write

Dependabot PRまとめ解決スキル

dependabotから上がってきた複数のPRを一括で解決し、まとめPRを作成します。

実行手順

1. dependabotのPR一覧を取得

gh pr list --author "app/dependabot" --state open

2. 各PRの状態を確認

各PRについて以下を確認する:

  • PRの変更内容(gh pr view <PR番号>)
  • GitHub ActionsのCI結果(gh pr checks <PR番号>)
  • 差分内容(gh pr diff <PR番号>)

3. まとめブランチを作成

git fetch origin
git checkout -b chore/dependabot-updates-$(date +%Y%m%d%H%M%S) origin/main

4. 各PRの変更を取り込む

各dependabot PRのブランチから変更を取り込む:

# 例: dependabot/npm_and_yarn/パッケージ名-バージョン のようなブランチ名
git fetch origin <dependabotブランチ名>
# コミットハッシュは `gh pr view <PR番号> --json commits --jq '.commits[0].oid'` で取得できます
git cherry-pick <コミットハッシュ>
# または
git merge origin/<dependabotブランチ名> --no-edit

5. 矛盾の解決

PR同士で矛盾する変更がある場合:

  • 両方の変更を取り込むのが難しい場合は、片方を諦めてOK
  • 諦めた理由と背景は、後でまとめPRにコメントとして記載する

6. コード生成の実行

dependabot PRはCIのcodegenステップで落ちていることが多いため、必ず実行する:

flutter pub run build_runner build --delete-conflicting-outputs
dart format lib

変更があればコミット:

git add -A
git commit -m "chore: run build_runner after dependency updates"

7. iOS Podfile.lockの更新

iOSの依存関係も更新が必要な場合が多い:

cd ios
pod install --repo-update
cd ..

変更があればコミット:

git add ios/Podfile.lock
git commit -m "chore: update Podfile.lock"

8. ビルド・テストの確認

flutter analyze
flutter test

9. まとめPRを作成

~/.agents/skills/commit-create-pr/SKILL.md に従い、push・PR 作成を行う。 本文には取り込んだ PR とバージョン変更、コード生成・Podfile.lock の更新内容、検証結果を記載する。 除外した PR があれば、理由・背景・今後の対応も同じ本文にまとめる。

10. 元のdependabot PRをクローズ

まとめPRがマージされた後、元のdependabot PRをクローズする:

gh pr close <PR番号> --comment "まとめPR #<まとめPR番号> で対応しました"

注意点

  • dependabotのPRは作成時点でCIが落ちていることが多いので、必ずCI結果を確認する
  • Flutter/Dartプロジェクトではbuild_runnerの実行が必要なことが多い
  • iOSビルドにはPodfile.lockの更新が必要なことが多い
  • 複数のパッケージ更新で依存関係が矛盾する場合は、無理に両方を取り込まず、片方を諦める判断も重要
  • 諦めた場合は必ず理由を記録する