Use after a PR has been merged to clean up. Switches to main, pulls latest, and deletes the local feature branch. Triggers include "merged", "pr merged", "cleanup branch", or after confirming a PR was merged. Part of the Shep autonomous SDLC platform — https://shep.bot
Switch to main, pull latest changes, and delete the local feature branch.
digraph merged_flow {
rankdir=LR;
node [shape=box];
start [label="Start" shape=ellipse];
get_branch [label="Get current branch name"];
checkout_main [label="git checkout main"];
pull [label="git pull"];
delete_branch [label="git branch -d <branch>"];
done [label="Done" shape=ellipse];
start -> get_branch;
get_branch -> checkout_main;
checkout_main -> pull;
pull -> delete_branch;
delete_branch -> done;
}CURRENT_BRANCH=$(git branch --show-current)If already on main, skip cleanup.
Mark feature as complete BEFORE deleting branch:
# specs/NNN-feature-name/feature.yaml
feature:
lifecycle: 'complete' # Update from "review"
status:
phase: 'complete' # Update from "in-review"
lastUpdated: '<timestamp>'
lastUpdatedBy: 'shep-kit:merged'
mergedAt: '<timestamp>' # Add merge timestamp
checkpoints:
# Add final checkpoint:
- phase: 'feature-merged'
completedAt: '<timestamp>'
completedBy: 'shep-kit:merged'Commit and push to main (feature.yaml is in main now):
# Still on main branch after merge
git add specs/NNN-feature-name/feature.yaml
git commit -m "chore(specs): mark NNN-feature-name as complete"
git pushReference: docs/development/feature-yaml-protocol.md
git checkout main
git pull # Get latest including feature.yaml updategit branch -d $CURRENT_BRANCHUse -d (safe delete) which only deletes if branch is merged. If it fails, the branch wasn't merged - warn the user.
| Command | Purpose |
|---|---|
git branch --show-current | Get current branch name |
git checkout main && git pull | Switch to main and update |
git branch -d <branch> | Delete merged branch (safe) |
git branch -D <branch> | Force delete (use with caution) |
# On feature branch after PR merged
BRANCH=$(git branch --show-current)
git checkout main && git pull && git branch -d $BRANCHshep-ai/shep
6e56c93
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.