Skip to content

[refactor] 整合 #166 ↔ #167 的兩套 worktree 隔離公約 #169

@kiki830621

Description

@kiki830621

Problem

#166(concurrent-session isolation for PR-path branch acquisition)和 #167(parallel IDD via worktree)幾乎同時 landed,各自定義了一套 git worktree 公約,兩者 diverge:

面向 #166references/pr-flow.md → "Concurrent-session isolation") #167scripts/idd-worktree.sh + references/worktree-isolation.md
Worktree location $(git rev-parse --git-dir)/idd-worktrees/${BRANCH##*/}(在 .git 下) .claude/worktrees/idd-<N>/(working tree 內、gitignored)
命名 key branch name issue number
生命週期 ad-hoc inline snippet(手動 worktree add / worktree remove managed helper(create / cleanup / list + idd-close auto-GC)
觸發點 idd-implement PR-path branch acquisition 多視窗平行 IDD(Case B)

Why this matters

兩套公約在 idd-implement/SKILL.md 的 Phase 0.5 note 已被我臨時 prose 橋接(PR #168 rebase 時),標為「same convention at different ergonomic tiers」。但實際 location / 命名不同 → 若使用者照 #166 snippet 手動建 worktree,跟 #167 helper 建的不在同一個地方,idd-worktree.sh list / idd-close GC 看不到。這本身就是 #167 要解的「平行 session 各自為政」問題的一個實例。

Proposed direction(待 diagnose)

  1. 統一 location — 讓 docs: concurrent-session isolation rule (worktree-default + don't-yank) (#165) #166 的 pr-flow snippet 改用 .claude/worktrees/idd-<N>/(或反之),單一 source of truth。
  2. docs: concurrent-session isolation rule (worktree-default + don't-yank) (#165) #166 snippet → 呼叫 idd-worktree.sh — pr-flow 的 ad-hoc worktree add 改成 idd-worktree.sh create,讓 managed lifecycle 涵蓋 PR-path branch acquisition 場景。
  3. 釐清 branch-key vs issue-key 命名在兩場景的對應。

Out of scope


Source: surfaced during /idd-close #167(PR #168 rebase 撞到 #166 merge,發現兩套 worktree 公約)。Sister concern from #167.


Current Status

Phase: diagnosed
Last updated: 2026-05-31 by /idd-diagnose

Key Decisions

  • Complexity = Plan → next: /idd-plan #169

Blocking

  • (none) — diagnosed, awaiting pickup

Commits

  • (none yet)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions