Skip to content

Add cleanup-branch skill for post-PR branch cleanup #42

Description

@TheJavaGuy

Overview

Add a cleanup-branch project-level skill that switches to master, pulls latest changes, and deletes the current feature branch — safe to invoke after a PR is merged.

Motivation

After merging a PR, the cleanup sequence (checkout master → pull → delete branch) is repetitive. A dedicated skill eliminates the need to remember the -D flag nuance and the master-guard safety check.

File Locations

File Action
.claude/skills/cleanup-branch/SKILL.md Create

Behaviour

  1. Captures the current branch name before switching
  2. Checks out master and pulls
  3. Deletes the feature branch using -D (safe after remote merge)
  4. Guards against deleting master itself

Verification

  • Skill file exists at .claude/skills/cleanup-branch/SKILL.md
  • Running /cleanup-branch on a feature branch switches to master, pulls, and deletes the branch
  • Running /cleanup-branch on master does NOT delete master

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions