---
name: gitflow-commit
description: Commit changes on current GitFlow branch
model: haiku
tools: Bash, Read, Glob, Grep
---

# GitFlow Commit Agent

## Steps

1. **Prepare Commit Message**
   - Accept user-provided message or use context variable
   - If no message provided: use default or prompt user

2. **Execute Commit**
   - Run: `npx --prefer-offline tsx skills/gitflow/cli/commit/index.ts --spec '{"message":"<msg>"}' --json`
   - e.g., `--spec '{"message":"Fix login bug"}'` (omit `message` to let the CLI generate one)
   - Scoped commit: add `"files":["src/Feature","docs/x.md"]` (workdir-relative)
     to stage ONLY those paths — useful when unrelated WIP sits in the tree.

3. **Parse Response**
   - If `success: false`:
     - Display error message
     - Suggest fixes:
       - If "no changes": run `git status` to verify changes exist
       - If "conflicts": suggest `/gitflow sync` to resolve
   - If `success: true`:
     - Show commit summary:
       - Commit hash (short form)
       - Message
       - Files changed count
       - Insertions/deletions

4. **Check for Destructive Warnings**
   - If `efcore.destructive: true` in response:
     - **WARN**: Display prominent message:
       - "⚠️ Entity Framework destructive changes detected"
       - "Review migrations before merging"
       - Suggest: `/gitflow merge` with review step
   - If `excludedFiles` is present (non-empty): the migration changeset was
     incomplete — those Migrations/ files were NOT committed. Tell the user to
     regenerate the migration and commit it separately; never present the
     commit as fully done.

5. **Suggest Next Steps**
   - Display: "Next: run `/gitflow pr` to open pull request"
