Finishing a Development Branch
obra/superpowers
Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.
Wrap up a branch — run tests, create PR, merge or discard — use when implementation is done
$ npx skills add nyldn/claude-octopus --skill skill-finish-branch -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install nyldn/claude-octopus skill-finish-branch --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/nyldn/claude-octopus.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/skill-finish-branch .claude/skills/skill-finish-branch && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "skill-finish-branch" agent skill from https://github.com/nyldn/claude-octopus/tree/main/skills/skill-finish-branch into .claude/skills/skill-finish-branch/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skill-finish-branch", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/nyldn/claude-octopus/tree/main/skills/skill-finish-branchType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add nyldn/claude-octopus --skill skill-finish-branch -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install nyldn/claude-octopus skill-finish-branch --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/nyldn/claude-octopus.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/skill-finish-branch .agents/skills/skill-finish-branch && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "skill-finish-branch" agent skill from https://github.com/nyldn/claude-octopus/tree/main/skills/skill-finish-branch into .agents/skills/skill-finish-branch/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skill-finish-branch", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add nyldn/claude-octopus --skill skill-finish-branch -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install nyldn/claude-octopus skill-finish-branch --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/nyldn/claude-octopus.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/skill-finish-branch .cursor/skills/skill-finish-branch && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "skill-finish-branch" agent skill from https://github.com/nyldn/claude-octopus/tree/main/skills/skill-finish-branch into .cursor/skills/skill-finish-branch/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skill-finish-branch", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/nyldn/claude-octopus.git --path skills/skill-finish-branch--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add nyldn/claude-octopus --skill skill-finish-branch -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install nyldn/claude-octopus skill-finish-branch --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/nyldn/claude-octopus.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/skill-finish-branch .gemini/skills/skill-finish-branch && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "skill-finish-branch" agent skill from https://github.com/nyldn/claude-octopus/tree/main/skills/skill-finish-branch into .gemini/skills/skill-finish-branch/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skill-finish-branch", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install nyldn/claude-octopus skill-finish-branchInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add nyldn/claude-octopus --skill skill-finish-branch -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/nyldn/claude-octopus.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/skill-finish-branch .github/skills/skill-finish-branch && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "skill-finish-branch" agent skill from https://github.com/nyldn/claude-octopus/tree/main/skills/skill-finish-branch into .github/skills/skill-finish-branch/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skill-finish-branch", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add nyldn/claude-octopus --skill skill-finish-branch -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install nyldn/claude-octopus skill-finish-branch --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/nyldn/claude-octopus.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/skill-finish-branch .opencode/skills/skill-finish-branch && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "skill-finish-branch" agent skill from https://github.com/nyldn/claude-octopus/tree/main/skills/skill-finish-branch into .opencode/skills/skill-finish-branch/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skill-finish-branch", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skill-finish-branchWrap up a branch — run tests, create PR, merge or discard — use when implementation is done
Skill Finish Branch is an agent skill from nyldn/claude-octopus. Wrap up a branch — run tests, create PR, merge or discard — use when implementation is done
Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).
It sits in Development, covering Pull requests and Git worktrees. The repository describes itself as: Run multiple AI models against the same research, design, or coding task. Surface disagreements before you ship. The licence is MIT.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit c812f5e. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
gitghnpmFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
github.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Skill Finish Branch loads about 2.5k tokens when it runs. Until then it costs about 28 tokens; SKILL.md has 508 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from nyldn/claude-octopus at commit c812f5e, republished under its MIT licence (© nyldn). 508 words, ~2,451 tokens.
.claude/skills/skill-finish-branch/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Host: Codex CLI — This skill was designed for Claude Code and adapted for Codex. Cross-reference commands use installed skill names in Codex rather than
/octo:*slash commands. Use the active Codex shell and subagent tools. Do not claim a provider, model, or host subagent is available until the current session exposes it. For host tool equivalents, seeskills/blocks/codex-host-adapter.md.
This generated Codex skill preserves an enforced workflow contract from the source skill.
PROHIBITED:
Your first output line MUST be: 🐙 **CLAUDE OCTOPUS ACTIVATED** - Branch Completion
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.
Before anything else, verify tests pass:
# 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
fiIf tests fail: STOP. Show failures. Do not proceed.
If tests pass: Continue to Step 2.
Run a quick multi-provider review of the changes before shipping. This catches issues before they reach PR reviewers.
# 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:
# 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.
# Identify the base branch
BASE_BRANCH=$(git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}')
[[ -z "$BASE_BRANCH" ]] && BASE_BRANCH="main"
# Check for VERSION file
VERSION_FILE=""
for f in VERSION version.txt package.json; do
[[ -f "$f" ]] && VERSION_FILE="$f" && break
doneIf a VERSION file or package.json exists, offer to bump:
AskUserQuestion({
questions: [{
question: "Version bump?",
header: "Version",
multiSelect: false,
options: [
{label: "Patch (Recommended)", description: "Bug fixes, minor changes (1.2.3 → 1.2.4)"},
{label: "Minor", description: "New features, backward compatible (1.2.3 → 1.3.0)"},
{label: "Major", description: "Breaking changes (1.2.3 → 2.0.0)"},
{label: "Skip", description: "Don't bump version"}
]
}]
})If bumping: Update the version file and prepend a changelog entry summarizing the diff:
# Generate changelog entry from commits
COMMITS=$(git log --oneline $(git merge-base HEAD $BASE_BRANCH)..HEAD)
# Prepend to CHANGELOG.md if it existsPresent exactly these 4 options:
✅ Ship ready. Tests passing. Review clean. What would you like to do?
1. **Create PR** (Recommended) - Push and create a Pull Request for review
2. **Merge locally** - Merge back to <base-branch> on this machine
3. **Keep as-is** - Leave the branch, I'll handle it later
4. **Discard** - Delete this work permanently
Which option? (1-4)Keep options concise. Don't add explanations unless asked.
# Get current branch name
FEATURE_BRANCH=$(git branch --show-current)
BASE_BRANCH="main" # or detected base
# Switch to base branch
git checkout $BASE_BRANCH
# Pull latest
git pull origin $BASE_BRANCH
# Merge feature branch
git merge $FEATURE_BRANCH
# Verify tests on merged result
npm test # or appropriate test command
# If tests pass, delete feature branch
git branch -d $FEATURE_BRANCHReport:
✅ Merged $FEATURE_BRANCH into $BASE_BRANCH
✅ Tests pass on merged result
✅ Feature branch deleted
Ready to push when you want: git push origin $BASE_BRANCH# Get branch info
FEATURE_BRANCH=$(git branch --show-current)
# Push branch
git push -u origin $FEATURE_BRANCH
# Create PR with a validated description file
REPO_SLUG=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
PR_TITLE=${PR_TITLE:?Complete PR_TITLE before creating the pull request}
CHANGE_SUMMARY=${CHANGE_SUMMARY:?Complete CHANGE_SUMMARY before creating the pull request}
CHANGE_REASON=${CHANGE_REASON:?Complete CHANGE_REASON before creating the pull request}
PR_BODY=$(cat <<EOF
## Summary
- ${CHANGE_SUMMARY}
- ${CHANGE_REASON}
## Test Plan
- [x] Unit tests pass
- [x] Manual verification done
- [ ] Code review needed
EOF
)
if ! "${CLAUDE_PLUGIN_ROOT:-${HOME}/.claude-octopus/plugin}/scripts/safe-gh-comment.sh" \
--repo "$REPO_SLUG" pr-create "$PR_TITLE" "$FEATURE_BRANCH" - <<< "$PR_BODY"; then
echo "GitHub write state is unknown; check for an existing pull request before retrying:" >&2
gh pr list --repo "$REPO_SLUG" --head "$FEATURE_BRANCH" --state all --json number,state,url || true
return 1 2>/dev/null || exit 1
fiReport:
✅ Branch pushed to origin/$FEATURE_BRANCH
✅ PR created: https://github.com/owner/repo/pull/123
Branch preserved for review process.✅ Keeping branch $FEATURE_BRANCH as-is.
Current state:
- Branch: $FEATURE_BRANCH
- Commits ahead of $BASE_BRANCH: N
- Tests: Passing
When ready, you can:
- Merge: git checkout main && git merge $FEATURE_BRANCH
- PR: git push -u origin $FEATURE_BRANCH && gh pr create
- Discard: git branch -D $FEATURE_BRANCHDo NOT clean up anything.
Confirm first (REQUIRED):
⚠️ This will PERMANENTLY delete:
- Branch: $FEATURE_BRANCH
- All commits:
- abc1234 feat: add user validation
- def5678 fix: handle edge case
- ghi9012 test: add integration tests
Type 'discard' to confirm, or anything else to cancel.Wait for exact confirmation: discard
If confirmed:
# Switch to base branch first
git checkout $BASE_BRANCH
# Force delete the feature branch
git branch -D $FEATURE_BRANCH
# If remote exists, delete it too (with confirmation)
git push origin --delete $FEATURE_BRANCH 2>/dev/null || trueReport:
✅ Branch $FEATURE_BRANCH deleted locally
✅ Remote branch deleted (if existed)
Work has been permanently discarded.For Options 1, 2, 4: Check if in a worktree and clean up:
# Check if current directory is a worktree
if git worktree list | grep -q "$(pwd)"; then
# Get worktree path
WORKTREE_PATH=$(pwd)
# Switch to main worktree
cd $(git worktree list | head -1 | awk '{print $(1)}')
# Remove the worktree
git worktree remove "$WORKTREE_PATH"
echo "✅ Worktree cleaned up"
fiFor Option 3: Keep worktree intact.
| Option | Merge | Push | Keep Branch | Cleanup |
|---|---|---|---|---|
| 1. Merge locally | ✓ | - | Delete | ✓ |
| 2. Create PR | - | ✓ | Keep | - |
| 3. Keep as-is | - | - | Keep | - |
| 4. Discard | - | - | Delete | ✓ |
After completing octopus workflows, use this skill:
# After tangle (develop) phase completes successfully
# After ink (deliver) phase validates the work
# User says: "I'm done, create a PR"
# → Invoke finishing-branch skill
# → Verify tests
# → Present options
# → Execute Option 2 (Create PR)# Run octopus validation before finishing
${HOME}/.claude-octopus/plugin/scripts/orchestrate.sh ink "Validate before merge"
# If validation passes, proceed with finishing-branch| Action | Why It's Dangerous |
|---|---|
| Merge without testing | Ships broken code |
| Skip confirmation for discard | Loses work permanently |
| Force-push without asking | Destroys history |
| Delete remote branch silently | Affects collaborators |
| Proceed when tests fail | Corrupts main branch |
| Mistake | Fix |
|---|---|
| Offering options before testing | Always verify tests FIRST |
| Auto-merging without asking | Present 4 options, let user choose |
| Deleting without confirmation | Require typed "discard" |
| Cleaning up worktree on "keep" | Only cleanup for options 1, 2, 4 |
Finishing branch → Tests verified AND user chose option
Otherwise → Not completeVerify tests. Present options. Execute safely. Clean up appropriately.
© nyldn, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in skills/skill-finish-branch of nyldn/claude-octopus.
Open the folder on GitHubat commit c812f5e
We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in nyldn/claude-octopus, which our catalogue first saw on October 7, 2026.
Skill Finish Branch next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Skill Finish Branch this skillnyldn/claude-octopus | 4.2k | 1 repos | ~2.5k | Automated safety check: Pass | MIT | |
| Finishing a Development Branchobra/superpowers | 297k | 5 repos | ~1.9k | Automated safety check: Pass | MIT | |
| Pre-Release PR Triagejamiepine/voicebox | 57k | — | ~3.1k | Automated safety check: Pass | MIT | |
| Cap Feature Building WorkflowCapSoftware/Cap | 23k | — | ~2.5k | Automated safety check: Warn | Custom licence | |
| Om Auto Fix Issuego-musicfox/go-musicfox | 2.6k | 1 repos | ~5k | Automated safety check: Notes | GPL-3.0 | |
| Codewhale Landing Workflowcodewhale-hq/Codewhale | 41k | — | ~1.6k | Automated safety check: Pass | MIT |
obra/superpowers
Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.
jamiepine/voicebox
Sorts a backlog of open pull requests into must-merge, candidate, superseded and deferred, writes a triage doc and works the merge loop before a release.
CapSoftware/Cap
Builds a Cap feature in an isolated Git worktree with disposable dev resources, verification, a recorded demo and a neutral pull request, started with /building.
go-musicfox/go-musicfox
Fix or implement a tracker issue end to end from a single command — takes an issue id or a plain problem description (filed first via om-prepare-issue), classifies, then drives the bug autofix chain…
codewhale-hq/Codewhale
Decides how verified work should reach main, directly, in a worktree or on an integration branch, while keeping contributor credit and respecting merge gates.
jtenniswood/espcontrol
Clean up completed Git branches and worktrees for this repository both locally and on GitHub.
nyldn/claude-octopus
Quick execution for ad-hoc tasks without full workflow overhead — use for small, self-contained requests
nyldn/claude-octopus
Thorough research across multiple sources — use for complex topics needing broad synthesis
nyldn/claude-octopus
OWASP compliance, vulnerability scanning, and adversarial red team testing — use for security reviews
nyldn/claude-octopus
Audit codebases for quality, consistency, and broken patterns — use for pre-release or tech debt review
nyldn/claude-octopus
Extract patterns and anatomy from URLs — use to reverse-engineer content strategies from live pages
nyldn/claude-octopus
Auto-detect work context (Dev vs Knowledge) — use to tailor workflows based on current task type
Categories
Wrap up a branch — run tests, create PR, merge or discard — use when implementation is done. Skill Finish Branch is an agent skill from nyldn/claude-octopus.
Skill Finish Branch fits situations like: implementation is done; tasks that involve Pull requests; tasks that involve Git worktrees.
Run `npx skills add nyldn/claude-octopus --skill skill-finish-branch -a claude-code`. Or copy the skill folder (skills/skill-finish-branch in nyldn/claude-octopus) into .claude/skills/skill-finish-branch in your project. Claude Code loads it when a task matches its description.
Run `npx skills add nyldn/claude-octopus --skill skill-finish-branch -a codex`. Or copy the skill folder (skills/skill-finish-branch in nyldn/claude-octopus) into .agents/skills/skill-finish-branch in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nyldn/claude-octopus --skill skill-finish-branch -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/skill-finish-branch, .gemini/skills/skill-finish-branch, .github/skills/skill-finish-branch and .opencode/skills/skill-finish-branch in your project.
Going by SKILL.md and its folder, Skill Finish Branch needs the command-line tools its instructions call (git, gh and npm).
SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Skill Finish Branch is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.5k tokens (SKILL.md is roughly 9.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Skill Finish Branch: Finishing a Development Branch (obra/superpowers, 297k stars), Pre-Release PR Triage (jamiepine/voicebox, 57k stars), Cap Feature Building Workflow (CapSoftware/Cap, 23k stars) and Om Auto Fix Issue (go-musicfox/go-musicfox, 2.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
nyldn (a GitHub user) maintains it in nyldn/claude-octopus, which has 4,200 GitHub stars. The repository holds 62 skills in this directory. The repository was last updated on October 11, 2026.
Source: nyldn/claude-octopus on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.