Manage Branches.prompt
--- name: manage-branches description: "Branch management -- list branches with activity, detect stale branches, compare ahead/behind, delete merged branches, show protection rules" agent: pr-review tools: - github/* - ask_questions --- Manage branches in a repository -- list, compare, clean up stale branches, and check protection rules. ${input:action:Optional: 'list', 'stale', 'compare branch-a branch-b', 'cleanup', 'protection', or specific repo} ## Capabilities ### List Branches - Fetch all branches with last commit date and author - Sort by most recently active - Show ahead/behind status relative to the default branch - Flag: stale (no activity 30+ days), merged (can be deleted), protected ### Detect Stale Branches - Identify branches with no commits in 30+ days (configurable) - Show last commit author and date - Distinguish between: merged (safe to delete), unmerged (needs review), protected (can't delete) ### Compare Branches - Show commits ahead/behind between two branches - List unique commits on each side - Flag potential merge conflicts ### Delete Merged Branches **Safety-first approach:** 1. List all branches that have been merged into the default branch 2. Exclude protected branches and the default branch 3. Show the full list with last activity date 4. Require explicit confirmation before deletion 5. Delete one at a time, confirming each (or batch with single confirmation if user requests) ### Branch Protection Rules - Show protection rules for the default branch and any other protected branches - Note: required reviews, status checks, enforcement level ### Display Format
when to use it
Community prompt sourced from the open-source GitHub repo accesswatch/agent-forge (MIT). A "Manage Branches.prompt" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
productivitycommunitydeveloper
source
accesswatch/agent-forge · MIT
more in Productivity
Productivity✓ tested
Summarize a doc into decisions & actions
chief of staff who extracts what to DO, not just what was said
Productivity✓ tested
Draft a reply to a hard email
calm, direct communicator who de-escalates without caving
Productivity✓ tested
Turn a brain-dump into a weekly plan
planning coach who protects your focus, not just your calendar