finishing-a-development-branch

Automate Git branch integration decisions with four options after tests pass.

Updated Jan 17, 2026
One-click install
npx skills add https://github.com/brmatola/gremlins --skill finishing-a-development-branch-brmatola
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/brmatola/gremlins/tree/main/skills/finishing-a-development-branch
Command: npx skills add https://github.com/brmatola/gremlins --skill finishing-a-development-branch-brmatola

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates post-implementation integration decisions for finished work.

Core Features & Use Cases

  • Finalization Guidance: Determine base branch, present exactly four options, and streamline the merge/PR/cleanup process.
  • Safety Checks: Verify all tests pass before proceeding and ensure the chosen path aligns with repository standards.
  • Cleanup & Archival: Cleanly remove or preserve branches per decision, and tidy the worktree.

Quick Start

Announce at start: "I'm using the finishing-a-development-branch skill to complete this work."

  1. Run the project's test suite: npm test / pytest / cargo test ./...
  2. Determine base branch: git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
  3. Present the four options: Implementation complete. What would you like to do?
  1. Merge back to <base-branch> locally
  2. Push and create a Pull Request
  3. Keep the branch as-is (I'll handle it later)
  4. Discard this work
  1. Execute a chosen option (examples shown below)
  • Option 1 (Merge Locally)

    Switch to base branch

    git checkout <base-branch>

    Pull latest

    git pull

    Merge feature branch

    git merge <feature-branch>

    Verify tests on merged result

    <test command> # If tests pass git branch -d <feature-branch>
  • Option 2 (Push & Create PR) git push -u origin <feature-branch> gh pr create --title "<title>" --body "<PR body text>"
  1. Cleanup worktree if needed
  • For Options 1 & 4: check and remove the worktree path
  • For Option 3: keep worktree

Frequently Asked Questions about finishing-a-development-branch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely merge a Git feature branch back to the main branch after tests pass?

To safely merge a Git feature branch, first verify all tests pass, determine the base branch using git merge-base, then execute a local merge and pull latest changes before deleting the feature branch.

What is the best workflow to finalize a development branch and create a pull request?

The best workflow to finalize a development branch involves running tests, pushing the branch to origin with git push, and using a tool like gh pr create to generate the pull request.

Can I automate Git cleanup and worktree removal after merging a feature branch?

Yes, you can automate Git cleanup by executing branch deletion commands like git branch -d and checking or removing the worktree path once the local merge is successfully completed.

What should I do if I want to keep a Git feature branch as-is instead of merging it?

To keep a Git feature branch as-is, select the keep option during the finalization flow, which preserves the branch and its worktree without executing any merge or pull request commands.

How do I discard finished work on a development branch and clean up the repository?

To discard finished work on a development branch, select the discard option in the finalization flow, which removes the branch and cleans up the associated worktree path to tidy the repository.

Does this Git branch finalization process require tests to pass before merging?

Yes, this Git branch finalization process enforces a safety check that requires the project's test suite to pass before allowing any merge or pull request actions to proceed.