Skip to content

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

Closed

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

Activity

  1. added a commit that references this issue on Mar 1, 2026
    25a4dc0
  2. added a commit that references this issue on Mar 1, 2026
    91d32ef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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