finishing-a-development-branchlisted
Install: claude install-skill izyanrajwani/agent-skills-library
# Finishing a Development Branch
## The Process
### Step 1: Verify Tests
Determine test runner from project structure:
- `package.json` → `npm test` or `yarn test`
- `Cargo.toml` → `cargo test`
- `pyproject.toml` / `setup.py` → `pytest`
- `go.mod` → `go test ./...`
- `Makefile` with `test` target → `make test`
Run tests. If any fail, report `⊘ BLOCKED:TESTS` with failure count and stop. Do not proceed to Step 2.
### Step 2: Determine Base Branch
Find the branch this feature diverged from:
```bash
# Check which branch has the closest merge-base
for candidate in main master develop; do
if git rev-parse --verify "$candidate" >/dev/null 2>&1; then
MERGE_BASE=$(git merge-base HEAD "$candidate" 2>/dev/null)
if [ -n "$MERGE_BASE" ]; then
echo "Candidate: $candidate (merge-base: $MERGE_BASE)"
fi
fi
done
```
Select the candidate with the most recent merge-base (closest ancestor). If multiple branches share the same merge-base or detection is ambiguous, ask: "This branch could target `main` or `develop`. Which should it merge into?"
**Store the result** - subsequent steps reference `<base-branch>` meaning this determined value.
### Step 3: Present Options
Present exactly these 4 options:
```
Implementation complete. What would you like to do?
1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work
Which option?
```
### Step 4: Execute Choice
#### Option 1: Merge L