本文へ移動
cccskills
無料GitHub で公開

pr-green-loop

After pushing code or creating a PR, automatically wait for CI checks to complete, fix failures, address Bugbot findings, and re-push in a loop until the PR is green. Use when the user pushes to a PR, creates a PR, or asks to get a PR to green.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

PR Green Loop

Drive a PR to green by iterating: push → wait for checks → fix failures → address Bugbot → re-push → repeat.

When to activate

  • User creates a PR (after pr-create finishes)
  • User pushes new commits to an existing PR
  • User asks to "get the PR green", "fix CI", or "fix all PR issues"

Prerequisites

  • gh CLI installed and authenticated
  • Current branch has a remote-tracking PR (or one was just created)

Workflow

Step 1: Ensure code is pushed and PR exists

  1. Run git status to check for uncommitted changes.
  2. Push the branch: git push -u origin HEAD.
  3. If no PR exists yet, delegate to the pr-create skill and wait for user approval before continuing.
  4. Capture the PR number:
gh pr view --json number -q .number

Step 2: Wait for CI checks to complete

Poll until all check suites finish (no pending / queued / in_progress remaining):

gh pr checks <PR_NUMBER> --watch --fail-fast

If --watch is unavailable or hangs, fall back to a manual polling loop:

while true; do
  STATUS=$(gh pr checks <PR_NUMBER> --json name,state --jq '[.[].state] | unique | join(",")')
  echo "Check states: $STATUS"
  # Break when no "PENDING", "QUEUED", or "IN_PROGRESS" remain
  echo "$STATUS" | grep -qiE 'pending|queued|in_progress' || break
  sleep 30
done

Report the final status summary before proceeding.

Step 3: Fix CI failures

If any check failed:

  1. Delegate to the ci-fix skill (fetch logs, classify, auto-fix or diagnose).
  2. For auto-fixable issues (lint, format, lock file, pre-commit): apply fixes, stage, and commit.
  3. For test failures: read the failing test, understand the root cause, fix the code (not just the test), and commit.
  4. Use conventional commits: fix(<scope>): <description>.

Step 4: Address Bugbot findings

Bugbot posts review comments on the PR. Fetch and fix them:

  1. Fetch unresolved review conversations (delegate to github-pull-request-handling skill's script):
SKILL_BASE_DIR/scripts/pr-conversations.sh <PR_NUMBER>
  1. For each unresolved Bugbot comment:

    • Read the full thread to understand the finding.
    • Fix the issue in the codebase.
    • Commit with a conventional message: fix(<scope>): address bugbot — <short description>.
    • Reply to the comment with the commit hash (see github-pull-request-handling for reply format).
  2. For non-Bugbot review comments: skip them — those are for the author to triage manually.

Step 5: Push and loop

  1. Push all new fix commits: git push.
  2. Go back to Step 2 and wait for the new CI run.
  3. Repeat until:
    • All checks pass and no new unresolved Bugbot comments exist.
    • Or a maximum of 3 iterations is reached (to avoid infinite loops).

If the loop limit is hit, report the remaining failures and stop.

Step 6: Report final status

When the PR is green (or the loop limit is reached), output a summary:

## PR Green Loop — Result

**PR**: #<number>
**Status**: ✅ All green / ⚠ Issues remain after 3 iterations
**Iterations**: <count>

**Fixes applied**:
- <commit hash>: <description>
- <commit hash>: <description>

**Remaining issues** (if any):
- <description of unresolved failure or comment>

Delegation to other skills

ConcernDelegate to
Creating the PRpr-create
Diagnosing CI failuresci-fix
Fetching/replying to review commentsgithub-pull-request-handling
Commit message formatgit-conventional-commits
Python lint/format fixesruff
Lock file syncuv

Rules

  • Never force-push; always use regular git push.
  • Never git add . — stage only files related to the fix.
  • Stop and ask the user if a test failure root cause is ambiguous.
  • Only auto-fix Bugbot comments; leave human reviewer comments for the author.
  • Cap iterations at 3 to prevent runaway loops.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Implement comprehensive error handling for Python code paths to keep services resilient and user-friendly. Use when failures are currently silent or exceptions leak through.

日本語の概要は準備中です。原文の説明を表示しています。

Unique-AG/ai52026年10月10日 更新

Tabular and numerical data analysis with descriptive statistics and insights. Use when the user provides data, tables, CSVs, or numbers and wants analysis.

日本語の概要は準備中です。原文の説明を表示しています。

Unique-AG/ai52026年10月10日 更新

Financial factsheet analysis with key metrics extraction and investment rationale

日本語の概要は準備中です。原文の説明を表示しています。

Unique-AG/ai52026年10月10日 更新

ci-fix

無料

Diagnose and fix CI failures without leaving your editor.

日本語の概要は準備中です。原文の説明を表示しています。

Unique-AG/ai52026年10月10日 更新

Reproduce ai-repo PR checks locally with Poe and CI scripts, including per-package typecheck and coverage behavior. Use when validating changes before push or when user asks which local commands match CI.

日本語の概要は準備中です。原文の説明を表示しています。

Unique-AG/ai52026年10月10日 更新

Ask clarifying questions before implementing to ensure Python requirements are understood. Use when a task lacks detail, dependencies are unclear, or multiple interpretations are possible.

日本語の概要は準備中です。原文の説明を表示しています。

Unique-AG/ai52026年10月10日 更新

Unique-AG のスキルをすべて見る

このスキルの問題を報告する