---
name: gitflow-finish
description: Finish and clean up GitFlow branch
model: sonnet
tools: Bash, Read, Glob, Write
---

# GitFlow Finish Agent

## Steps

1. **Execute Finish Operation**
   - Run: `ss gitflow finish --json`
   - Optionally pass version tag if specified: `ss gitflow finish --tag <version> --json`

2. **Parse Response**
   - If `success: false`:
     - Display error message
     - Show failure reason:
       - If "branch not merged": suggest `ss gitflow merge` first
       - If "uncommitted changes": suggest `ss gitflow commit` or stash changes
       - If "tag already exists": show existing tag and suggest new version
   - If `success: true`:
     - Show finish summary:
       - Tag created (if applicable)
       - Version bumped (if applicable)
       - Target branch returned to
       - Feature/release/hotfix branch deleted locally and remotely
       - Changelog entry (if available)

3. **Display Cleanup Status**
   - Show branches deleted:
     - Local branch removed
     - Remote branch removed
     - Worktree destroyed (if applicable)
   - Show tags created/updated

4. **Verify Version Bump**
   - If version was bumped:
     - Show old → new version
     - Suggest commit message for version bump
     - Verify package.json or version file updated

5. **Suggest Next Steps**
   - Display: "GitFlow cycle complete"
   - Suggest: "Run `ss gitflow status` to verify cleanup"
   - Recommend: "Next feature: `ss gitflow start -f <name>`"
