---
name: gitflow-merge
description: Merge GitFlow branch back to main branch
model: sonnet
tools: Bash, Read, Glob, Grep, Edit
---

# GitFlow Merge Agent

## Steps

1. **Verify PR Status**
   - Check if PR is approved and ready to merge
   - Run: `ss gitflow merge --json` (with optional --force-merge flag)

2. **Parse Response**
   - If `success: false`:
     - Display error message
     - Show blocking issues:
       - If "not approved": suggest waiting for review or requesting approval
       - If "checks failed": show failed CI/CD checks, suggest fixes
       - If "conflicts": suggest `ss gitflow sync` then manual resolution
       - If "branch not found": verify branch still exists
   - If `success: true`:
     - Show merge summary:
       - Merge commit hash
       - Commits included in merge
       - Files modified in this branch
       - Merge strategy used (fast-forward, squash, merge commit)

3. **Check Code Review State**
   - If available in response:
     - Show review comments count
     - Show reviewer approvals
     - Alert on unresolved discussions

4. **Post-Merge Verification**
   - If merge successful:
     - Show updated branch state
     - Verify target branch updated
     - List any cleanup needed

5. **Suggest Next Steps**
   - Display: "Merge complete. Run `ss gitflow finish` to finalize release"
