SuperAPI AI Directory

merge-and-branch

Coding & development

View repository

Updated 10-16 04:58

About this skill

Merge PR and Create Branch

I have gathered information about the current PR and git state. Here are the results:

<current_pr> !gh pr view --json number,title,state,url,headRefName </current_pr>

<current_branch> !git rev-parse --abbrev-ref HEAD </current_branch>

<git_status> !git status --short </git_status>

Instructions

Step 1: Verify PR is ready

  1. Check the PR state - ensure it's OPEN and ready to merge.
  2. Check for uncommitted changes - warn if there are local changes that might be lost.

Step 2: Merge the PR

  1. Merge with squash and delete the branch:
    gh pr merge <number> --squash --delete-branch
    

Step 3: Switch to main

  1. Checkout main and pull latest:
    git checkout main && git pull
    

Step 4: Create new branch

  1. Ask the user for the new branch name using AskUserQuestion tool.

  2. Create the branch:

    git checkout -b <branch-name>
    
  3. Confirm the new branch was created with git branch --show-current.