finishing-a-development-branch
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
Skill by basnijholt
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/basnijholt-finishing-a-development-branch
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
finishing-a-development-branch- Description
- Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
- License
- MIT
- Instructions
- 217 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Finishing a Development Branch ## Overview **Core principle:** Verify tests → Detect environment → Follow requested outcome → Clean up safely. **Announce at start:** "I'm using the finishing-a-development-branch skill to complete this work." ## Step 1: Verify Tests Run the project's full test suite (`npm test` / `cargo test` / `pytest` / `go test ./...`). **If tests fail**, report the failures and stop — the menu comes after a green suite: ``` Tests failing (<N> failures). Must fix before completing: [Show failures] ``` **If tests pass:** continue to Step 2. ## Step 2: Detect Environment ```bash GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P) GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P) # Capture now, while still inside the workspace — Step 5 changes directory # before cleanup (Step 6) needs this value WORKTREE_PATH=$(git rev-parse --show-toplevel) ``` **Detached HEAD** (`git branch --show-current` prints nothing, common in harness-managed worktrees): create a branch now with `git switch -c <descriptive-branch>`. Commits left on a detached HEAD are lost when the host deletes its worktree. If branch creation is blocked (e.g. by a sandbox), report the detached state and the head SHA, and stop. This determines how cleanup works: | State | Cleanup | |-------|---------| | `GIT_DIR == GIT_COMMON` (normal repo) | No worktree to clean up | | `GIT_DIR != GIT_COMMON` | Provenance-based (see Step 6) | ## Step 3: Determine Base Branch The base branch is whatever this work forked from — usually named in the plan, the conversation, or the branch's upstream. If it is not already known, derive it from merge-base, upstream tracking, and repository defaults. If those disagree, stop before merging or opening a PR and report the ambiguity: integrating into the wrong base is expensive to undo. ## Step 4: Select Requested Integration Follow the requested outcome already present in the task or repository instructions: - If the request includes opening a PR, push and create the PR. - If the request includes local integration, merge locally. - If no integration side effect was requested, keep the branch and worktree, report their state, and stop. Do not turn completion into a permission menu. Publishing, merging, or deleting work without that outcome being requested requires new authority. Preserve the branch instead of asking a routine completion question. ## Step 5: Execute Choice ### Option 1: Merge Locally ```bash # Get main repo root for CWD safety MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel) cd "$MAIN_ROOT" # Worked in a linked worktree? The main checkout belongs to your human # partner: merge there only if it is clean and already on the base branch. git status --porcelain # must print nothing git branch --show-current # must print <base-branch> # Worked in the main checkout itself? Switch it: git checkout <base-branch> # Merge first — verify success before removing anything git pull git merge <feature-branch> # Verify tests on merged result <test command> ``` If you worked in a linked worktree and the main checkout has uncommitted changes or is on another branch, do not switch or stash it: report and stop. If tests fail on the merged result: stop, leave the worktree and branch in place, and investigate — nothing has been pushed, so the merge is local and recoverable. Once the merged result is green: clean up the worktree (Step 6), then delete the branch: ```bash git branch -d <feature-branch> ``` ### Option 2: Push and Create PR ```bash git push -u origin <feature-branch> ``` Then create the pull/merge request against <base-branch> with the forge's tooling — its CLI if one is available, or the creation URL most forges print when you push — following the repo's PR template and conventions if present, and report the URL to your human partner. Keep the worktree — your human partner iterates on PR feedback there. ### Option 3: Keep As-Is
From basnijholt/baspowers, MIT.
More from basnijholt/baspowers
- 0.592score
diagnosing-baspowers
basnijholt
Use when a baspowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
executing-plans
basnijholt
Use when executing an implementation plan in the current session as the implementer yourself — Native (inline) execution was selected for the plan, or no…
SkillAFreshness: A★ 1Claude Code +9 - 0.591score
using-baspowers
basnijholt
Use when starting a new conversation or task, or when the task changes enough that different skills may apply
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
merging-when-approved
basnijholt
Use when asked to review a pull request and merge it only if approved, or before merging a pull request you wrote or changed
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
stopping-runaway-prs
basnijholt
Use when a pull request has grown well past its estimate, review rounds keep finding new defects, fixes keep spawning more fixes, or a change that claims to…
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
consulting-cross-model
basnijholt
Use when a hard technical decision remains ambiguous after inspecting relevant evidence and choosing incorrectly would cause meaningful rework
SkillAFreshness: A★ 1Claude Code +9 - 0.586score
triaging-pr-backlogs
basnijholt
Use when asked to clean up, triage, or prune a backlog of open pull requests or issues
SkillAFreshness: A★ 1Claude Code +9 - 0.586score
scoring-pull-requests
basnijholt
Use when asked whether a pull request or change is good, clean, big, risky, over-engineered, or worth merging
SkillAFreshness: A★ 1Claude Code +9 - 0.582score
reporting-status
basnijholt
Use when asked where things stand, what is left, or whether work is done or stuck, and when ending a turn after work on several items
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
wait-what
basnijholt
Use when the last message did not land and needs a simpler re-pitch with the missing context
SkillAFreshness: A★ 1Claude Code +9 - 0.564score
brainstorming
basnijholt
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior.
SkillAFreshness: A★ 1Claude Code +9 - 0.562score
using-git-worktrees
basnijholt
Use when starting feature work that needs isolation from the current workspace, or before executing implementation plans
SkillAFreshness: A★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 8, 2026 (19 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/basnijholt/baspowers
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.744score
finishing-a-development-branch
obra
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
SkillAFreshness: A★ 304.6KClaude Code +9 - 0.348score
finishing-a-development-branch
guanyang
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
SkillBFreshness: B★ 980Claude Code +9 - 0.342score
finishing-a-development-branch
KalarisLabs
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
SkillBFreshness: B★ 13Claude Code +9 - 0.337score
finishing-a-development-branch
andrei649
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
SkillBFreshness: B★ 9Claude Code +9 - 0.323score
finishing-a-development-branch
thangbuiq
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
SkillAFreshness: AClaude Code +9 - 0.323score
finishing-a-development-branch
sazlin
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
SkillAFreshness: AClaude Code +9 - 0.323score
finishing-a-development-branch
muratmirgun
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
SkillBFreshness: B★ 3Claude Code +9 - 0.319score
finishing-a-development-branch
BlinkVoid
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
SkillBFreshness: B★ 2Claude Code +9 - 0.309score
finishing-a-development-branch
dotknewt
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
SkillBFreshness: B★ 1Claude Code +9 - 0.299score
finishing-a-development-branch
GFigting
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
SkillBFreshness: BClaude Code +9 - 0.299score
finishing-a-development-branch
digitaleflex
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
SkillBFreshness: BClaude Code +9 - 0.299score
finishing-a-development-branch
chauipp
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
SkillBFreshness: BClaude Code +9
More from basnijholt
- 0.592score
diagnosing-baspowers
basnijholt
Use when a baspowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
executing-plans
basnijholt
Use when executing an implementation plan in the current session as the implementer yourself — Native (inline) execution was selected for the plan, or no…
SkillAFreshness: A★ 1Claude Code +9 - 0.591score
using-baspowers
basnijholt
Use when starting a new conversation or task, or when the task changes enough that different skills may apply
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
consulting-cross-model
basnijholt
Use when a hard technical decision remains ambiguous after inspecting relevant evidence and choosing incorrectly would cause meaningful rework
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
merging-when-approved
basnijholt
Use when asked to review a pull request and merge it only if approved, or before merging a pull request you wrote or changed
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
stopping-runaway-prs
basnijholt
Use when a pull request has grown well past its estimate, review rounds keep finding new defects, fixes keep spawning more fixes, or a change that claims to…
SkillAFreshness: A★ 1Claude Code +9
Cite this page
finishing-a-development-branch skill. Agent Mart. https://agentmart.dev/skills/basnijholt-finishing-a-development-branch (last updated 2026-10-24)