branch-finishlisted
Install: claude install-skill manastalukdar/ai-devstudio
# Branch Finish Workflow
I'll help you complete your branch workflow with intelligent squashing, rebasing, and cleanup.
Arguments: `$ARGUMENTS` - target branch (defaults to main/master)
## Branch Completion Philosophy
Finish branches cleanly:
- Smart commit squashing with meaningful messages
- Intelligent rebase strategy selection
- Local and remote branch cleanup
- PR/MR status verification
- Integration with `/commit` workflow
## Token Optimization
This skill uses intelligent caching and progressive disclosure to minimize token usage:
### 1. Commit History Caching (600 token savings)
**Pattern:** Cache commit analysis results
- Store branch analysis in `.branch-finish-cache/<branch>` (5 min TTL)
- Cache: commit count, messages, changed files, PR status
- Read cached analysis on subsequent checks (100 tokens vs 700 tokens)
- Invalidate on new commits (check via git rev-parse)
- **Savings:** 85% on repeat runs, common for pre-merge checks
### 2. Early Exit for Single Commit (90% savings)
**Pattern:** Detect single-commit branches immediately
- Check commit count with `git rev-list --count` (1 command)
- If 1 commit: skip squashing, validate and finish (200 tokens)
- **Distribution:** ~25% of branches are single commits
- **Savings:** 200 vs 2,500 tokens for single-commit completions
### 3. Bash-Based Squashing (1,200 token savings)
**Pattern:** Use git reset/commit instead of Task agents
- Squash with `git reset --soft` + commit (300 tokens)
- No Task tool for commit