Skip to main content
The 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:
If tests fail, the agent reports the failures and stops:
The agent does not present completion options until tests pass.

Step 2: Determine the base branch

If the base branch is ambiguous, the agent asks.

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:
Tests are verified again on the merged result. The worktree is cleaned up after the merge.

Worktree cleanup

For options 1, 2, and 4, the agent removes the physical worktree directory:
For option 3 (keep as-is), the worktree is preserved so you can return to it later.

Common mistakes

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.
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.
Discarding without a typed confirmation can permanently delete hours of work. The exact word discard is required.