feat(kugetsu): add git worktree isolation per session #22

Merged
shoko merged 2 commits from feat/issue-19-worktree-per-session into main 2026-03-30 15:58:41 +02:00
Owner

Part of issue #19 Phase 3 implementation

Part of issue #19 Phase 3 implementation
shoko added 2 commits 2026-03-30 15:58:29 +02:00
- Each issue session gets isolated git worktree to prevent workspace conflicts
- Worktree created on 'kugetsu start', removed on 'kugetsu destroy'
- Worktree path: ~/.kugetsu/worktrees/{sanitized-issue-ref}/
- Branch naming: fix/issue-{number} or fix/{identifier}
- Worktree always recreated on start (guaranteed clean state)
- 'kugetsu list' now shows worktree path
- 'kugetsu prune' also cleans orphaned worktrees
- 'kugetsu continue' runs opencode with --workdir pointing to worktree
- Update SKILL.md to v2.2 with worktree documentation

Part of issue #19 Phase 3 implementation
- Fix issue_ref_to_worktree_name: use single dash for # like filename does
- Add tests for: pm-agent in index, destroy --pm-agent, worktree_path in session
- Add tests for: prune detects/removes orphaned worktrees, destroy removes worktree
- Add tests for: session file v2.2 format with worktree_path

All 28 tests pass.
shoko merged commit cf18c1db04 into main 2026-03-30 15:58:41 +02:00
Sign in to join this conversation.