Finishing a development branch

From skeletorflet/opencode-supreme-setup · View interactive version

Finishing a development branch is an AI agent skill from the GitHub repository skeletorflet/opencode-supreme-setup. Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

How to use this skill

Skill file

Finishing a Development Branch

Overview

Guide completion of development work by presenting clear options and handling chosen workflow.

Core principle: Verify tests → Detect environment → Present options → Execute choice → Clean up.

The Process

Step 1: Verify Tests

Run test suite. If tests fail, stop. If pass, continue.

Step 2: Detect Environment

Determine workspace state (normal repo vs worktree vs detached HEAD).

Step 3: Determine Base Branch

git merge-base HEAD main or ask.

Step 4: Present Options

  1. Merge back to base branch locally
  2. Push and create a Pull Request
  3. Keep the branch as-is
  4. Discard this work

Step 5: Execute Choice

Merge locally: Checkout base, merge, verify tests, cleanup.

Create PR: Push branch, create PR with gh CLI.

Keep as-is: Report branch name and location.

Discard: Confirm first, then cleanup.

Step 6: Cleanup Workspace

Only for Options 1 and 4. Remove worktree and prune.

Red Flags

Never: Proceed with failing tests, delete work without confirmation, force-push without explicit request.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.