OpenParable
Skip to content
← Back to skills

PR To Main Cleanup

DevOps & Security
pr-to-main-cleanup

PR To Main Cleanup is an Agent Skill for devops & security published in the breaking-brake/cc-wf-studio repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

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

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/breaking-brake/cc-wf-studio/blob/HEAD/.claude/skills/pr-to-main-cleanup/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/pr-to-main-cleanup, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

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