askill
finishing-a-development-branch

finishing-a-development-branchSafety 88Repository

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup. Presents exactly 4 options: merge locally, create PR, keep as-is, or discard. Do NOT use when tests are failing or work is incomplete - fix issues first before finishing the branch.

4 stars
1.2k downloads
Updated 2/22/2026

Package Files

Loading files...
SKILL.md

Finishing a Development Branch

Overview

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

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

Announce at start: "I'm using the finishing-a-development-branch skill to complete this work."

The Process

Step 1: Verify Tests

Before presenting options, run project test suite:

npm test / cargo test / pytest / go test ./...

If tests fail: Show failures and stop. Cannot proceed until tests pass.

If tests pass: Continue to Step 2.

Step 2: Determine Base Branch

git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null

Or ask: "This branch split from main - is that correct?"

Step 3: Present Options

ALWAYS use AskUserQuestion - never present plain text numbered options:

Use AskUserQuestion tool with:
- question: "Implementation complete. What would you like to do?"
- header: "Complete"
- options:
  - label: "Merge locally"
    description: "Merge back to <base-branch> and clean up"
  - label: "Create PR"
    description: "Push and create a Pull Request for review"
  - label: "Keep as-is"
    description: "Keep the branch, I'll handle it later"
  - label: "Discard"
    description: "Delete this work permanently"
- multiSelect: false

Step 4: Execute Choice

See examples/merge-workflow.md for detailed implementation of each option.

OptionActions
Merge locallySwitch to base → Pull → Merge → Test → Delete branch → Cleanup worktree
Create PRPush branch → Create PR with gh → Cleanup worktree
Keep as-isReport preservation → Keep worktree
DiscardConfirm → Delete branch (force) → Cleanup worktree

Worktree cleanup (Options 1, 2, 4 only):

git worktree list | grep $(git branch --show-current)
git worktree remove <worktree-path>  # if found

Step 5: Issue Close & Continue

Only when invoked via /popkit:dev work #N - skip for standalone use.

5a: Close Prompt

After merge (Option 1) or PR (Option 2):

Use AskUserQuestion tool with:
- question: "Work on issue #N complete. Close the issue?"
- header: "Close Issue"
- options:
  - label: "Yes, close it"
    description: "Mark issue as completed"
  - label: "No, keep open"
    description: "Issue needs more work or follow-up"

If "Yes": gh issue close <number> --comment "Completed via /popkit:dev work #<number>"

5b: Epic Parent Check

Check for parent epic reference in issue body:

gh issue view <number> --json body --jq '.body' | grep -oE '(Part of|Parent:?) #[0-9]+'

If all children closed → Prompt to close epic.

5c: Context-Aware Next Actions

See examples/next-action-example.md for detailed flow.

Generate dynamic options by fetching prioritized issues, sorting by priority/phase, and presenting top 3 + "session capture and exit".

Quick Reference

OptionMergePushKeep WorktreeCleanup BranchClose Prompt
Merge locally--✓ (if issue)
Create PR--✓ (if issue)
Keep as-is----
Discard---✓ (force)-

Red Flags

Never:

  • Proceed with failing tests
  • Merge without verifying tests on result
  • Delete work without confirmation
  • Force-push without explicit request

Always:

  • Verify tests before offering options
  • Present exactly 4 options via AskUserQuestion
  • Get typed "discard" confirmation for Option 4
  • Clean up worktree for Options 1 & 4 only

Integration

Called by:

  • subagent-driven-development (Step 7) - After all tasks complete
  • executing-plans (Step 5) - After all batches complete

Pairs with:

  • using-git-worktrees - Cleans up worktree created by that skill

Skipping test verification

  • Problem: Merge broken code, create failing PR
  • Fix: Always verify tests before offering options

Open-ended questions

  • Problem: "What should I do next?" → ambiguous
  • Fix: Present exactly 4 structured options

Automatic worktree cleanup

  • Problem: Remove worktree when might need it (Option 2, 3)
  • Fix: Only cleanup for Options 1 and 4

No confirmation for discard

  • Problem: Accidentally delete work
  • Fix: Require typed "discard" confirmation

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

82/100Analyzed 2/23/2026

Well-structured and comprehensive skill for finishing development branches with clear workflow steps, decision trees, and safety checks. Includes detailed process documentation, quick reference tables, and red flags. Uses project-specific agents and tools, reducing cross-project reusability. Score benefits from clear usage guidance (R3), structured steps (R5), tags (R6), proper skills folder location (R10), and high-density technical content (R11)."

88
90
65
92
92

Metadata

Licenseunknown
Version-
Updated2/22/2026
Publisherjrc1883

Tags

github-actionspromptingtesting