# PR To Main Cleanup

Clean up merged feature branches after PR to main is merged.

- Repository: https://github.com/breaking-brake/cc-wf-studio (5444 stars)
- Category: Git and review
- License: see repository
- Last updated: 2026-10-07
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add breaking-brake/cc-wf-studio --skill pr-to-main-cleanup -g -a claude-code -y`
Codex: `npx skills add breaking-brake/cc-wf-studio --skill pr-to-main-cleanup -g -a codex -y`
Cursor: `npx skills add breaking-brake/cc-wf-studio --skill pr-to-main-cleanup -g -a cursor -y`
Gemini CLI: `npx skills add breaking-brake/cc-wf-studio --skill pr-to-main-cleanup -g -a gemini-cli -y`

## Description

Clean up merged feature branches after PR to main is merged. Use when the user says "ブランチ削除", "cleanup", "マージ後の片付け", or wants to delete a merged branch.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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

```bash
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

