Skip to content

feat(domain): detect uncommitted worktree changes before merge and prompt user to commit #274

@arielshad

Description

@arielshad

Problem

When a feature is in the merge review step, a user may open the worktree in their IDE, make edits, and forget to commit them. When the user clicks "merge" in Shep, those uncommitted changes are silently lost.

Expected Behavior

  1. Before initiating merge, Shep should check the feature's worktree for uncommitted changes (staged or unstaged)
  2. If uncommitted changes exist, prompt the user: "You have uncommitted changes in the worktree. Would you like to commit them before merging?"
  3. If the user says yes, pass a flag to the merge agent to commit those changes before proceeding with the merge
  4. If the user says no, proceed with merge (with a warning that changes will be lost)

Acceptance Criteria

  • Shep detects dirty worktree state (unstaged + staged changes) before merge
  • User is prompted with a clear message listing the uncommitted files
  • On confirmation, the merge agent receives a flag to commit changes first
  • On decline, merge proceeds with a warning
  • Works for both CLI and web UI flows

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions