breaking-brake avatar

Pr To Main Cleanup

Handles the post-merge cleanup dance of deleting both local and remote feature branches after your PR gets squashed into main. Since squash merges don't leave the commit history that lets git auto-detect merged branches, this uses force delete and chains the whole sequence together: switch to main, pull latest, nuke the local branch with -D, then delete the remote. It's triggered by saying "cleanup", "ブランチ削除", or similar phrases in English or Japanese. Saves you from manually typing that four-command chain every time, which is the kind of small friction that adds up when you're merging frequently.

GitHub stars
5.1K
last updated
Jun 11, 2026

Install

$ npx -y skills add breaking-brake/cc-wf-studio --skill pr-to-main-cleanup --agent claude-code

Installs into .claude/skills of the current project.

Files

PR to Main Cleanup

Delete merged feature branches after PR is merged to main.

Workflow

  1. Gather context (parallel):

    • git branch to identify current branch
    • git log --oneline -1 to confirm current state
  2. Execute cleanup:

    • Switch to main branch
    • Pull latest changes from origin
    • Delete local feature branch
    • Delete remote feature branch

Commands

git checkout main && git pull origin main && git branch -D <branch-name> && git push origin --delete <branch-name>

Important Notes

  • PRs to main are always squash-merged, so use -D (force delete) since git cannot detect squash merges as "merged"
  • Always pull latest main before deleting to sync merge status

Sponsors

Details

Repository
github.com/breaking-brake/cc-wf-studio
Category
Git & Pull Requests
First seen
Jun 11, 2026

More from breaking-brake/cc-wf-studio

All 7
1cherryhq avatarcherry-pr-testcherryhq/cherry-studioTest Cherry Studio PRs by checking out the branch, launching the Electron app in debug mode, and running interactive UI tests via CDP.0skills.sh installs
2cherryhq avatargh-create-prcherryhq/cherry-studioCreate or update GitHub pull requests using the repository-required workflow and template compliance. Use when asked to create/open/update a PR so the assistant0skills.sh installs
3claude-office-skills avatarChangelog Generatorclaude-office-skills/skillsGenerate release notes from git commits, updates, or feature lists0skills.sh installs
4cockroachdb avatarcommit-helpercockroachdb/cockroachHelp create git commits and PRs with properly formatted messages and release notes following CockroachDB conventions. Use when committing changes or creating pu0skills.sh installs
5digitalpetri avatarcommitdigitalpetri/modbusCreate git commits with user approval0skills.sh installs
6dtsola avatarcode-review-expertdtsola/xiaoyaosearchExpert code review of current git changes with a senior engineer lens. Detects SOLID violations, security risks, and proposes actionable improvements.0skills.sh installs