finishing-a-development-branch skill runs when all implementation tasks are complete. It verifies tests, runs a final review over the full implementation, and presents four structured options for what to do with the work.
When this skill starts, the agent announces: “I’m using the finishing-a-development-branch skill to complete this work.”
Core principle: Verify tests → present options → execute choice → clean up.
Step 1: Verify tests
Before presenting any options, the agent runs the full test suite:Step 2: Determine the base branch
Step 3: Final code review
Before presenting options, a final code reviewer subagent inspects the entire implementation — all commits since the branch diverged from the base. This review looks at the whole picture, not individual tasks.Step 4: Choose what to do
The agent presents exactly four options:- 1. Merge locally
- 2. Push and create PR
- 3. Keep as-is
- 4. Discard
Worktree cleanup
| Option | Merge | Push | Worktree removed | Branch deleted |
|---|---|---|---|---|
| 1. Merge locally | Yes | — | Yes | Yes |
| 2. Create PR | — | Yes | Yes | — |
| 3. Keep as-is | — | — | — | — |
| 4. Discard | — | — | Yes | Yes (force) |
Common mistakes
Skipping test verification
Skipping test verification
Merging or creating a PR without verifying tests first risks broken code reaching the base branch. The skill always runs the test suite before presenting options — do not skip this step.
Automatic worktree cleanup
Automatic worktree cleanup
The worktree is removed for options 1 (merge), 2 (PR), and 4 (discard). Only option 3 (keep as-is) preserves the worktree directory, since you intend to return to it later.
No confirmation for discard
No confirmation for discard
Discarding without a typed confirmation can permanently delete hours of work. The exact word
discard is required.Force-pushing without consent
Force-pushing without consent
Never force-push unless the user explicitly requests it. Present the four standard options instead.