# Skill Finish Branch

Wrap up a branch, run tests, create PR, merge or discard, use when implementation is...

- Repository: https://github.com/nyldn/claude-octopus (4351 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add nyldn/claude-octopus --skill skill-finish-branch -g -a claude-code -y`
Codex: `npx skills add nyldn/claude-octopus --skill skill-finish-branch -g -a codex -y`
Cursor: `npx skills add nyldn/claude-octopus --skill skill-finish-branch -g -a cursor -y`
Gemini CLI: `npx skills add nyldn/claude-octopus --skill skill-finish-branch -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add nyldn/claude-octopus`

## Description

Wrap up a branch, run tests, create PR, merge or discard, use when implementation is done

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Finishing a Development Branch

**Your first output line MUST be:** `🐙 **CLAUDE OCTOPUS ACTIVATED** - Branch Completion`

## Overview

Full ship pipeline: tests → multi-provider review → version bump → changelog → commit → push → PR.

**Core principle:** Verify tests → Review diff → Bump version → Update changelog → Present options → Execute choice → Clean up.

---

## The Process

### Step 1: Verify Tests Pass

**Before anything else, verify tests pass:**

```bash
# Detect and run project's test suite
if [[ -f "package.json" ]]; then npm test
elif [[ -f "pytest.ini" ]] || [[ -f "pyproject.toml" ]]; then pytest
elif [[ -f "Cargo.toml" ]]; then cargo test
elif [[ -f "go.mod" ]]; then go test ./...
elif [[ -f "Makefile" ]] && grep -q '^test:' Makefile; then make test
fi
```

**If tests fail:** STOP. Show failures. Do not proceed.

**If tests pass:** Continue to Step 2.

---

### Step 2: Multi-Provider Diff Review

**Run a quick multi-provider review of the changes before shipping.** This catches issues before they reach PR reviewers.

```bash
# Get the diff summary
DIFF_STAT=$(git diff --stat $(git merge-base HEAD main)..HEAD)
DIFF_FILES=$(git diff --name-only $(git merge-base HEAD main)..HEAD)
```

**Always run a quick review, this is automatic, not optional:**

```bash
# Quick review via orchestrate.sh (uses available providers)
${HOME}/.claude-octopus/plugin/scripts/orchestrate.sh spawn reviewer "Review this diff for bugs, security issues, and code quality problems. Be concise, only flag real issues, not style preferences.

$(git diff $(git merge-base HEAD main)..HEAD | head -500)"
```

**If critical issues found:** Present them and ask whether to fix or ship anyway.
**If clean:** Continue to Step 3. Show a brief `✓ Review clean, no issues found`.

---

### Step 3: Determine Base Branch & Version

The rest: https://github.com/nyldn/claude-octopus/blob/HEAD/.claude/skills/skill-finish-branch/SKILL.md
