P

Power Finish

Enterprise-grade command for complete, merge, current, flow. Includes structured workflows, validation checks, and reusable patterns for git.

CommandClipticsgitv1.0.0MIT
0 views0 copies

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

AspectDetails
Feature FinishMerges into develop, deletes feature branch
Release FinishMerges into main AND develop, creates version tag
Hotfix FinishMerges into main AND develop, creates patch tag
Merge StyleAlways uses --no-ff to preserve branch history in the graph
SafetyRuns 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

ParameterTypeDefaultDescription
branchstring(current)The Git Flow branch to finish
tagstringautoVersion tag for release and hotfix finishes
delete-remotebooleantrueDelete the remote branch after merging
run-testsbooleantrueRun test suite before allowing merge
pushbooleantruePush target branches and tags to origin after merge

Best Practices

  1. 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.

  2. Use semantic version tags - For release and hotfix branches follow semver conventions. Release branches get minor version bumps and hotfix branches get patch bumps.

  3. 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.

  4. 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

  1. 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.

  2. 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.

  3. 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 run git push origin --delete v1.2.0 before retrying the finish operation.

  4. 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.

  5. 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.

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates