Skip to content

feat: add cherry-pick-sync skill#385

Merged
amilz merged 2 commits intomainfrom
ai/add-cherry-pick-sync-skill
Mar 13, 2026
Merged

feat: add cherry-pick-sync skill#385
amilz merged 2 commits intomainfrom
ai/add-cherry-pick-sync-skill

Conversation

@amilz
Copy link
Contributor

@amilz amilz commented Mar 13, 2026

Summary

  • Adds Claude skill to cherry-pick commits from main into the active release/* branch
  • Auto-detects release branch, filters release-only commits, resolves trivial conflicts, creates PR with full commit list

Test plan

  • Trigger with "sync main to release" and verify workflow

Open with Devin

📊 Unit Test Coverage

Coverage

Unit Test Coverage: 81.0%

View Detailed Coverage Report

@github-actions
Copy link

github-actions bot commented Mar 13, 2026

📊 TypeScript Coverage Report

Coverage: 39.6%

View detailed report

Coverage artifacts have been uploaded to this workflow run.
View Artifacts

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 13, 2026

Greptile Summary

This PR adds a new Claude skill (cherry-pick-sync) that automates cherry-picking commits from main into an active release/* branch. The skill is well-structured and follows the pattern established by the existing .claude/skills/release.md — it identifies the target branch, filters commits, creates a working branch, cherry-picks one commit at a time (handling conflicts), and opens a PR. Overall the workflow is sound, but there are a few correctness issues in the instruction text itself that could cause an AI agent to behave unpredictably:

  • Branch naming ambiguity: The working-branch template chore/cherry-pick-main-into-<release>-YYYYMMDD doesn't explicitly state that the / in release/2.2.0 should be replaced with -. The inline example shows the correct sanitized form, but the lack of an explicit rule means Claude could generate a branch name with an embedded slash (e.g., chore/cherry-pick-main-into-release/2.2.0-YYYYMMDD), creating an unintended nested ref.
  • Contradictory multi-branch instructions: Step 1 says "Multiple → ask the user" while the Edge Cases section says "Default to most recently committed." These two rules conflict and should be reconciled into a single consistent behavior.
  • Missing abort/cleanup path: If a cherry-pick conflict cannot be resolved and the user wants to cancel, there are no instructions for git cherry-pick --abort or branch cleanup, risking leaving the repository in a partially-applied state.

Confidence Score: 3/5

  • Safe to merge with minor fixes — the skill works correctly in the common case but has two logic-level contradictions in its instructions that could cause inconsistent AI behavior.
  • The change is documentation/instruction-only (a SKILL.md file), so there is no runtime code risk to the Kora service itself. However, the skill contains a branch-naming ambiguity and contradictory multi-branch instructions that would cause an AI agent to behave unpredictably in edge cases. These are correctness issues within the skill's logic, not security or data-integrity risks, but they should be resolved before the skill is relied upon in production workflows.
  • .claude/skills/cherry-pick-sync/SKILL.md — branch naming template and multi-branch handling instructions need to be reconciled.

Important Files Changed

Filename Overview
.claude/skills/cherry-pick-sync/SKILL.md New skill adding cherry-pick-sync automation; contains a branch naming ambiguity that could generate double-slash ref paths, and a contradiction between Step 1 and the Edge Cases section regarding how to handle multiple release branches.

Sequence Diagram

sequenceDiagram
    participant U as User
    participant C as Claude (Skill)
    participant G as Git
    participant GH as GitHub CLI

    U->>C: "sync main to release"
    C->>GH: gh pr list --head "release/" (open PRs)
    GH-->>C: release branch name(s)
    alt Multiple branches
        C->>U: Ask which branch to use
        U-->>C: Confirm branch
    end
    C->>G: git fetch origin main + release-branch
    C->>G: git log --oneline --reverse origin/release..origin/main
    G-->>C: Commit list
    C->>C: Filter: auto-skip "chore: release v*", CHANGELOG, version bumps
    C->>U: Show final commit list & confirm
    U-->>C: Approve
    C->>G: git status --porcelain
    G-->>C: Clean / Dirty
    alt Dirty
        C->>U: Ask to commit or stash
    end
    C->>G: git checkout -b chore/cherry-pick-main-into-release-X-YYYYMMDD origin/release-branch
    loop Each commit SHA
        C->>G: git cherry-pick SHA
        alt Conflict
            C->>C: Inspect conflict markers
            alt Trivial (whitespace/import)
                C->>G: Auto-resolve + git add . + git cherry-pick --continue
            else Non-trivial
                C->>U: Ask for resolution
                U-->>C: Resolution
                C->>G: git add . + git cherry-pick --continue
            end
        end
    end
    C->>G: git push -u origin HEAD
    C->>GH: gh pr create --base release-branch
    GH-->>C: PR URL
    C->>U: Return PR URL
Loading

Last reviewed commit: 7c8925d

greptile-apps[bot]

This comment was marked as resolved.

dev-jodee
dev-jodee previously approved these changes Mar 13, 2026
@amilz amilz requested a review from dev-jodee March 13, 2026 17:25
@amilz amilz self-assigned this Mar 13, 2026
@amilz amilz added the hotfix label Mar 13, 2026
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@amilz amilz merged commit c87c9cf into main Mar 13, 2026
13 of 14 checks passed
@amilz amilz deleted the ai/add-cherry-pick-sync-skill branch March 13, 2026 17:29
amilz added a commit that referenced this pull request Mar 13, 2026
* feat: add cherry-pick-sync skill for main→release branch syncing
* fix: address PR review feedback on cherry-pick-sync skill
amilz added a commit that referenced this pull request Mar 13, 2026
* fix(docker): update Rust version to 1.88 for time crate compatibility (#364)

The time crate v0.3.47 requires Rust 1.88.0. This was causing Railway
deployments to fail with "rustc 1.87.0 is not supported" error.

Fixes #363

* fix(sdk): add ESLint v9 deps and update lint script (#371)

Cherry-pick config/deps only from main's #371 — release branch
already has a more complete eslint.config.js. Adds
@solana/eslint-config-solana and related plugins, updates lint
script to remove deprecated --ext flag.

* fix(sdk): add repository url for npm trusted publisher provenance (#376)

npm's provenance verification requires package.json repository.url to
match the GitHub repo from the OIDC token.

* feat: add cherry-pick-sync skill (#385)

* feat: add cherry-pick-sync skill for main→release branch syncing
* fix: address PR review feedback on cherry-pick-sync skill

* fix(skill): improve cherry-pick-sync to handle squash-merged sync PRs (#387)

Prior cherry-pick sync PRs are often squash-merged into the release
branch, making git cherry unable to detect them as equivalent. The
skill now finds the last sync PR on the release branch and uses it
as the baseline instead of relying solely on git log range.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants