finish-branch

Run tests and integrate a completed feature branch via git or gh commands.

1|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/n0rvyn/indie-toolkit --skill finish-branch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finish-branch
Source: https://github.com/n0rvyn/indie-toolkit/tree/main/dev-workflow/skills/finish-branch
Command: npx skills add https://github.com/n0rvyn/indie-toolkit --skill finish-branch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When implementation is complete, it is unclear whether to merge, open a pull request, keep the branch, or discard work while ensuring tests and documentation gates are respected. This Skill provides a safe, repeatable workflow that verifies automated tests, reminds about documentation updates, and enforces confirmation for destructive actions before changing branch state.

Core Features & Use Cases

  • Test Gate: Auto-detects and runs the appropriate test command (npm, cargo, pytest, go test, xcodebuild) and stops if tests fail.
  • Integration Options: Presents exactly four choices — merge locally, push and create a PR, keep the branch, or discard — and executes the selected git/gh commands.
  • Repository Hygiene: Checks documentation paths for feature specs, ADRs, and changelog reminders, determines the correct merge base, and conditionally cleans up git worktrees.
  • Use Case: Use after finishing a feature to ensure tests pass, choose the integration strategy, and perform safe cleanup including worktree removal when applicable.

Quick Start

Finish the current feature branch by running tests, choose whether to merge locally or create a PR, and perform any necessary branch and worktree cleanup.

Frequently Asked Questions about finish-branch

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

FAQPage Schema
How do I finalize a feature branch and make sure tests pass before merging?

Finalizing a feature branch requires running the project's test suite as a gate before integration. This workflow auto-detects and executes the appropriate test command (npm, cargo, pytest, go test, xcodebuild) and stops the merge process if any tests fail.

What's the best way to integrate a completed git branch locally or via pull request?

Integrating a completed git branch can be done by merging locally or pushing to create a pull request. This workflow presents both options alongside keeping or discarding the branch, then executes the corresponding git and gh commands based on your selection.

Does this git branch cleanup workflow support removing linked worktrees?

Yes, git branch cleanup supports conditionally removing linked worktrees. After you choose to merge, create a pull request, or discard the branch, the workflow performs safe cleanup and removes any associated git worktrees when applicable.

When should I discard a feature branch instead of keeping it after implementation?

Discarding a feature branch is appropriate when implementation is complete but the changes are no longer needed. This workflow enforces confirmation for destructive actions like discarding, ensuring branch state is only changed after explicit approval.

Can I use this workflow to check documentation before creating a pull request?

Yes, you can check documentation before creating a pull request using this workflow. It scans documentation paths for feature specs, ADRs, and changelog reminders, ensuring repository hygiene standards are met before integrating changes.