Skip to content

T-132J-worktree-move-creates-parent-dir

Status: closed/obsoleted · Impact: low · Complexity: small

Auto-generated from a /sdlc:task-work post-mortem. Review and promote to open/ready before picking up.

git worktree move <src> <dst> fails when <dst>’s parent directory doesn’t exist — the caller must mkdir -p the parent first. Any convention change that relocates worktrees hits this. Close the gap either by documenting the mkdir -p prerequisite wherever prose invokes git worktree move, or by wrapping the move in a shared helper that creates the parent dir defensively.

LocationRole today
apps/sdlc/skills/migrate-runtime-state/migrate_runtime_state.tsThe one programmatic git worktree move caller; already creates the destination parent (mkdirSync(..., { recursive: true })) before moving
apps/sdlc/skills/migrate-runtime-state/SKILL.mdThe only prose mentioning git worktree move; does not state the parent-dir prerequisite
apps/sdlc/conventions/worktree-scope-guard.mdHome of worktree conventions; no note on the prerequisite
apps/sdlc/lib/util/git.tsShared git/worktree helpers; nothing wraps git worktree move

Either:

  • Doc-only fix: any prose that demonstrates git worktree move annotates the prerequisite as mkdir -p <dst-parent> && git worktree move <src> <dst>, and apps/sdlc/conventions/worktree-scope-guard.md records it once. Lowest cost, but only protects future readers of those docs.
  • Shared helper: a routine in apps/sdlc/lib/util/git.ts (or an op verb on the sdlc CLI) that creates the destination’s parent, then runs git worktree move. Callers use it instead of the bare command. Higher up-front cost, but future relocations get the prerequisite for free.

The right answer depends on whether worktree relocations recur: two relocations in plugin history would justify the helper; one suggests the doc fix is enough.

  1. Survey apps/sdlc/skills/**/SKILL.md and apps/sdlc/conventions/*.md for prose that mentions git worktree move. If only migrate-runtime-state’s descriptive mentions turn up, this is a one-shot issue and the doc-only fix is appropriate.
  2. Doc-only fix: prepend mkdir -p <dst-parent> && to every bare git worktree move invocation found, and add a one-line note in apps/sdlc/conventions/worktree-scope-guard.md capturing the prerequisite.
  3. Shared helper: add the routine to apps/sdlc/lib/util/git.ts, replace prose invocations with calls to it, and add a test exercising the happy-path move.
LocationKindChange
apps/sdlc/skills/**/SKILL.mdmodifyprepend mkdir -p <dst-parent> && to any bare git worktree move invocation
apps/sdlc/conventions/worktree-scope-guard.mdmodifyone-line note: create the destination parent before git worktree move
apps/sdlc/lib/util/git.tsmodifyhelper option: move routine that creates the destination parent, then moves
  • AC-1: Every git worktree move invocation in apps/sdlc/ prose either has a preceding mkdir -p <dst-parent> step OR calls a helper that creates the parent dir.
  • AC-2: A grep for git worktree move across apps/sdlc/ returns zero un-annotated raw invocations.
  • Surveying consuming projects’ local skills or hooks for bare git worktree move invocations — this task is about the SDLC plugin’s own surface.
  • none

Spawned by the /sdlc:task-work post-mortem of T-G834-move-plugin-runtime-state-to-sdlc-dir on 2026-05-22: the relocation to .sdlc/worktrees/ failed until the destination parent was created by hand. The dedup search found no overlapping open task; decision: SPAWNED.


← Back to Tasks