--- name: finishing-a-development-branch description: Use when implementation is complete and all tests pass - verifies and creates PR --- # Finishing a Development Branch ## Overview Verify tests pass, then push and create PR. **Core principle:** Verify tests → Create PR → Done. **Announce at start:** "I'm using the finishing-a-development-branch skill to complete this work." ## The Process ### Step 1: Verify Tests **Before creating PR, verify tests pass:** ```bash # Run project's test suite npm test / cargo test / pytest / go test ./... / mvn test ``` **If tests fail:** ``` Tests failing ( failures). Must fix before completing: [Show failures] Cannot proceed with PR until tests pass. ``` Stop. Fix tests first. **If tests pass:** Continue to Step 2. ### Step 2: Push and Create PR Use the `/pr create` command which will: 1. **Check for existing PR first** - avoids duplicates 2. If PR exists: Report existing PR URL and skip 3. If no PR: Analyze commits, generate title/description, push, create PR ```bash /pr create ``` **Duplicate prevention:** The `/pr create` command checks for existing open PRs on the current branch before creating a new one. Report the PR URL when complete (whether existing or newly created). ### Step 3: Cleanup Worktree (if applicable) Check if working in a worktree: ```bash git worktree list | grep $(git branch --show-current) ``` If yes, ask user: ``` Worktree at . Remove it now? (y/n) ``` If confirmed: ```bash git worktree remove ``` ## Quick Reference ``` Tests Pass? ↓ yes /pr create ↓ PR URL returned ↓ Cleanup worktree (optional) ↓ Done ``` ## Red Flags **Never:** - Create PR with failing tests - Skip test verification - Force-push without explicit request **Always:** - Verify tests before creating PR - Use `/pr create` for consistent PR format - Report the PR URL ## Integration **Called by:** - **executing-plans** (Step 6) - After all batches complete **Uses:** - **/pr create** - For pushing and PR creation