jagreehal avatar

branch-completion

Use when implementation is complete and tests pass. Guides completion by presenting structured optio

by jagreehal|Open Source

Branch Completion

Critical rules

  • No completion options while tests fail. Tests are the gate.
  • Present exactly four options: merge locally, open PR, keep as-is, discard.
  • Never delete work without exact typed confirmation (discard).
  • Never force-push without an explicit request.
  • Option 1: re-test after merge. Option 3: keep the worktree.
  • Before executing a choice, read references/options.md.

Workflow

  1. Run the project test suite. On failure: show failures, stop — do not present options.
  2. Present the four structured options (see options reference).
  3. Execute the chosen option per the reference (merge / PR / keep / discard).
  4. Cleanup: remove worktree for options 1 and 4; keep for 2 and 3. Option 2 keeps worktree for PR iteration.

Resources

  • references/options.md — option commands, cleanup table, presentation template. Read before executing a choice.

Validation

Before options:

  • Suite run and passing

After choice:

  • Option 1: merged result re-tested; branch and worktree removed
  • Option 2: pushed, PR created, URL reported, worktree kept
  • Option 3: branch and worktree preserved, location reported
  • Option 4: exact discard confirmation before deletion; worktree removed

Constraints

  • Not for mid-implementation or unverified work.
  • Related: verification-before-completion, git-worktrees, implementation-planning.