Power Finish
Enterprise-grade command for complete, merge, current, flow. Includes structured workflows, validation checks, and reusable patterns for git.
Power Finish
Complete and merge the current Git Flow branch back into its target with proper cleanup.
When to Use This Command
Run this command when you need to:
- Merge a completed feature branch back into develop with a clean merge commit
- Finish a release branch by merging into both main and develop then tagging
- Close out a hotfix branch with proper merges to main and develop plus version tag
Consider alternatives when:
- You want to squash all commits into one before merging which requires interactive rebase first
- The branch has unresolved conflicts that need manual intervention before finishing
Quick Start
Configuration
name: power-finish type: command category: git
Example Invocation
claude command:run power-finish --branch feature/user-dashboard-widgets
Example Output
Finishing branch: feature/user-dashboard-widgets
Branch type: feature
Target: develop
Pre-merge checks:
Working tree: clean
Tests: passing (42 passed, 0 failed)
Up to date with develop: yes
Merging feature/user-dashboard-widgets into develop...
Merge commit: m9f3b21
Merge strategy: --no-ff
Cleanup:
Deleted local branch: feature/user-dashboard-widgets
Deleted remote branch: origin/feature/user-dashboard-widgets
Finish complete. Develop updated.
Core Concepts
Branch Finish Strategies Overview
| Aspect | Details |
|---|---|
| Feature Finish | Merges into develop, deletes feature branch |
| Release Finish | Merges into main AND develop, creates version tag |
| Hotfix Finish | Merges into main AND develop, creates patch tag |
| Merge Style | Always uses --no-ff to preserve branch history in the graph |
| Safety | Runs tests and checks for clean working tree before merge |
Finish Workflow
Feature: feature/* --merge--> develop
|
Release: release/* --merge--> develop
\--merge--> main --tag--> v1.2.0
|
Hotfix: hotfix/* --merge--> develop
\--merge--> main --tag--> v1.2.1
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
| branch | string | (current) | The Git Flow branch to finish |
| tag | string | auto | Version tag for release and hotfix finishes |
| delete-remote | boolean | true | Delete the remote branch after merging |
| run-tests | boolean | true | Run test suite before allowing merge |
| push | boolean | true | Push target branches and tags to origin after merge |
Best Practices
-
Always run tests before finishing - The default behavior runs your test suite before merge. Never disable this for release or hotfix branches as these go directly to production.
-
Use semantic version tags - For release and hotfix branches follow semver conventions. Release branches get minor version bumps and hotfix branches get patch bumps.
-
Review the merge diff one last time - Before confirming the finish, review the aggregate diff to catch any debug code, console logs, or TODO comments that should not land in the target branch.
-
Coordinate with your team - If others have been working on the same branch, ensure all their changes are pushed and merged before finishing to avoid losing work.
Common Issues
-
Merge conflicts during finish - Resolve conflicts manually then re-run the finish command. The command detects an in-progress merge and picks up where it left off.
-
Tests fail during pre-merge check - Fix the failing tests on the feature branch first. Do not skip the test check as broken code merged to develop affects the entire team.
-
Tag already exists - If the version tag already exists the finish aborts. Either increment the version or delete the existing tag if it was created in error with
git tag -d v1.2.0. If the tag was already pushed to the remote, you also need to rungit push origin --delete v1.2.0before retrying the finish operation. -
Remote branch already deleted by another developer - If someone else already deleted the remote feature branch, the cleanup step reports a warning but the merge itself succeeds. This is harmless and can be safely ignored in the finish output summary.
-
Merge produces a very large diff - Long-lived feature branches accumulate significant drift from the target branch. Before finishing, rebase the feature branch onto the latest develop to reduce the merge diff size and make the final merge commit cleaner.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.