agentsclimarketplace

Skill finish branch

Skill Moliboy5000/.claude/plugins/cache/nyldn-plugins/octo/9.30.0/skills/skill-finish-branch

Claude dotfile containing skills, agents etc I use.

Install
npx -y skills add Moliboy5000/.claude --skill skill-finish-branch

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Wrap up a branch β€” run tests, create PR, merge or discard β€” use when implementation is done. Use when: AUTOMATICALLY ACTIVATE when user requests task completion with git operations:. "commit and push" or "git commit and push". "complete all tasks and commit and push"

SKILL.md

6.3 KB, ~1.6k tokens by cl100k_base, as published. Nobody here has run it

Finishing a Development Branch

Your first output line MUST be: πŸ™ **CLAUDE OCTOPUS ACTIVATED** - Branch Completion

Overview

Guide completion of development work with clear options and safe execution.

Core principle: Verify tests β†’ Present options β†’ Execute choice β†’ Clean up.


The Process

Step 1: Verify Tests Pass

Before presenting options, verify tests pass:

# Run project's test suite
npm test        # JavaScript/TypeScript
pytest          # Python
cargo test      # Rust
go test ./...   # Go

If tests fail:

❌ Tests failing (N failures). Must fix before completing:

[Show failures]

Cannot proceed with merge/PR until tests pass.

STOP. Do not proceed to Step 2.

If tests pass: Continue to Step 2.


Step 2: Determine Base Branch

# Identify the base branch
git merge-base HEAD main 2>/dev/null || \
git merge-base HEAD master 2>/dev/null || \
git merge-base HEAD develop 2>/dev/null

If unclear, ask: "This branch split from main - is that correct?"


Step 3: Present Options

Present exactly these 4 options:

βœ… Implementation complete. Tests passing. What would you like to do?

1. **Merge locally** - Merge back to <base-branch> on this machine
2. **Create PR** - Push and create a Pull Request for review
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.


Step 4: Execute Choice

Option 1: Merge Locally

# 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_BRANCH

Report:

βœ… 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

Option 2: Create PR

# Get branch info
FEATURE_BRANCH=$(git branch --show-current)

# Push branch
git push -u origin $FEATURE_BRANCH

# Create PR with description
gh pr create \
  --title "feat: [description]" \
  --body "$(cat <<'EOF'
## Summary
- [What changed]
- [Why it changed]

## Test Plan
- [x] Unit tests pass
- [x] Manual verification done
- [ ] Code review needed
EOF
)"

Report:

βœ… Branch pushed to origin/$FEATURE_BRANCH
βœ… PR created: https://github.com/owner/repo/pull/123

Branch preserved for review process.

Option 3: Keep As-Is

βœ… 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_BRANCH

Do NOT clean up anything.


Option 4: Discard

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 || true

Report:

βœ… Branch $FEATURE_BRANCH deleted locally
βœ… Remote branch deleted (if existed)

Work has been permanently discarded.

Step 5: Cleanup (If Using Worktrees)

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"
fi

For Option 3: Keep worktree intact.


Quick Reference

OptionMergePushKeep BranchCleanup
1. Merge locallyβœ“-Deleteβœ“
2. Create PR-βœ“Keep-
3. Keep as-is--Keep-
4. Discard--Deleteβœ“

Integration with Claude Octopus

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)

With Octopus Validation

# Run octopus validation before finishing
${HOME}/.claude-octopus/plugin/scripts/orchestrate.sh ink "Validate before merge"

# If validation passes, proceed with finishing-branch

Red Flags - Never Do

ActionWhy It's Dangerous
Merge without testingShips broken code
Skip confirmation for discardLoses work permanently
Force-push without askingDestroys history
Delete remote branch silentlyAffects collaborators
Proceed when tests failCorrupts main branch

Common Mistakes

MistakeFix
Offering options before testingAlways verify tests FIRST
Auto-merging without askingPresent 4 options, let user choose
Deleting without confirmationRequire typed "discard"
Cleaning up worktree on "keep"Only cleanup for options 1, 2, 4

The Bottom Line

Finishing branch β†’ Tests verified AND user chose option
Otherwise β†’ Not complete

Verify tests. Present options. Execute safely. Clean up appropriately.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Gives 1 of the 12 instructions most pr commit review skills give in ~1.6k tokens

Counted across 888 of the 1,342 authors here whose files we hold, read 2026-08-07

  • Use conventional commits formatin 127 of 888, across 115 files
  • Keep subject line under 72 charactersin 62 of 888, across 48 files
  • Delete branches after mergein 51 of 888, across 38 files
  • Use imperative mood in subject linein 51 of 888, across 42 files
  • Use imperative mood in commit messagesin 44 of 888
  • Verify directory is ignored before creating worktreein 43 of 888, across 12 files
  • Generate a conventional commit messagein 43 of 888
  • Add unignored worktree directories to gitignorein 42 of 888, across 10 files
  • Make atomic commitsin 39 of 888, across 27 files
  • Run tests before committinghere, and in 36 of 888, across 25 files
  • Verify clean test baselinein 35 of 888, across 9 files
  • Split unrelated changes into separate commitsin 35 of 888, across 30 files

Said here and by no other author read

  • output activation header first
  • ask user to choose from four options
  • do not clean up branch if kept

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.