jpskill.com
💬 コミュニケーション コミュニティ 🟢 非エンジニアでもOK 👤 管理職・人事・カスタマー対応

💬 Iterate Pr

iterate-pr

CIが合格するまで、レビューのフィードバックやエラー修正を自動で繰り返し、継続的にコードをプッシュするSkill。

⏱ クレーム返信ドラフト 15分 → 2分

📺 まず動画で見る(YouTube)

▶ 【最新版】Claude(クロード)完全解説!20以上の便利機能をこの動画1本で全て解説 ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

Iterate on a PR until CI passes. Use when you need to fix CI failures, address review feedback, or continuously push fixes until all checks are green. Automates the feedback-fix-push-wait cycle.

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

一言でいうと

CIが合格するまで、レビューのフィードバックやエラー修正を自動で繰り返し、継続的にコードをプッシュするSkill。

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

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

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

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

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

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して iterate-pr.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → iterate-pr フォルダができる
  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-17
取得日時
2026-05-17
同梱ファイル
1

💬 こう話しかけるだけ — サンプルプロンプト

  • Iterate Pr で、お客様への返信文を作って
  • Iterate Pr を使って、社内向けアナウンスを書いて
  • Iterate Pr で、メールテンプレートを整備して

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

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

[Skill 名] iterate-pr

CIがパスするまでPRを反復処理する

すべてのCIチェックがパスし、レビューフィードバックが対処されるまで、現在のブランチで継続的に反復処理を行います。

必須: GitHub CLI (gh) が認証済みであること。

重要: すべてのスクリプトは、スキルディレクトリからではなく、リポジトリのルートディレクトリ(.gitがある場所)から実行する必要があります。スクリプトへのフルパスは${CLAUDE_SKILL_ROOT}を介して使用してください。

バンドルされたスクリプト

scripts/fetch_pr_checks.py

CIチェックのステータスを取得し、ログから失敗のスニペットを抽出します。

uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_checks.py [--pr NUMBER]

JSONを返します:

{
  "pr": {"number": 123, "branch": "feat/foo"},
  "summary": {"total": 5, "passed": 3, "failed": 2, "pending": 0},
  "checks": [
    {"name": "tests", "status": "fail", "log_snippet": "...", "run_id": 123},
    {"name": "lint", "status": "pass"}
  ]
}

scripts/fetch_pr_feedback.py

LOGAFスケールを使用して、PRレビューフィードバックを取得し、分類します。

uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_feedback.py [--pr NUMBER]

フィードバックが次のように分類されたJSONを返します:

  • high - マージ前に必ず対処する必要があるもの(h:、ブロッカー、変更要求)
  • medium - 対処すべきもの(m:、標準的なフィードバック)
  • low - オプション(l:、軽微な指摘、スタイル、提案)
  • bot - 情報提供の自動コメント(Codecov、Dependabotなど)
  • resolved - すでに解決済みのスレッド

レビューボットのフィードバック(Sentry、Warden、Cursor、Bugbot、CodeQLなどからのもの)は、review_bot: trueとともにhigh/medium/lowに表示されます。これらはbotバケットには配置されません。

各フィードバック項目には、以下も含まれる場合があります:

  • thread_id - インラインレビューコメントのGraphQLノードID(返信に使用)

ワークフロー

1. PRを特定する

gh pr view --json number,url,headRefName

現在のブランチにPRが存在しない場合は停止します。

2. レビューフィードバックを収集する

${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_feedback.pyを実行して、PRにすでに投稿されている分類済みのフィードバックを取得します。

3. LOGAF優先度に基づいてフィードバックを処理する

自動修正(プロンプトなし):

  • high - 必ず対処する必要があるもの(ブロッカー、セキュリティ、変更要求)
  • medium - 対処すべきもの(標準的なフィードバック)

フィードバックを修正する際:

  • 表面的な症状だけでなく、根本原因を理解する
  • 周囲のコードや関連ファイルで同様の問題がないか確認する
  • 述べられている箇所だけでなく、すべてのインスタンスを修正する

これにはレビューボットのフィードバック(review_bot: trueの項目)も含まれます。人間からのフィードバックと同じように扱います:

  • 実際の問題が見つかった場合 → 修正する
  • 誤検知の場合 → スキップするが、簡単なコメントで理由を説明する
  • レビューボットのフィードバックを黙って無視しない — 常にその発見を検証する

ユーザーに選択を促す:

  • low - 番号付きリストを提示し、どれに対処するか尋ねる:
Found 3 low-priority suggestions:
1. [l] "Consider renaming this variable" - @reviewer in api.py:42
2. [nit] "Could use a list comprehension" - @reviewer in utils.py:18
3. [style] "Add a docstring" - @reviewer in models.py:55

Which would you like to address? (e.g., "1,3" or "all" or "none")

黙ってスキップする:

  • resolvedスレッド
  • botコメント(情報提供のみ — Codecov、Dependabotなど)

コメントへの返信

各インラインレビューコメントを処理した後、PRスレッドで取られたアクションを承認するために返信します。thread_idを持つ項目(インラインレビューコメント)にのみ返信します。

返信するタイミング:

  • highおよびmediumの項目 — 修正されたか、誤検知と判断されたかに関わらず
  • lowの項目 — 修正されたか、ユーザーによって却下されたかに関わらず

返信方法: pullRequestReviewThreadIdbodyを入力として、addPullRequestReviewThreadReply GraphQLミューテーションを使用します。

返信形式:

  • 1-2文: 何が変更されたか、なぜ問題ではないのか、または却下された項目の承認
  • すべての返信は\n\n*— Claude Code*で終わる
  • 返信する前に、スレッドにすでに*- Claude Code*または*— Claude Code*で終わる返信がないか確認し、再ループでの重複を避ける
  • gh api呼び出しが失敗した場合は、ログに記録して続行する — ワークフローをブロックしない

4. CIステータスを確認する

${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_checks.pyを実行して、構造化された失敗データを取得します。

保留中の場合は待機する: レビューボットのチェック(sentry、warden、cursor、bugbot、seer、codeql)がまだ実行中の場合は、続行する前に待機してください。これらは評価する必要がある実行可能なフィードバックを投稿します。情報提供ボット(codecov)は待つ価値がありません。

5. CIの失敗を修正する

スクリプト出力の各失敗について:

  1. log_snippetを読み、エラーから逆方向にたどって、何が失敗したかだけでなく、なぜ失敗したかを理解する
  2. 関連するコードを読み、関連する問題がないか確認する(例: ある呼び出しサイトで型エラーが発生した場合、他の呼び出しサイトも確認する)
  3. 最小限の的を絞った変更で根本原因を修正する
  4. 影響を受けるコードの既存のテストを見つけて実行する。修正によって既存のテストでカバーされていない動作が導入された場合は、それをカバーするようにテストを拡張する(新しいテストファイル全体ではなく、テストケースを追加する)

チェック名だけで何が失敗したかを推測しないでください — 常にログを読んでください。「クイック修正して期待する」ことはしないでください — コードを変更する前に失敗を徹底的に理解してください。

6. ローカルで検証し、コミットしてプッシュする

コミットする前に、ローカルで修正を検証してください:

  • テストの失敗を修正した場合: その特定のテストをローカルで再実行する
  • lint/型エラーを修正した場合: 影響を受けるファイルでリンターまたは型チェッカーを再実行する
  • コードの修正の場合: 変更されたコードをカバーする既存のテストを実行する

ローカル検証が失敗した場合は、続行する前に修正してください — 既知の壊れたコードをプッシュしないでください。

git add <files>
git commit -m "fix: <descriptive message>"
git push

7. CIを監視し、フィードバックに対処する

ブロックする代わりに、ループでCIステータスとレビューフィードバックをポーリングします:

  1. uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_checks.pyを実行して、現在のCIステータスを取得します
  2. すべてのチェックがパスした場合 → 終了条件に進む
  3. いずれかのチェックが失敗した場合(保留中のものがない) → ステップ5に戻る
  4. チェックがまだ保留中の場合: a. uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_feedback.pyを実行して、新しいレビューフィードバックを取得します b. 新しいhigh/mediumフィードバックに対処します
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Iterate on PR Until CI Passes

Continuously iterate on the current branch until all CI checks pass and review feedback is addressed.

Requires: GitHub CLI (gh) authenticated.

Important: All scripts must be run from the repository root directory (where .git is located), not from the skill directory. Use the full path to the script via ${CLAUDE_SKILL_ROOT}.

Bundled Scripts

scripts/fetch_pr_checks.py

Fetches CI check status and extracts failure snippets from logs.

uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_checks.py [--pr NUMBER]

Returns JSON:

{
  "pr": {"number": 123, "branch": "feat/foo"},
  "summary": {"total": 5, "passed": 3, "failed": 2, "pending": 0},
  "checks": [
    {"name": "tests", "status": "fail", "log_snippet": "...", "run_id": 123},
    {"name": "lint", "status": "pass"}
  ]
}

scripts/fetch_pr_feedback.py

Fetches and categorizes PR review feedback using the LOGAF scale.

uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_feedback.py [--pr NUMBER]

Returns JSON with feedback categorized as:

  • high - Must address before merge (h:, blocker, changes requested)
  • medium - Should address (m:, standard feedback)
  • low - Optional (l:, nit, style, suggestion)
  • bot - Informational automated comments (Codecov, Dependabot, etc.)
  • resolved - Already resolved threads

Review bot feedback (from Sentry, Warden, Cursor, Bugbot, CodeQL, etc.) appears in high/medium/low with review_bot: true — it is NOT placed in the bot bucket.

Each feedback item may also include:

  • thread_id - GraphQL node ID for inline review comments (used for replies)

Workflow

1. Identify PR

gh pr view --json number,url,headRefName

Stop if no PR exists for the current branch.

2. Gather Review Feedback

Run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_feedback.py to get categorized feedback already posted on the PR.

3. Handle Feedback by LOGAF Priority

Auto-fix (no prompt):

  • high - must address (blockers, security, changes requested)
  • medium - should address (standard feedback)

When fixing feedback:

  • Understand the root cause, not just the surface symptom
  • Check for similar issues in nearby code or related files
  • Fix all instances, not just the one mentioned

This includes review bot feedback (items with review_bot: true). Treat it the same as human feedback:

  • Real issue found → fix it
  • False positive → skip, but explain why in a brief comment
  • Never silently ignore review bot feedback — always verify the finding

Prompt user for selection:

  • low - present numbered list and ask which to address:
Found 3 low-priority suggestions:
1. [l] "Consider renaming this variable" - @reviewer in api.py:42
2. [nit] "Could use a list comprehension" - @reviewer in utils.py:18
3. [style] "Add a docstring" - @reviewer in models.py:55

Which would you like to address? (e.g., "1,3" or "all" or "none")

Skip silently:

  • resolved threads
  • bot comments (informational only — Codecov, Dependabot, etc.)

Replying to Comments

After processing each inline review comment, reply on the PR thread to acknowledge the action taken. Only reply to items with a thread_id (inline review comments).

When to reply:

  • high and medium items — whether fixed or determined to be false positives
  • low items — whether fixed or declined by the user

How to reply: Use the addPullRequestReviewThreadReply GraphQL mutation with pullRequestReviewThreadId and body inputs.

Reply format:

  • 1-2 sentences: what was changed, why it's not an issue, or acknowledgment of declined items
  • End every reply with \n\n*— Claude Code*
  • Before replying, check if the thread already has a reply ending with *- Claude Code* or *— Claude Code* to avoid duplicates on re-loops
  • If the gh api call fails, log and continue — do not block the workflow

4. Check CI Status

Run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_checks.py to get structured failure data.

Wait if pending: If review bot checks (sentry, warden, cursor, bugbot, seer, codeql) are still running, wait before proceeding—they post actionable feedback that must be evaluated. Informational bots (codecov) are not worth waiting for.

5. Fix CI Failures

For each failure in the script output:

  1. Read the log_snippet and trace backwards from the error to understand WHY it failed — not just what failed
  2. Read the relevant code and check for related issues (e.g., if a type error in one call site, check other call sites)
  3. Fix the root cause with minimal, targeted changes
  4. Find existing tests for the affected code and run them. If the fix introduces behavior not covered by existing tests, extend them to cover it (add a test case, not a whole new test file)

Do NOT assume what failed based on check name alone—always read the logs. Do NOT "quick fix and hope" — understand the failure thoroughly before changing code.

6. Verify Locally, Then Commit and Push

Before committing, verify your fixes locally:

  • If you fixed a test failure: re-run that specific test locally
  • If you fixed a lint/type error: re-run the linter or type checker on affected files
  • For any code fix: run existing tests covering the changed code

If local verification fails, fix before proceeding — do not push known-broken code.

git add <files>
git commit -m "fix: <descriptive message>"
git push

7. Monitor CI and Address Feedback

Poll CI status and review feedback in a loop instead of blocking:

  1. Run uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_checks.py to get current CI status
  2. If all checks passed → proceed to exit conditions
  3. If any checks failed (none pending) → return to step 5
  4. If checks are still pending: a. Run uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_feedback.py for new review feedback b. Address any new high/medium feedback immediately (same as step 3) c. If changes were needed, commit and push (this restarts CI), then continue polling d. Sleep 30 seconds, then repeat from sub-step 1
  5. After all checks pass, do a final feedback check: sleep 10, then run uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_feedback.py. Address any new high/medium feedback — if changes are needed, return to step 6.

8. Repeat

If step 7 required code changes (from new feedback after CI passed), return to step 2 for a fresh cycle. CI failures during monitoring are already handled within step 7's polling loop.

Exit Conditions

Success: All checks pass, post-CI feedback re-check is clean (no new unaddressed high/medium feedback including review bot findings), user has decided on low-priority items.

Ask for help: Same failure after 2 attempts, feedback needs clarification, infrastructure issues.

Stop: No PR exists, branch needs rebase.

Fallback

If scripts fail, use gh CLI directly:

  • gh pr checks name,state,bucket,link
  • gh run view <run-id> --log-failed
  • gh api repos/{owner}/{repo}/pulls/{number}/comments

When to Use

Use this skill when tackling tasks related to its primary domain or functionality as described above.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.