원클릭으로
finish
Merges completed work back to main through a protected-branch pull request workflow.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Merges completed work back to main through a protected-branch pull request workflow.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Merges completed work back to main through a protected-branch pull request workflow.
Set up a new git worktree and install dependencies.
Set up a new git worktree and install dependencies.
Prepares a Python package for PyPI release by updating the version, building, and verifying the distribution.
Prepare a release by updating the version, building, and verifying the distribution.
Verify that the codebase matches the desired end state described in a design document.
| name | finish |
| description | Merges completed work back to main through a protected-branch pull request workflow. |
You are starting out in a Git worktree folder. Work has been completed and it is time to merge this work back into the main branch via a pull request (branch protection is enabled on main).
$ARGUMENTS
Run /merge-main to fetch and merge the latest changes from main. This handles conflict resolution if any conflicts occur.
If the project uses a package manager with a lockfile, install any new dependencies from the merge. Main is guaranteed to be in a good state, so if checks fail due to missing dependencies after the merge, it's because you need to install from the lockfile - NOT because dependencies need to be added.
Examples:
poetry install --with devpip install -e .npm cipnpm install --frozen-lockfilecargo buildMake sure all checks that would normally pass on CI pass locally. This typically includes:
Fix things if need be, and COMMIT ANY CHANGES YOU MAKE.
Verify that the working state is completely clean (all work committed, nothing staged or unstaged). If there are uncommitted changes:
Find out the current branch by running the command git branch --show-current. Remember this as <completed-branch> for the following steps.
Push the branch to origin: git push -u origin <completed-branch>.
Before creating the PR, examine what's actually being merged:
git diff main..HEAD --stat to see the files that will changegit log main..HEAD --oneline to see commits on this branchCreate a pull request with a proper title and body:
gh pr create --base main --title "<descriptive title>" --body "<summary of actual changes>"--fill as it concatenates all commit messages, including those for changes already on mainEnable auto-merge on the PR with explicit commit message control:
bash gh pr merge <pr-number> --auto --squash --subject "<PR title>" --body "<PR body>"
Use the same title and body from step 7. This is critical because GitHub's default squash behavior concatenates ALL commit messages from the branch - including commits that are already on main (e.g., from cherry-picks or shared history). Without --subject and --body, the squash commit message will contain irrelevant or misleading content from commits whose changes aren't even in the diff.
This may fail for various reasons:
gh api repos/<owner>/<repo> --method PATCH --field allow_auto_merge=true, then retry. Replace <owner>/<repo> with your repository's owner and name (e.g., myorg/myproject).Wait 10 seconds for CI checks to kick off, then wait for them to pass: sleep 10 && gh pr checks <pr-number> --watch.
Once checks pass, the PR should auto-merge. Verify the PR state with gh pr view <pr-number> --json state to confirm it merged (expect {"state":"MERGED"}). If the PR state is unexpected, wait to confirm next steps with the user instead of continuing.
Run cd ../main && git pull to update our local version of main
If the project uses a package manager, update dependencies on main after the merge. This ensures the main environment is in sync with any new dependencies that were added during this PR.
Examples:
cd ../main && poetry install --with devcd ../main && pip install -e .cd ../main && npm cicd ../main && pnpm install --frozen-lockfilecd ../main && cargo buildRun /teardown-worktree to remove the virtual environment, delete the remote branch if it exists, and remove the worktree directory and local branch.