Shepherd prs

From flutter/flutter · View interactive version

Shepherd prs is an AI agent skill from the GitHub repository flutter/flutter. Automate shepherding, checking status, updating branches, and landing open PRs or approved third-party contributor PRs in the flutter/flutter repository using the gh CLI. When to use: - When you need to check the status of open PRs or shepherded third-party PRs. - When you need to update stale branc

How to use this skill

Skill file

Shepherding Pull Requests Skill (`flutter/flutter`)

This skill defines the canonical runbook for shepherding pull requests in the flutter/flutter repository using native GitHub CLI (gh) commands.

1. Checking PR Status

When the user asks for the status of open or approved PRs:

  1. List Your Own Open PRs:

```bash

gh pr list --repo flutter/flutter --author <username> --state open --json number,title,url,mergeable,reviewDecision

```

  1. List Shepherded / Reviewed Third-Party PRs:

```bash

gh pr list --repo flutter/flutter --search "reviewed-by:<username> -author:<username> is:open" --json number,title,url,mergeable,reviewDecision

```

  1. Inspect Detailed PR Checks:

```bash

gh pr checks <number> --repo flutter/flutter

```

  1. Inspect Reviews, Labels, and Comments:

```bash

gh pr view <number> --repo flutter/flutter --json labels,reviewDecision,reviews,comments

```

2. Pre-Autosubmit Verification Rules

Before applying or re-applying the autosubmit label (gh pr edit <number> --repo flutter/flutter --add-label autosubmit), always perform the following pre-flight verification checks to ensure the autosubmit bot will not reject or strip the label:

  1. Check Previous autosubmit Removal History in Comments:

```bash

gh pr view <number> --repo flutter/flutter --json comments

```

  1. Verify Freshness of Base Commit (>7 Days Old):

```bash

gh pr update-branch <number> --repo flutter/flutter

```

  1. Strictly Verify Required Reviewer Approvals:
  1. Verify All Status Checks Are 100% Passing:

1. Do NOT apply the autosubmit label immediately.

2. Inform the user of the failing check and instruct them to retry it first.

3. Only apply the autosubmit label after all retried checks complete successfully:

```bash

gh pr edit <number> --repo flutter/flutter --add-label autosubmit

```

3. Third-Party Contributor PRs (2-Reviewer Requirement)

4. Failed Checks & Manual LUCI Re-runs

1. Print the exact LUCI Buildbucket link (e.g., https://cr-buildbucket.appspot.com/build/<build_id>) for the failing check.

2. Instruct the user to open the URL and click Retry Build on the LUCI page.

3. If a check continues to fail after manual retries, inspect the failure logs (gh pr view <number> --repo flutter/flutter or flutter-pr-checks-finder) and summarize the failure for the user.

5. Stale Branch Updates, CICD Label & Token Scope

```bash

gh pr edit <number> --repo flutter/flutter --add-label CICD

```

```bash

gh auth refresh -h github.com -s workflow

```

6. Target Branch Correction & Merge Conflicts

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.