wt-finish
Finish a feature by merging it to the base branch and cleaning up the worktree. Use when completing a feature or story, handles merge, push, and cleanup automatically.
When & Why to Use This Skill
The wt-finish skill is a powerful Git automation utility designed to streamline the end-of-feature development cycle. It automates the complex process of merging feature branches into a base branch, pushing updates to remote repositories, and performing essential environment cleanup, including the removal of Git worktrees and local branches. By integrating safety checks like state verification and optional test execution, it ensures a reliable, error-free transition from development to integration.
Use Cases
- Feature Completion: Automatically merge a finished task or story into the main branch while ensuring the working directory is clean and all changes are pushed.
- Worktree Management: Efficiently clean up local development environments by removing temporary Git worktrees and deleting merged feature branches to save disk space and reduce clutter.
- Safe Deployment Prep: Use the guided workflow to run pre-merge tests and verify code integrity before finalizing a pull request or merging into a production-ready branch.
- Workflow Standardization: Provide a consistent, interactive process for team members to follow when closing out development tasks, reducing manual errors in the Git lifecycle.
| name | wt-finish |
|---|---|
| description | Finish a feature by merging it to the base branch and cleaning up the worktree. Use when completing a feature or story, handles merge, push, and cleanup automatically. |
/wt:finish - Finish Feature and Merge
Description
Quick command to finish a feature, merge it back to the base branch, and clean up the worktree.
Usage
/wt:finish
What It Does
This slash command:
- Activates the Git Worktree Manager skill (
@git-worktree) - Automatically runs the
*finish-featurecommand - Guides you through merging and cleanup
Workflow
The command will:
- Verify clean state - Ensure all changes are committed
- Ask for base branch - Which branch to merge into (e.g.,
main) - Run tests - Optional: run tests before merging
- Checkout base branch - Switch to the target branch
- Merge feature - Merge your feature branch
- Push changes - Push the merged changes
- Remove worktree - Clean up the feature worktree
- Delete branch - Optionally delete the feature branch
Benefits
✅ Complete Workflow - Handles entire merge process ✅ Safe Merging - Verifies tests and clean state ✅ Automatic Cleanup - Removes worktree and branch ✅ Guided Process - Interactive prompts for all steps
Notes
- Ensures all changes are committed before merging
- Optionally runs tests before merging
- Cleans up both worktree and branch
- Returns you to the base branch