Skip to content

scripts: add merge-branches Claude Code skill#14019

Merged
AvivYossef-starkware merged 1 commit into
mainfrom
aviv/add-merge-branches-skill
May 20, 2026
Merged

scripts: add merge-branches Claude Code skill#14019
AvivYossef-starkware merged 1 commit into
mainfrom
aviv/add-merge-branches-skill

Conversation

@AvivYossef-starkware

Copy link
Copy Markdown
Contributor

No description provided.

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@AvivYossef-starkware AvivYossef-starkware marked this pull request as ready for review May 20, 2026 06:09
@cursor

cursor Bot commented May 20, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Low risk: adds a new Claude command markdown guide only, with no runtime code changes.

Overview
Adds a new Claude Code command guide, /.claude/commands/merge-branches.md, documenting an end-to-end workflow for running scripts/merge_branches.py, resolving merge conflicts interactively, running cargo check to catch silent API skews, committing a separate fix_conflicts change via gt/git, and posting per-conflict inline PR review comments tagging the authors involved.

Reviewed by Cursor Bugbot for commit 88fd4ee. Bugbot is set up for automated code reviews on this repo. Configure here.

@dorimedini-starkware dorimedini-starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@dorimedini-starkware reviewed 1 file and all commit messages, and made 4 comments.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on AvivYossef-starkware).


.claude/commands/merge-branches.md line 43 at r1 (raw file):

If the script ran with `gt`-untracked state, run `gt track --parent <dst-branch>` so subsequent `gt modify`/`gt submit` work.

---

this script can fail. one reason I can think of: file deleted on main but edited on main-v0.14.2.
should you remark on that in the skill?

Code quote:

## Step 2: Fetch and run the merge script

```bash
git fetch origin <src-branch> <dst-branch>
python3 scripts/merge_branches.py --src <src-branch> --dst <dst-branch>

Capture the script's output. From it, extract:

  • The new merge branch name (<user>/merge-<src>-into-<dst>-<timestamp>).
  • The PR URL / number created by gh pr create.
  • The list of conflicted files (printed under git status -s | grep -E ...).

If the script ran with gt-untracked state, run gt track --parent <dst-branch> so subsequent gt modify/gt submit work.


___
*[`.claude/commands/merge-branches.md` line 45 at r1](https://reviewable.io/reviews/starkware-libs/sequencer/14019#-Ot30dGFAVaxuh217u8L:-Ot30dGFAVaxuh217u8M:bg3ee1n) ([raw file](https://github.com/starkware-libs/sequencer/blob/bd0770b9c0885137d5bf6a0302a86ebeef0548d1/.claude/commands/merge-branches.md#L45)):*
> ```Markdown
> ---
> 
> ## Step 3: Enumerate conflicts
> ```

before this phase: someone needs to mark all changes as viewed in the PR, otherwise you won't get a separation into revisions for the review



_Code quote:_
```Markdown
## Step 3: Enumerate conflicts

.claude/commands/merge-branches.md line 123 at r1 (raw file):

---

## Step 7: Commit and push via Graphite

you mention graphite everywhere - I would avoid it.

  1. I don't use graphite for merges, just plain git
  2. What if we move to some other tool in the future?

you can add an "Ask the user which git tool to use" at the top or something, but please remove explicit graphite usage directives

Code quote:

## Step 7: Commit and push via Graphite

.claude/commands/merge-branches.md line 131 at r1 (raw file):

Use --force — the merge script already pushed the branch, so Graphite will refuse a normal submit. The local state is authoritative at this point.

  1. do you need to be so explicit as to how to commit and push?
  2. what if not using graphite?
  3. are you 100% sure you need --force here...? I edit stacks all the time, gt submit works fine

Code quote:

```bash
git add <resolved-files>
gt modify -cam "fix_conflicts"
gt submit --force

Use --force — the merge script already pushed the branch, so Graphite will refuse a normal submit. The local state is authoritative at this point.



<!-- Sent from Reviewable.io -->

@AvivYossef-starkware AvivYossef-starkware left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 Replies drafted by Claude on behalf of @AvivYossef-starkware. Each thread below quotes the Reviewable discussion URL so it threads back to your original comments. Changes addressing 1, 2, and (4.3) are in 21f015c.

Comment thread .claude/commands/merge-branches.md
Comment thread .claude/commands/merge-branches.md
Comment thread .claude/commands/merge-branches.md
Comment thread .claude/commands/merge-branches.md
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/add-merge-branches-skill branch from 21f015c to 34b5a31 Compare May 20, 2026 07:19

@dorimedini-starkware dorimedini-starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@dorimedini-starkware reviewed 1 file and all commit messages, made 2 comments, and resolved 6 discussions.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on AvivYossef-starkware).


.claude/commands/merge-branches.md line 133 at r3 (raw file):

```bash
git add <resolved-files>
gt modify -cam "fix_conflicts"
  1. doesn't modify amend the merge commit? or does the -c add a new commit on the branch?
  2. best practice to use chore scope in the fix commit

Suggestion:

```bash
git add <resolved-files>
gt create -am "chore: fix_conflicts"

Comment thread .claude/commands/merge-branches.md
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/add-merge-branches-skill branch from 34b5a31 to 88fd4ee Compare May 20, 2026 10:07

@AvivYossef-starkware AvivYossef-starkware left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@AvivYossef-starkware made 2 comments.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on dorimedini-starkware).


.claude/commands/merge-branches.md line 133 at r3 (raw file):

Previously, dorimedini-starkware wrote…
  1. doesn't modify amend the merge commit? or does the -c add a new commit on the branch?
  2. best practice to use chore scope in the fix commit

-cam create a new commit
chore: fix conflict is not allowed commit message

Comment thread .claude/commands/merge-branches.md

@dorimedini-starkware dorimedini-starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@dorimedini-starkware reviewed 1 file and all commit messages, and resolved 3 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on AvivYossef-starkware).

@AvivYossef-starkware AvivYossef-starkware added this pull request to the merge queue May 20, 2026
Merged via the queue into main with commit a68bc19 May 20, 2026
16 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants