finishing-a-development-branch
FeaturedUse when implementation is complete, all tests pass, and you need to decide how to integrate the work
AI & Automation 2,881 stars
365 forks Updated today Apache-2.0
Install
Quality Score: 92/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Finishing a Development Branch
## Overview
**Core principle:** Verify tests → Detect environment → Present options → Execute choice → Clean up.
**Announce at start:** "I'm using the finishing-a-development-branch skill to complete this work."
## Step 1: Verify Tests
Run the project's full test suite (`npm test` / `cargo test` / `pytest` / `go test ./...`).
**If tests fail**, report the failures and stop — the menu comes after a green suite:
```
Tests failing (<N> failures). Must fix before completing:
[Show failures]
```
**If tests pass:** continue to Step 2.
## Step 2: Detect Environment
```bash
GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
# Capture now, while still inside the workspace — Step 5 changes directory
# before cleanup (Step 6) needs this value
WORKTREE_PATH=$(git rev-parse --show-toplevel)
```
This determines which menu to show and how cleanup works:
| State | Menu | Cleanup |
|-------|------|---------|
| `GIT_DIR == GIT_COMMON` (normal repo) | Standard 3 options | No worktree to clean up |
| `GIT_DIR != GIT_COMMON`, named branch | Standard 3 options | Provenance-based (see Step 6) |
| `GIT_DIR != GIT_COMMON`, detached HEAD | Reduced 2 options (no merge) | Externally managed — leave in place |
## Step 3: Determine Base Branch
The base branch is whatever this work forked from — usually named in the
plan, the conversation, or the branch's upstream. If it ...
Details
- Author
- xintaofei
- Repository
- xintaofei/codeg
- Created
- 6 months ago
- Last Updated
- today
- Language
- Rust
- License
- Apache-2.0
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
finishing-a-development-branch
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
1 Updated today
0xrizz AI & Automation Listed
finishing-a-development-branch
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
0 Updated today
SohailKhan0525 AI & Automation Listed
finishing-a-development-branch
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
2 Updated 2 weeks ago
imMamdouhaboammar