shepherd-prs

작성자: flutter

flutter/flutter 저장소에서 자신의 오픈 PR과 승인된 타사 기여자의 PR을 자동으로 관리, 업데이트 및 병합합니다. 사용 시기: -…

npx skills add https://github.com/flutter/flutter --skill shepherd-prs

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:
    gh pr list --repo flutter/flutter --author <username> --state open --json number,title,url,mergeable,reviewDecision
    
  2. List Shepherded / Reviewed Third-Party PRs:
    gh pr list --repo flutter/flutter --search "reviewed-by:<username> -author:<username> is:open" --json number,title,url,mergeable,reviewDecision
    
  3. Inspect Detailed PR Checks:
    gh pr checks <number> --repo flutter/flutter
    
  4. Inspect Reviews, Labels, and Comments:
    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:

    • Always check if the autosubmit label was previously removed by the auto-submit bot by checking PR comments:
      gh pr view <number> --repo flutter/flutter --json comments
      
    • Look for messages from auto-submit such as "autosubmit label was removed...".
    • If the label was previously removed, identify the exact reason stated by the bot (e.g., failing CI checks, insufficient approvals, merge conflicts, or stale branch) and confirm that the underlying issue has been resolved before re-applying autosubmit.
  2. Verify Freshness of Base Commit (>7 Days Old):

    • Check whether the PR's base commit is stale (>7 days old).
    • If the base commit is more than 7 days old, always instruct running or execute a branch update before attempting to add autosubmit:
      gh pr update-branch <number> --repo flutter/flutter
      
    • Do not apply autosubmit until the branch update is complete and CI checks on the updated branch succeed.
  3. Strictly Verify Required Reviewer Approvals:

    • Strictly verify that third-party contributor PRs (CONTRIBUTOR, FIRST_TIME_CONTRIBUTOR, NONE) have at least 2 team member approvals (MEMBER or OWNER) before adding autosubmit so the bot doesn't remove it again.
    • Check reviews in gh pr view <number> --repo flutter/flutter --json reviews to confirm the number of approvals from Flutter team members.
  4. Verify All Status Checks Are 100% Passing:

    • The Flutter autosubmit bot automatically strips the autosubmit label whenever any CI check fails.
    • Verify that all status checks are passing (SUCCESS/pass).
    • If any check is flaky, failing, or pending a retry:
      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:
        gh pr edit <number> --repo flutter/flutter --add-label autosubmit
        

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

  • Pull requests authored by third-party contributors (CONTRIBUTOR, FIRST_TIME_CONTRIBUTOR, NONE) require two explicit approvals from Flutter team members (MEMBER or OWNER) before the autosubmit bot will merge them.
  • If only one team member has approved a third-party PR and the autosubmit label is applied, the autosubmit bot will remove the label.
  • Action: Strictly verify via gh pr view <number> --repo flutter/flutter --json reviews that at least 2 team member approvals are present before adding autosubmit so the bot doesn't remove it again. If only 1 approval exists, remind the user to request a second reviewer before applying the label.

4. Failed Checks & Manual LUCI Re-runs

  • Due to GitHub App permission policies, third-party check runs (such as LUCI checks created by flutter-dashboard) cannot be re-run via the GitHub API.
  • Action:
    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

  • If a PR branch is out of date with master (including when the base commit is >7 days old):
    • Always update the branch using gh pr update-branch <number> --repo flutter/flutter before attempting to add autosubmit.
  • Re-applying the CICD Label:
    • After updating a branch with gh pr update-branch (or when shepherding a PR that has not run CI), the CICD label is often stripped or required to start the CI checks on the updated commit.
    • Always check if the CICD label is present after a branch update, and re-apply it if missing:
      gh pr edit <number> --repo flutter/flutter --add-label CICD
      
  • Stale Token Scope Error: If updating fails due to workflow file permissions (ERROR: ... lacks the "workflow" scope), instruct the user to refresh their CLI scope:
    gh auth refresh -h github.com -s workflow
    

6. Target Branch Correction & Merge Conflicts

  • Dismissed Reviews Warning: Changing the target branch of a PR often causes GitHub to automatically dismiss existing approvals. Alert the user if the target branch changed so they can re-approve on GitHub.
  • Merge Conflicts: If a PR has conflicts (MERGEABLE is CONFLICTING), notify the user so the author can resolve them.

flutter의 다른 스킬

dart-modern-features
flutter
현대화를 위한 후보를 찾으려면:
flutter-fix-layout-issues
flutter
Flutter 레이아웃 오류(오버플로우, 무제한 제약 조건)를 Dart 및 Flutter MCP 도구를 사용하여 수정합니다. "RenderFlex overflowed", "Vertical…" 문제를 해결할 때 사용하세요.
adding-release-notes
flutter
사용자 대상 변경 사항 설명을 DevTools 릴리스 노트에 추가합니다. NEXT_RELEASE_NOTES.md 파일에 개선 사항, 수정 사항 또는 새로운 기능을 문서화할 때 사용하세요.
reviewing-devtools-prs
flutter
DevTools 저장소 전용 PR 리뷰 워크플로로, DevTools 스타일 가이드라인과 일반적인 리뷰 패턴을 적용합니다. 풀 리퀘스트를 리뷰할 때 사용하세요…
dart-use-primary-constructors
flutter
사용자가 Dart에서 구문 및 의미적으로 올바른 primary constructor를 작성하고, 새로운 생성자 구문, 빈 본문 세미콜론 구문 등으로 마이그레이션/사용할 수 있도록 지원합니다.
code-documentation
flutter
효과적인 코드 문서 작성 가이드로, docstrings, JSDoc, dartdoc 및 구현 주석을 포함합니다. 새 코드를 작성하거나 추가할 때 이 스킬을 사용하세요…
api-review
flutter
지정된 코드를 표준 API 설계 지침에 맞춰 검토합니다. 사용자가 API 리뷰를 요청하거나 API 설계에 따라 코드를 확인할 때 이 스킬을 사용하세요…
flutter-accessibility
flutter
Flutter 앱에서 WCAG 2 및 EN 301 549 접근성 표준과 적응형 레이아웃을 구현합니다. 모바일, 웹, 데스크톱 플랫폼에서 시맨틱 주석, 탭 대상 크기(최소 48x48 dp), 텍스트 대비 비율(작은 텍스트 4.5:1, 큰 텍스트 3:1)을 적용합니다. 웹 시맨틱 초기화, 대화형 위젯 래핑, 화면 크기 기반 레이아웃 전환, 키보드/마우스 입력 처리를 위한 결정 로직을 제공합니다. FocusTraversalGroup을 통한 포커스 이동 관리를 포함합니다...