# Branch Completion

> Guides completion of development work by verifying tests, presenting merge/PR/keep/discard options, and executing cleanup. Use this skill when implementation is complete and tests pass, when wrapping up a feature branch, or when deciding how to land or discard work. Do not use when/for mid-implementation commits, opening a PR before verification-before-completion, or starting work (use git-worktrees).

- Skill: `jagreehal/branch-completion` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add jagreehal/branch-completion`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jagreehal/branch-completion/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: jagreehal (https://skillmd.com/u/jagreehal)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/jagreehal/branch-completion

---


# 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](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](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`.

