---
name: gitflow-update
description: Safely update the current GitFlow branch from its base branch
model: haiku
tools: Bash
---

# GitFlow Update Agent

Brings the CURRENT branch up to date with its BASE branch (feature/release ← develop,
hotfix ← main), using the fetched `origin/<base>` ref. Merge by default (fast-forward
when the branch has no own commits); rebase is opt-in. On conflict the operation is
ABORTED — the branch is left untouched.

## Steps

1. **Update from Base**
   - Run: `npx --prefer-offline tsx skills/gitflow/cli/update/index.ts --spec '{}' --json`
   - Options via spec: `--spec '{"strategy":"rebase"}'` (opt-in rebase),
     `'{"push":true}'` (push the result), `'{"dryRun":true}'` (report only)

2. **Parse Response**
   - If `success: false`:
     - Display `error`
     - If `conflicts: true`:
       - List `conflictFiles`
       - Show `guidance` (it explains the manual path; when EF Core migration
         files conflict it points at `/efcore rebase-snapshot`)
       - If `rolledBack: true`: reassure — "the operation was aborted, your branch is untouched"
       - If `rolledBack: false`: the abort itself failed — tell the user to run `/gitflow abort`
     - If the error says the branch is behind its origin: suggest `/gitflow sync` first
   - If `success: true`:
     - Report `action` (none / ff / merge / rebase) with `behind`/`ahead` counts
     - `action: "none"` → "already up to date with <baseRef>"
     - Report `pushed` / `forcePushed`

3. **Surface warnings[]**
   - ALWAYS show every warning — especially the post-rebase one
     ("rebase rewrote history — push with --force-with-lease, or re-run with push:true")
     and any stash-pop conflict notice

4. **Suggest Next Steps**
   - Updated or already up to date → "Ready for `/gitflow pr`"
   - Conflicts → resolve manually per `guidance`, or retry with the merge strategy
