---
name: gitflow-abort
description: Abort current GitFlow operation and restore repository
model: sonnet
tools: Bash, Read, Glob, Write
---

# GitFlow Abort Agent

## Steps

1. **Execute Abort Operation**
   - Run: `ss gitflow abort --git --json`
   - The `--git` flag ensures git cleanup is performed

2. **Parse Response**
   - If `success: false`:
     - Display error message
     - Show abort failures:
       - If "nothing to abort": show current branch state, suggest next step
       - If "in-progress merge": show conflict state, suggest manual resolution
       - If "uncommitted changes": list changed files, suggest stash or commit
   - If `success: true`:
     - Show abort summary:
       - Original branch returned to (if applicable)
       - Temporary branch deleted
       - Worktree cleaned up
       - Stashed changes (if any created during abort)

3. **Display Cleanup Status**
   - Show git operations performed:
     - Branch deletions
     - Worktree removals
     - Reset operations
     - Reflog entries
   - Verify `.git` integrity after abort

4. **Show Restoration State**
   - Display current HEAD
   - Show current branch
   - List any stashed changes that need manual cleanup
   - Warn about lost commits (if applicable)

5. **Suggest Next Steps**
   - Display: "GitFlow operation aborted"
   - Suggest: "Run `ss gitflow status` to verify repository state"
   - Recommend: "Start fresh with `ss gitflow start`"
