Complete feature work and merge back to main branch. Use when user wants to finish a feature, close a feature, or merge feature branch. Switches to main, pulls latest changes, merges feature branch, and pushes to remote.
Install
npx skillscat add otrebu/agents/finish-feature Install via the SkillsCat registry.
This skill automates merging a feature branch into the main branch by switching to main, pulling updates, resolving conflicts, and pushing changes. It ensures a clean working directory and user confirmation for deletions. Use it to finalize features, close branches, or integrate work after resolving conflicts.
Finish Feature
Process
1. Verify Current Branch
Run git branch --show-current:
- If main/master: Ask which feature branch to merge
- If feature branch: Confirm this branch
2. Check Working Directory
Run git status:
- Uncommitted changes? Ask: commit or stash?
- Clean? Proceed
3. Store Feature Branch Name
FEATURE_BRANCH=$(git branch --show-current)4. Switch to Main
Determine main branch (git branch --list main master), then:
git checkout main # or master5. Pull Latest
git pull origin main # or master6. Merge Feature Branch
git merge $FEATURE_BRANCHConflicts? List files via git status, wait for user resolution: git add . + git commit
7. Push
git push origin main # or master8. Delete Feature Branch?
Ask user:
Local:
git branch -d $FEATURE_BRANCHRemote:
git push origin --delete $FEATURE_BRANCH9. Confirm Completion
Output:
- Merged branch:
<feature-branch-name> - Push status
- Deletion status (if applicable)
Constraints
- Pull main before merge
- Verify clean working dir before branch switch
- Never force push to main
- User resolves conflicts
- Always ask before deleting branches
Example
User: "Finish user-auth feature"
- On
feature/user-auth,git statusclean git checkout main && git pull origin maingit merge feature/user-auth && git push origin main- Ask: Delete branch? → User confirms
- Output: "Feature 'user-auth' merged to main, pushed, branch deleted"