finishing-a-development-branch

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

Author

Install

Hot:4

Download and extract to your skills directory

Copy command and send to OpenClaw for auto-install:

Download and install this skill https://openskills.cc/api/download?slug=sickn33-skills-finishing-a-development-branch&locale=en&source=copy

Finishing a Development Branch - Smart Guide for Completing a Development Branch

Skills Overview

When your development task is complete and all tests pass, the Finishing a Development Branch skill helps you finish the code integration work—using structured options to decide whether to merge locally, create a PR, keep the branch, or abandon the work.

When to Use

  • Feature development completed: You’ve finished work on a feature branch, all tests have passed, and you need to decide how to integrate the code into the main branch.
  • Preparing for code review: Your development work is done, and you need to create a Pull Request for the team to review, but you’re unsure about the standard PR creation process.
  • Branch cleanup management: After multiple development tasks are completed, you need to systematically clean up local branches and Git worktrees to keep your workspace tidy.
  • Core Features

  • Pre-checks for test validation
  • Before showing any options, the skill automatically runs your project’s test suite (e.g., npm test, cargo test, pytest, go test, etc.) to ensure only code that passes tests can proceed to the merge flow. If tests fail, it displays detailed failure information and blocks you from continuing.

  • Guided structured options
  • The skill provides four clear options for you to choose from:

  • Option 1: Merge locally into the base branch

  • Option 2: Push to remote and create a Pull Request

  • Option 3: Keep the branch as-is (handle later)

  • Option 4: Discard this work
  • Each option includes a clear execution flow description, avoiding uncertainty caused by open-ended decision-making.

  • Safe branch and worktree cleanup
  • Based on your choice, the skill intelligently handles Git worktree cleanup:

  • After a local merge or discarding work, it automatically cleans up the worktree

  • When creating a PR or keeping the branch, it preserves the worktree for later use

  • Discarding requires entering "discard" to confirm, preventing accidental deletion
  • Frequently Asked Questions

    Do I have to run tests before finishing development?


    Yes—this is mandatory. Before any merge options are shown, the skill automatically runs the project’s test suite. If tests fail, you must fix all failing tests before you can continue. This ensures only verified code is allowed into the main branch.

    When should I create a Pull Request instead of merging locally?


    If you need team code review, or you’re collaborating on a shared project, you should choose to create a PR. If it’s a personal project, or your team uses a “merge first, review later” workflow, local merge may be more efficient. The skill will run the appropriate flow based on your choice.

    Can deleting a branch or discarding work be undone?


    A normal deletion (git branch -d) can usually be recovered in Git, but discarding (git branch -D) permanently deletes the branch and all its commits. Therefore, the skill adds a second confirmation step for discard operations—you must type "discard" to proceed. If you think you might need the work in the branch, it’s recommended to choose option 3 (keep the branch) instead of option 4.