---
name: PR to Main Cleanup
slug: pr-to-main-cleanup
category: Automation
description: PR to Main Cleanup deletes merged feature branches after a pull request to main is merged. Use it when you want to clean up local and remote branches after merging a PR, especially with squash-merged PRs.
github: "https://github.com/breaking-brake/cc-wf-studio/tree/main/.claude/skills/pr-to-main-cleanup"
language: TypeScript
stars: 5353
forks: 571
install: "npx degit https://github.com/breaking-brake/cc-wf-studio/tree/main/.claude/skills/pr-to-main-cleanup ~/.claude/skills/pr-to-main-cleanup"
installs_to: ~/.claude/skills/pr-to-main-cleanup
source_path: .claude/skills/pr-to-main-cleanup/SKILL.md
collection_size: 11
category_size: 1523
collection_url: "https://dirskills.com/collections/breaking-brake/cc-wf-studio"
added: 2026-08-16T07:00:08.070Z
last_synced: 2026-08-16T07:00:08.070Z
canonical_url: "https://dirskills.com/skills/pr-to-main-cleanup"
---

# PR to Main Cleanup

PR to Main Cleanup deletes merged feature branches after a pull request to main is merged. Use it when you want to clean up local and remote branches after merging a PR, especially with squash-merged PRs.

**Install:**

```bash
npx degit https://github.com/breaking-brake/cc-wf-studio/tree/main/.claude/skills/pr-to-main-cleanup ~/.claude/skills/pr-to-main-cleanup
```

## README

# 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
