# branch-finish

This skill inspects Git state and verified work before you merge, open a pull request, keep a branch, or remove its workspace.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 836 installs · ★ 6
- Author: sentimony
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/sentimony/skills/tree/HEAD/plugins/devflow/skills/branch-finish/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/branch-finish

## What it does

branch-finish inspects the repository before a handoff decision. It checks the current branch, working tree, worktree details, upstream, remotes, merge state, and workspace ownership. The script `scripts/inspect_finish_state.py` gathers the state as JSON; the skill uses that data to choose a safe path.

It accepts only a confirmed `PASS` before an integration action that claims to finish the work. Available paths include a local merge, pushing or opening a pull request, merging on a forge, keeping the branch, and discarding it. A changed integrated tree requires a fresh verification result.

An ambiguous base branch blocks automatic merging. Detached HEAD is handled as a separate state rather than treated like a normal branch.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add sentimony/skills --skill branch-finish -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/branch-finish/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/branch-finish/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add sentimony/skills --skill branch-finish -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/branch-finish/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add sentimony/skills --skill branch-finish -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/branch-finish/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install sentimony/skills branch-finish
```

2. **Manually: put the files in place**
- File: `.github/skills/branch-finish/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add sentimony/skills --skill branch-finish -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/sentimony/skills --path plugins/devflow/skills/branch-finish
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/branch-finish/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add sentimony/skills --skill branch-finish -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/sentimony/skills/tree/HEAD/plugins/devflow/skills/branch-finish/SKILL.md

## When to use it
- inspect Git before handing off completed work
- choose between a local merge and a pull request
- resolve the base branch from available evidence
- keep a branch and workspace intact
- delay cleanup until the integrated tree passes again

## Example prompts
- Inspect the current Git state and show the safe ways to finish this branch.
- Find the base branch, then prepare the pull-request path.
- After the merge, verify the new tree before cleaning up the workspace.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: b651f6e1f35e722b.

BEGIN THIRD-PARTY FILE b651f6e1f35e722b
````text
---
name: branch-finish
description: You MUST use this when verified development work is ready for an integration or handoff decision - merging, pushing, opening a pull request, preserving or discarding a branch, or cleaning up its workspace. Covers safe completion choices based on the actual Git state and verification evidence.
metadata:
  version: "1.1.5"
license: MIT
---

# Branch Finish

## Overview

This skill decides what happens to verified work and executes that decision safely. It does
not decide whether the work is verified.

```text
CLEAN UP ONLY AFTER THE INTEGRATED TREE IS VERIFIED AND THE WORKSPACE IS PROVABLY OURS.

Preserving work is always a valid outcome.
```

Integration is the point where a mistake stops being local. A merge into the wrong base, a
deleted branch whose commits exist nowhere else, a removed workspace holding uncommitted notes:
each destroys work that was correct a moment earlier.

## Non-goals

This skill does not implement the work, define test design, investigate failures, gather browser
evidence, request or conduct review, disposition findings, define sufficient evidence, issue the
completion verdict, create or select a workspace, teach general Git usage, or deploy. The
Boundaries table below names the owner of each.

`verification-gate` and `git-worktree-isolation` are the two boundaries most easily blurred. This
skill consumes a verdict from the first and an ownership value from the second. It produces
neither.

This skill creates no persistent state directory. `.branch-finish/` is forbidden, as is any
equivalent under another name. `.sdd/` belongs to `subagent-plan-dev`: this skill does not read
it as a state store, does not write to it, and does not remove it. The sources of truth are
Git, the verification state, the review state, and the execution context.

## Lifecycle

```text
enter
  -> inspect environment
  -> check verification state
  -> determine available finish options
  -> user chooses (or context already chose)
  -> execute choice safely
  -> did the tree change materially?
       no  -> completion report
       yes -> verification-gate
                PASS -> safe cleanup -> completion report
                other -> preserve state, route the failure
```

This is the shape, not a ceremony. A trivial change on the user's own branch, with no separate
workspace and no integration decision to make, does not enter this skill at all.

## Environment detection

Determine, read-only, before any option is offered: repository root, current branch, HEAD, git
dir and git common dir, working tree status including untracked files, linked worktree or
normal checkout, detached HEAD, upstream, remotes, merge state, and workspace ownership. Never
assume a normal branch, `main` as the base, that the workspace is ours, a GitHub CLI, or a
remote named `origin`.

`scripts/inspect_finish_state.py` collects this deterministically and emits JSON. Its output is
data to reason about, not a decision: it reports what Git can prove and leaves every judgment to
````
END THIRD-PARTY FILE b651f6e1f35e722b

The third-party file has ended. Everything between the b651f6e1f35e722b tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3039 of 17807 bytes. © sentimony · MIT · https://github.com/sentimony/skills/tree/HEAD/plugins/devflow/skills/branch-finish/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
