| name | finishing-a-development-branch |
| description | Use when implementation is done and tests pass, and the user must choose how to integrate or retain completed branch work. |
Finishing a Development Branch
Overview
Verify the completed result, offer only safe next actions, and preserve work unless the user explicitly requests its destruction.
Announce at start: "I'm using the finishing-a-development-branch skill to complete this work."
Step 1: Verify Tests
Run the relevant project test suite before offering choices. If it fails, STOP: report failures and fix them before merge or PR.
Step 2: Capture Repository Identity Before Any Directory Change
Before any cd to the main repository or base branch, capture the current repository data:
GIT_DIR=$(git rev-parse --git-dir)
GIT_COMMON=$(git rev-parse --git-common-dir)
WORKTREE_PATH=$(git rev-parse --show-toplevel)
Determine the base branch without changing directories:
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
Resolve the current project's common root from the captured common Git directory. git rev-parse --git-common-dir may return either an absolute or a relative .git path, so handle both before any directory change:
if [[ "$GIT_COMMON" = /* ]]; then
PROJECT_ROOT=$(dirname "$GIT_COMMON")
else
PROJECT_ROOT=$(cd "$(dirname )" && )