flutter-cherry-pick

작성자: flutter

병합된 PR을 flutter/flutter 저장소의 stable 또는 beta 채널에 공식 체리픽하는 방법. flutter/flutter에 병합된 풀 리퀘스트에만 사용하세요. 오직…

npx skills add https://github.com/flutter/flutter --skill flutter-cherry-pick

Flutter Cherry-Pick Workflow

Constraints

This skill has the following strict constraints:

  • Target Repository: Only use for the flutter/flutter repository.
  • Target Channels: Only use when the cherry-pick is targeted at stable, beta, or a release candidate branch matching the format flutter-<major>.<minor>-candidate.<hotfix> (e.g., flutter-3.10-candidate.0).
  • PR Status: Only use for pull requests that have already been successfully merged into master.

Quick Start

Trigger this skill by providing a merged PR number or URL and optionally the target channel:

Workflows

Phase 1: Initialization and Channel Detection

  1. Identify Inputs:
    • Original PR: <ORIGINAL_PR> (number or URL provided by the user).
    • Target Channel: <CHANNEL> (either stable or beta).
  2. Determine Channel:
    • Parse the user's request for the target channel.
    • GATING STEP: If the target channel is not specified in the user's request, you MUST STOP CALLING TOOLS AND ASK the user: "Would you like to cherry-pick this to stable or beta?" and wait for their response before proceeding.
  3. Verify you are in the root of the flutter repository.
  4. Verify Environment: Ensure the repository is clean (no uncommitted changes). Run git status --porcelain to check. If there are pending changes, stop and ask the user to resolve them or stash them.

Phase 2: Run Cherry-Pick Orchestrator

  1. Run the helper script to start the process:
    <DART_EXECUTABLE> .agents/skills/flutter-cherry-pick/scripts/flutter_cp.dart --pr <ORIGINAL_PR> --channel <CHANNEL> --action start
    
  2. Evaluate Script Output:
    • Exit Code 0 (Success):
      • The output will end with SUCCESS:AUTOMATED:<CP_PR> or SUCCESS:MANUAL:<CP_PR>.
      • Extract the <CP_PR> number.
      • Proceed to Phase 4: Fill Template.
    • Exit Code 2 (Conflicts):
      • The cherry-pick encountered conflicts and the script checked out a local branch cherry-pick-<ORIGINAL_PR>-to-<CHANNEL>.
      • Proceed to Phase 3: Conflict Resolution.
    • Exit Code 1 (Error):
      • An unexpected error occurred. Report the failure to the user.

Phase 3: Conflict Resolution

  1. Analyze Conflicts:
    • Identify the conflicted files from the script output (or run git status --porcelain to see unmerged files).
  2. Document Conflicts: Articulate what conflicts were encountered and how they were resolved. You will need to include this information in the final PR description.
  3. Attempt Auto-Resolution:
    • For each conflicted file, analyze the conflict markers (<<<<<<<, =======, >>>>>>>).
    • If the conflict is simple (e.g., import ordering, minor formatting, non-overlapping changes), resolve it.
  4. User Fallback:
    • If you cannot resolve the conflicts automatically or the conflicts reflect a change in logic that impacts flutter users:
      • Present the list of conflicted files to the user in the chat.
      • Ask the user to resolve them in their editor.
      • Stop calling tools and wait for the user to confirm resolution.
  5. Continue the Process:
    • Once all conflicts are resolved (either by you or the user), run git add <resolved-files> to stage them.
    • Resume the orchestrator script:
      <DART_EXECUTABLE> .agents/skills/flutter-cherry-pick/scripts/flutter_cp.dart --pr <ORIGINAL_PR> --channel <CHANNEL> --action continue
      
    • The script will run git cherry-pick --continue, push, create the PR, and print SUCCESS:MANUAL:<CP_PR>.
    • Extract the <CP_PR> number and proceed to Phase 4: Fill Template.

Phase 4: Fill Template and Apply

  1. Retrieve Template:
    • Read the local cherry-pick template (located at [PULL_REQUEST_CP_TEMPLATE](../../../.github/PR_TEMPLATE/PULL_REQUEST_CP_TEMPLATE.md) relative to this skill).
  2. Gather Context:
    • Parse the original PR description for linked issues (e.g., "Fixes #187322", "Closes #123").
    • If found, fetch the issue details: gh issue view <ISSUE_NUMBER> --json title,body.
    • Fetch original PR details if needed.
    • If conflicts were encountered and resolved in Phase 3, gather the documentation of those conflicts.
  3. Draft the Template:
    • Fill in the retrieved template fields using LLM reasoning based on the issue and original PR context.
    • If conflicts were resolved, clearly document them in the PR description (e.g., in the "Description" or "Changelog" section), explaining what was resolved and how.
    • Keep the Markdown structure of the template intact.
    • CRITICAL: Remove any instructional text or guidelines within the sections (e.g., "What is the impact...", "Explain this cherry pick...") when replacing them with your responses. Do NOT remove explanations around checkboxes or selection items (e.g., "What is the risk level...", "Are you confident...").
    • Example of filling a text section (remove instructional text):
      • Before:
        ### Impact
        What is the impact of this cherry-pick? (Explain the impact on users...)
        
      • After:
        ### Impact
        This fixes a critical crash in the image decoder when rendering corrupted GIFs.
        
    • Example of filling a checkbox/selection section (do NOT remove options):
      • Before:
        ### Shared Engineering Cohort
        Were any engineering cohorts (e.g. Flutter Tooling, Engine, Framework) consulted?
        - [ ] Yes
        - [ ] No
        
      • After:
        ### Shared Engineering Cohort
        Were any engineering cohorts (e.g. Flutter Tooling, Engine, Framework) consulted?
        - [x] Yes
        - [ ] No
        
  4. Review with User (GATING STEP):
    • Present the drafted template to the user in the chat and ask for approval or edits.
    • YOU MUST STOP CALLING TOOLS AND WAIT for the user's explicit approval in the chat before proceeding. Do not attempt to apply the template pre-emptively.
  5. Apply Template, Update Title, and Add Label:
    • Only proceed to this step after receiving explicit user approval in the chat.
    • Ensure the PR title is formatted as [<CHANNEL>] <ORIGINAL_PR_TITLE>.
    • Ensure the cp: review label is added to the CP PR.
    • Once approved, update the CP PR description, title, and add the label:
      gh pr edit <CP_PR> --title "[<CHANNEL>] <ORIGINAL_PR_TITLE>" --body "<FINAL_TEMPLATE>" --add-label "cp: review"
      
      (Note: If gh pr edit fails due to GraphQL deprecation errors, you can use the REST API via gh api to update the body and add the label).
    • Provide the user with the link to the new cherry-pick PR.

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을 통한 포커스 이동 관리를 포함합니다...