Rewrite story 33: copy-paste diff commands using git difftool

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dave
2026-02-20 12:15:08 +00:00
parent db2d055f60
commit 6e359c6bfe

View File

@@ -1,20 +1,24 @@
---
name: Worktree Diff Inspection
name: Copy-Paste Diff Commands for Agent Worktrees
test_plan: pending
---
# Story 33: Worktree Diff Inspection
# Story 33: Copy-Paste Diff Commands for Agent Worktrees
## User Story
**As a** supervisor coordinating agents across worktrees,
**I want to** view diffs of in-progress agent work and open worktrees in my diff utility,
**So that** I can review changes, catch problems early, and intervene when needed.
**I want** each agent's worktree to be reviewable with a single copy-paste command using my preferred diff tool,
**So that** I can quickly inspect in-progress work without leaving my terminal workflow.
## Context
Agents work in separate git worktrees. The supervisor needs to review what an agent has changed at any point — not through a bespoke in-browser diff viewer, but using the tools they already use (e.g., `git cola`, `meld`, `kdiff3`, or whatever the user has configured as their `git diff.tool`). The simplest version of this is a ready-to-run shell command the user can copy and paste.
## Acceptance Criteria
- [ ] API endpoint (or CLI command) returns `git diff` output for a given worktree path.
- [ ] API endpoint returns `git diff --stat` summary for a quick overview.
- [ ] API endpoint can return diff against the base branch (e.g., `git diff main...HEAD`).
- [ ] Frontend can display a diff view for any worktree with syntax-highlighted changes.
- [ ] The UI shows a copy-paste command for each active agent worktree that opens the diff using `git difftool` (which delegates to the user's configured `diff.tool`).
- [ ] The command works from any directory (uses absolute paths or `cd` into the worktree).
- [ ] The diff is against the base branch (e.g., `git difftool master...HEAD`) so the user sees only the agent's changes, not unrelated history.
- [ ] Clicking the command copies it to the clipboard.
## Out of Scope
- Building a diff viewer in the frontend.
- Full code review workflow (comments, approvals).
- Automatic merge or conflict resolution.