agentleFS
software-mansionsoftware-mansion/react-native-reanimated/.agents/skills/reanimated-cherry-pick/SKILL.md

reanimated-cherry-pick

Skill11k starsChanged 9 days agoMITView on GitHub

Backports merged upstream PRs onto a release branch using one worktree per PR so the cherry-picks don't fight over the same working tree. Each cherry-pick becomes its own PR (open it ready-for-review — drafting is optional), and the tracking issue for the release is updated with links. Preferably use PR stack from GitHub. Ask for or extract from the request: - Release branch — e.g. 4.3-stable - PR list — one or more GitHub PR URLs / numbers in software-mansion/react-native-reanimated…

  • Deletes or force-pushes
  • Commits and pushes

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 5 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask for or extract from the request:

    line 19
  2. Very specific:

    Use only the PR number for <PR> and $pr in branch names, paths and commands.

    line 23
  3. Distinctive:

    Ask if not provided.

    line 25
  4. Very specific:

    If original author differs from user, add the user as Co-authored-by: trailer.

    line 48
  5. Very specific:

    Never: add Co-Authored-By: Claude or 🤖 Generated with Claude Code anywhere — not in commits, not in PR bodies.

    line 49
  6. Very specific:

    If the upstream PR also changes Worklets, leave the Worklets part out of the cherry-pick: restore packages/react-native-worklets/ from the …

    line 100
  7. Very specific:

    If the upstream squash commit already has a Co-authored-by: <you> trailer (GitHub's squash-merge often adds it, and it comes into …

    line 143
  8. Very specific:

    If a previous failed attempt left an empty branch on remote, use --force-with-lease.

    line 164
  9. Very specific:

    If the upstream PR is not in the list yet, add both lines.

    line 187
  10. Distinctive:

    Before executing steps that create externally visible artifacts, confirm scope with the user:

    line 204
  11. Very specific:

    Before gh pr create — first run only, to verify title/body format is right.

    line 206
  12. Distinctive:

    Before git push --force-with-lease — force-push is fine on private cherry-pick branches but flag it.

    line 207
  13. Distinctive:

    Before amending a commit that changes authorship — surface the change.

    line 208

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Cherry-pick PRs onto a Reanimated release branch

Backports merged upstream PRs onto a release branch using one worktree per PR so the cherry-picks don't fight over the same working tree. Each cherry-pick becomes its own PR (open it ready-for-review — drafting is optional), and the tracking issue for the release is updated with links.

Preferably use PR stack from GitHub.

Inputs

Ask for or extract from the request:

  • Release branch — e.g. 4.3-stable
  • PR list — one or more GitHub PR URLs / numbers in software-mansion/react-native-reanimated Use only the PR number for <PR> and $pr in branch names, paths and commands.
  • Tracking issue — the "Reanimated X.Y.Z cherry-pick thread" issue. Some titles use the form [Reanimated] [X.Y.Z] cherry-pick thread. Ask if not provided.

Naming conventions

ThingPattern
Local branch@<you>/<release-branch>/cherry-pick-#<PR> (contains # — quote it in shell)
Worktree path../rnr-cp-<PR> (sibling of the repo, not inside it)
PR titlecherry-pick(<release-branch>): <upstream title with conv-commit prefix stripped> (#<PR>)
PR bodyCherry-picking #<PR> — no AI preamble
Commit messageUpstream message + (cherry picked from commit <sha>) trailer (git writes this to MERGE_MSG automatically)

<you> is your GitHub login (gh api user --jq .login). origin must be software-mansion/react-native-reanimated, because the branches are pushed to the upstream repository. Run the commands from the root of your main checkout, so ../ is its parent directory.

Example strip: fix(Reanimated): Babel plugin not detecting production environment → Babel plugin not detecting production environment.

Authorship

  • Author = original upstream PR author. Preserve their name and email.
  • Committer = the user running this skill (their git config).
  • If original author differs from user, add the user as Co-authored-by: trailer.
  • Never add Co-Authored-By: Claude or 🤖 Generated with Claude Code anywhere — not in commits, not in PR bodies.

Procedure

1. Gather PR metadata

Step 2 creates the worktrees for all PRs. Then complete step 1 and steps 3 to 9 for one PR before you start the next PR, and set sha, title and author again in step 1 for each PR.

For each PR, capture merge commit SHA + upstream title + original author. Keep the upstream values in shell variables and pass them quoted ("$author", "$title"). Never type them into a command: a backtick or $(...) in a title runs as a command inside double quotes.

git fetch origin main
sha="$(gh pr view <PR> --repo software-mansion/react-native-reanimated --json mergeCommit --jq .mergeCommit.oid)"
git cat-file -e "$sha^{commit}"
title="$(gh pr view <PR> --repo software-mansion/react-native-reanimated --json title --jq .title | sed -E 's/^[a-z]+(\([^)]*\))?!?: //')"
author="$(git show -s --format='%an <%ae>' "$sha")"
git show -s --format='%P%n%s' "$sha"

git cat-file -e fails when the commit is not in the clone. Then fetch again and check that the PR is merged.

The last command prints the parent SHAs on the first line and the subject on the second. This repo squash-merges PRs, so continue only when the first line has exactly one SHA and the subject ends with (#<PR>). Otherwise the PR was merged in a different way. Stop and ask the user.

2. Create worktrees

git fetch origin <release-branch>
for pr in <PR1> <PR2> …; do
  git worktree add -b "@<you>/<release-branch>/cherry-pick-#$pr" \
    ../rnr-cp-$pr origin/<release-branch>
done

3. Cherry-pick with --no-commit

cd ../rnr-cp-<PR>
git cherry-pick --no-commit -x "$sha"

Note: -x does nothing when combined with --no-commit (the (cherry picked from commit …) trailer is only added when cherry-pick itself commits). Fortunately git writes the full upstream message + trailer to MERGE_MSG on --no-commit, so step 5 recovers it.

3a. Keep only the Reanimated part

If the upstream PR also changes Worklets, leave the Worklets part out of the cherry-pick: restore packages/react-native-worklets/ from the release branch. This also removes the Worklets changelog fragment. A Reanimated release branch does not release Worklets.

git restore --source=origin/<release-branch> --staged --worktree -- packages/react-native-worklets

3b. Keep the changelog fragment

On 4.7-stable and newer, the upstream changelog fragment in packages/react-native-reanimated/changelog/ comes with the cherry-pick. Keep it: changelog:squash reads it at release time. On older branches, see the changelog item of the "Cross-cutting change checklist" in AGENTS.md.

4. Resolve conflicts

Resolve conflicts.

5. Commit

Use the gitdir path — .git in a worktree is a file, not a directory. git commit -F .git/MERGE_MSG fails silently with Not a directory.

Conflict-free apply — commit MERGE_MSG directly:

git commit -F "$(git rev-parse --git-dir)/MERGE_MSG"

If the cherry-pick conflicted, git appends a trailing # Conflicts: comment block to MERGE_MSG. git commit -F uses whitespace cleanup, which keeps # lines, so that block ends up in the commit message. You can't fix it with --cleanup=strip — the upstream PR body legitimately contains ##/### markdown headers that strip would delete along with it. Cut only the # Conflicts: block first, then commit the cleaned file:

mm="$(git rev-parse --git-dir)/MERGE_MSG"
awk '/^# Conflicts:/{exit} {print}' "$mm" > "$mm.clean"
git commit -F "$mm.clean"

6. Fix authorship (only when original author ≠ user)

Decide this before you commit in step 5. If original author = user, skip this step.

If the upstream squash commit already has a Co-authored-by: <you> trailer (GitHub's squash-merge often adds it, and it comes into MERGE_MSG), don't add it twice. Add --author to the step 5 commit command instead:

git commit --author="$author" -F "<message-file>"

Otherwise, commit as in step 5, then add the trailer and set the author with an amend:

git log -1 --format=%B | \
  git interpret-trailers --trailer "Co-authored-by: <User Name> <user@email>" | \
  git commit --amend --author="$author" -F -

7. Push

git push -u origin "@<you>/<release-branch>/cherry-pick-#<PR>"

If a previous failed attempt left an empty branch on remote, use --force-with-lease.

8. Open the PR

Open it ready-for-review (omit --draft); drafting is optional. The body is just Cherry-picking #<PR> — no AI preamble.

gh pr create --repo software-mansion/react-native-reanimated \
  --base <release-branch> \
  --head "@<you>/<release-branch>/cherry-pick-#<PR>" \
  --title "cherry-pick(<release-branch>): $title (#<PR>)" \
  --body "Cherry-picking #<PR>"

9. Update tracking issue

The tracking issue lists the upstream PRs. Under each upstream PR, add the cherry-pick PR as a nested item:

- https://github.com/software-mansion/react-native-reanimated/pull/<PR>
  - https://github.com/software-mansion/react-native-reanimated/pull/<cherry-pick PR>

If the upstream PR is not in the list yet, add both lines. Read the body with gh issue view <N> --repo software-mansion/react-native-reanimated --json body --jq .body > <file>, and write it back with gh api repos/software-mansion/react-native-reanimated/issues/<N> -X PATCH -F body=@<file>. Keep the rest of the body unchanged.

10. Cleanup (after PRs are merged)

for pr in <PR1> <PR2> …; do
  git worktree remove ../rnr-cp-$pr
  git branch -D "@<you>/<release-branch>/cherry-pick-#$pr"
done

The upstream repo has "Automatically delete head branches" enabled — remote branches disappear on merge. Verify with git ls-remote origin "<branch>" if unsure.

Confirmation checkpoints

Before executing steps that create externally visible artifacts, confirm scope with the user:

  • Before gh pr create — first run only, to verify title/body format is right.
  • Before git push --force-with-lease — force-push is fine on private cherry-pick branches but flag it.
  • Before amending a commit that changes authorship — surface the change.

Local worktree/branch operations don't need confirmation; they're reversible.

Gotchas checklist

  • .git in a worktree is a file. Use $(git rev-parse --git-dir)/MERGE_MSG, not .git/MERGE_MSG.
  • -x on --no-commit cherry-pick does nothing — recover the trailer from MERGE_MSG.
  • --no-commit with a conflict-free apply does not leave a cherry-pick in progress. git cherry-pick --continue will error with "no cherry-pick in progress". Just commit.
  • Chained git commit && git push after a silent commit failure can push an empty branch (release-branch tip) to origin. If it happens, force-push over it after committing correctly.
  • Branch names contain # — always quote in shell commands.
  • Conflicted cherry-pick → MERGE_MSG gets a trailing # Conflicts: block that git commit -F keeps (whitespace cleanup). Strip only that block with awk '/^# Conflicts:/{exit} {print}'; don't use --cleanup=strip — it also deletes the body's ##/### markdown headers.
  • If the upstream squash commit already carries a Co-authored-by: <you> trailer (GitHub usually adds it), don't re-add it — just commit with --author= directly.
  • Cherry-pick PRs may be opened ready-for-review (omit --draft); no AI preamble in the body.
  • The Claude Code auto-mode classifier may block commits mid-flow if the user earlier said "don't commit". Ask the user for explicit re-authorization.

Download now (ZIP)

Trending

Quiet since March.about the whole repository

Dec 2025: 0 mentionsJan 2026: 1 mentionFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the software-mansion/react-native-reanimated repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about software-mansion/react-native-reanimated

The biggest 5 of 66 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 66

Talked about on GitHub, Stack Overflow and Bluesky (66 times).

On GitHub · 34

29 more on GitHub

On Stack Overflow · 30

25 more on Stack Overflow

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.